* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', 'Arial', sans-serif;
    background: linear-gradient(135deg, #2d5a27 0%, #4a7c59 100%);
    min-height: 100vh;
    padding: 20px;
    position: relative;
}

body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        radial-gradient(circle at 25% 25%, rgba(255,255,255,0.05) 0%, transparent 50%),
        radial-gradient(circle at 75% 75%, rgba(255,255,255,0.05) 0%, transparent 50%);
    pointer-events: none;
}

.container-fluid {
    max-width: 900px;
    margin: 0 auto;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    border: 3px solid #2d5a27;
    position: relative;
}

.container-fluid::before {
    content: "";
    position: absolute;
    top: -3px;
    left: -3px;
    right: -3px;
    bottom: -3px;
    background: linear-gradient(45deg, #2d5a27, #4a7c59, #6b9e78, #4a7c59, #2d5a27);
    border-radius: 15px;
    z-index: -1;
}

header {
    background: linear-gradient(135deg, #2d5a27 0%, #4a7c59 100%);
    color: white;
    padding: 40px 20px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

header::before {
    content: "ٱلْحَمْدُ لِلّٰهِ";
    position: absolute;
    top: 10px;
    left: 20px;
    font-size: 1.5em;
    opacity: 0.3;
    font-family: 'Arial', sans-serif;
}

header::after {
    content: "سُبْحَانَ اللّٰهِ";
    position: absolute;
    top: 10px;
    right: 20px;
    font-size: 1.5em;
    opacity: 0.3;
    font-family: 'Arial', sans-serif;
}

header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
}

header p {
    font-size: 1.1em;
    opacity: 0.9;
}

main {
    padding: 30px;
}

.section {
    margin-bottom: 40px;
    background: white;
    border-radius: 8px;
    padding: 24px;
    border: 1px solid #e5e7eb;
}

.section h2 {
    color: #1b4332;
    font-size: 1.2em;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #2d5a27;
}

/* Form Styles */
form {
    display: grid;
    gap: 15px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

label {
    margin-bottom: 8px;
    color: #555;
    font-weight: 600;
    font-size: 0.95em;
}

input[type="text"],
input[type="number"],
input[type="password"],
textarea {
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 1em;
    font-family: inherit;
    transition: border-color 0.3s;
    width: 100%;
    box-sizing: border-box;
}

input[type="text"]:focus,
input[type="number"]:focus,
input[type="password"]:focus,
textarea:focus {
    outline: none;
    border-color: #2d5a27;
    box-shadow: 0 0 0 3px rgba(45, 90, 39, 0.1);
}

/* Button Styles */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background: linear-gradient(135deg, #2d5a27 0%, #4a7c59 100%);
    color: white;
    width: 100%;
    justify-content: center;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(45, 90, 39, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-success {
    background: #4a7c59;
    color: white;
}

.btn-success:hover {
    background: #2d5a27;
    transform: translateY(-2px);
}

.btn-secondary {
    background: #6b7280;
    color: white;
}

.btn-secondary:hover {
    background: #4b5563;
    transform: translateY(-2px);
}

.btn-danger {
    background: #ef4444;
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
    transform: translateY(-2px);
}

.provider-toggle {
    display: flex;
    gap: 20px;
    margin-top: 6px;
}

.provider-toggle label {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-weight: normal;
}

.button-group {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 10px;
    margin-top: 20px;
}

.spinner {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.section-header h2 {
    margin-bottom: 0;
}

.btn-export {
    background: #065f46;
    color: white;
    padding: 8px 16px;
    font-size: 13px;
}

.btn-export:hover {
    background: #047857;
    transform: translateY(-2px);
}

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal {
    background: white;
    border-radius: 12px;
    padding: 30px;
    width: 360px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.modal h3 {
    margin-bottom: 8px;
    color: #1b4332;
    font-size: 18px;
}

.modal p {
    color: #6b7280;
    font-size: 14px;
    margin-bottom: 20px;
}

.modal-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.modal-actions .btn {
    flex: 1;
}

/* Generated Content */
#generatedContent {
    background: #f9fafb;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 2px solid #e5e7eb;
    position: relative;
}

#generatedContent::before {
    content: "بِسْمِ اللّٰهِ الرَّحْمٰنِ الرَّحِيمِ";
    position: absolute;
    top: 10px;
    left: 20px;
    color: #2d5a27;
    opacity: 0.2;
    font-size: 0.9em;
    font-weight: bold;
}

.ref-display {
    font-size: 1.2em;
    font-weight: 600;
    color: #2d5a27;
    margin-bottom: 15px;
}

.lesson {
    background: white;
    padding: 15px;
    margin-bottom: 15px;
    border-left: 4px solid #2d5a27;
    border-radius: 4px;
    position: relative;
    box-shadow: 0 2px 8px rgba(45, 90, 39, 0.1);
}

.lesson::before {
    content: "۞";
    position: absolute;
    top: 10px;
    right: 15px;
    color: #2d5a27;
    opacity: 0.3;
    font-size: 1.2em;
}

.lesson-field {
    margin-bottom: 10px;
}

.lesson-field label {
    display: block;
    margin-bottom: 5px;
    color: #666;
    font-size: 0.9em;
    font-weight: 500;
}

.lesson-field input,
.lesson-field textarea {
    width: 100%;
}

.takeaways-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 2px solid #e5e7eb;
}

.takeaway-item {
    background: white;
    padding: 10px;
    margin-bottom: 10px;
    border-left: 4px solid #4a7c59;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(74, 124, 89, 0.1);
}

.takeaway-item input {
    width: 100%;
}

/* Data List */
.data-list {
    display: grid;
    gap: 15px;
}

.data-item {
    background: #f9fafb;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    padding: 15px;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
}

.data-item::before {
    content: "ﷺ";
    position: absolute;
    top: 10px;
    right: 15px;
    color: #2d5a27;
    opacity: 0.3;
    font-size: 1.1em;
}

.data-item:hover {
    border-color: #2d5a27;
    box-shadow: 0 4px 12px rgba(45, 90, 39, 0.1);
}

.data-item.expanded {
    border-color: #2d5a27;
    background: white;
}

.data-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.data-item-title {
    font-weight: 600;
    color: #333;
}

.data-item-meta {
    font-size: 0.9em;
    color: #666;
    margin-top: 5px;
}

.data-item-content {
    margin-top: 15px;
    display: none;
}

.data-item.expanded .data-item-content {
    display: block;
}

.item-actions {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.item-actions button {
    padding: 8px 12px;
    font-size: 0.9em;
}

/* Alert */
.alert {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    border-radius: 6px;
    z-index: 1000;
    animation: slideIn 0.3s ease-out;
}

.alert.success {
    background: #4a7c59;
    color: white;
}

.alert.error {
    background: #ef4444;
    color: white;
}

@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Responsive */
@media (max-width: 768px) {
    header h1 {
        font-size: 1.8em;
    }

    .button-group {
        grid-template-columns: 1fr;
    }

    main {
        padding: 20px;
    }

    .data-item-header {
        flex-direction: column;
        align-items: flex-start;
    }
}
