/*
================================================
Alirezaaies Website - Main Stylesheet
Version: 1.0
Author: Your AI Assistant
================================================
*/

/*
Table of Contents:
1.  CSS Variables (Custom Properties)
2.  Global Styles & Reset
3.  Layout & Container
4.  Header & Navigation
5.  Main Content & Page
6.  Footer
7.  Buttons & Forms (Basic)
8.  Alerts (System Messages)
9.  Utility Classes
10. Responsive Design
================================================
*/

/* 1. CSS Variables
------------------------------------------------ */
:root {
    --primary-color: #007BFF;
    --primary-color-dark: #0056b3;
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    
    --text-color-dark: #343a40;
    --text-color-light: #f8f9fa;
    --text-color-muted: #6c757d;
    
    --bg-light: #f8f9fa;
    --bg-dark: #343a40;
    --bg-white: #ffffff;
    
    --font-family: 'Montserrat', sans-serif;
    --border-radius-sm: 4px;
    --border-radius-md: 8px;
    --border-radius-lg: 16px;
    
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    --header-height: 70px;
}

/* 2. Global Styles & Reset
------------------------------------------------ */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    background-color: var(--bg-light);
    color: var(--text-color-dark);
    line-height: 1.6;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.3;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--primary-color-dark);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

ul, ol {
    list-style-position: inside;
}

/* 3. Layout & Container
------------------------------------------------ */
.container {
    width: 90%;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 1rem;
    padding-right: 1rem;
}

/* 4. Header & Navigation
------------------------------------------------ */
.site-header {
    background-color: var(--bg-white);
    position: sticky;
    top: 0;
    z-index: 1000;
    height: var(--header-height);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    border-bottom: 1px solid #e0e0e0;
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

.navbar-brand i {
    font-size: 1.8rem;
}

.nav-links {
    display: flex;
    gap: 2.5rem;
}

.nav-links a {
    font-weight: 600;
    color: var(--text-color-dark);
    padding: 0.5rem 0;
    position: relative;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--primary-color);
    transition: width 0.3s ease;
}

.nav-links a:hover::after, .nav-links a.active::after {
    width: 100%;
}

.auth-links {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.profile-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
    color: var(--text-color-dark);
}

.profile-img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--primary-color);
}

.profile-icon {
    font-size: 2rem;
    color: var(--secondary-color);
}

.btn-logout {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    color: var(--secondary-color);
    padding: 0.5rem;
    transition: color 0.3s ease;
}

.btn-logout:hover {
    color: var(--danger-color);
}

.menu-toggle {
    display: none; /* Hidden by default */
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-color-dark);
    cursor: pointer;
}

/* 5. Main Content & Page
------------------------------------------------ */
.main-content {
    padding-top: 2rem;
    padding-bottom: 4rem;
    min-height: calc(100vh - var(--header-height) - 100px); /* 100px is footer height guess */
}

/* 6. Footer
------------------------------------------------ */
.site-footer-main {
    background-color: var(--bg-dark);
    color: var(--text-color-light);
    padding: 2rem 0;
    text-align: center;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.footer-socials {
    display: flex;
    gap: 1.5rem;
}

.footer-socials a {
    color: var(--text-color-light);
    font-size: 1.3rem;
    transition: color 0.3s, transform 0.3s;
}

.footer-socials a:hover {
    color: var(--primary-color);
    transform: translateY(-3px);
}

/* 7. Buttons (Basic)
------------------------------------------------ */
.btn {
    display: inline-block;
    padding: 0.6rem 1.5rem;
    border: 1px solid transparent;
    border-radius: var(--border-radius-sm);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    text-align: center;
    transition: all 0.3s ease;
}

.btn-primary {
    background-color: var(--primary-color);
    color: var(--bg-white);
    border-color: var(--primary-color);
}

.btn-primary:hover {
    background-color: var(--primary-color-dark);
    color: var(--bg-white);
}

.btn-secondary {
    background-color: transparent;
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-secondary:hover {
    background-color: var(--primary-color);
    color: var(--bg-white);
}

/* 8. Alerts (System Messages)
------------------------------------------------ */
.alert {
    padding: 1rem;
    margin-bottom: 1.5rem;
    border-radius: var(--border-radius-md);
    font-weight: 500;
    border-left: 5px solid;
}
.alert-success {
    background-color: #d4edda;
    color: #155724;
    border-color: #c3e6cb;
}
.alert-error, .alert-danger {
    background-color: #f8d7da;
    color: #721c24;
    border-color: #f5c6cb;
}
.alert-warning {
    background-color: #fff3cd;
    color: #856404;
    border-color: #ffeeba;
}
.alert-info {
    background-color: #d1ecf1;
    color: #0c5460;
    border-color: #bee5eb;
}

/* 10. Responsive Design
------------------------------------------------ */
@media (max-width: 768px) {
    .navbar {
        position: relative;
    }
    
    .menu-toggle {
        display: block; /* Show hamburger menu */
    }

    .nav-links {
        display: none; /* Hide nav links */
        flex-direction: column;
        position: absolute;
        top: 100%; /* Position below the header */
        left: 0;
        width: 100%;
        background-color: var(--bg-white);
        box-shadow: 0 4px 8px rgba(0,0,0,0.1);
        padding: 1rem;
        border-top: 1px solid #e0e0e0;
    }

    .nav-links.active {
        display: flex; /* Show nav links when active */
    }

    .auth-links .profile-name {
        display: none; /* Hide name on small screens */
    }
    
    .footer-content {
        flex-direction: column;
        justify-content: center;
    }
}

/*
================================================
11. Page-Specific Styles: Home
================================================
*/

/* --- Hero Section --- */
.hero-section {
    position: relative;
    height: 70vh;
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--bg-white);
    background-image: url('../images/hero-bg.jpg'); /* شما باید یک عکس مناسب در static/images/hero-bg.jpg قرار دهید */
    background-size: cover;
    background-position: center;
    background-attachment: fixed; /* Parallax effect */
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, rgba(0, 38, 84, 0.8), rgba(0, 123, 255, 0.7));
}

.hero-content {
    position: relative; /* To be on top of the overlay */
    z-index: 2;
}

.hero-content h1 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.hero-content p {
    font-size: 1.25rem;
    max-width: 650px;
    margin: 0 auto 1.5rem auto;
    opacity: 0.9;
}

.btn-lg {
    padding: 0.8rem 2.5rem;
    font-size: 1.1rem;
    border-radius: 50px; /* Pill shape */
}

/* --- Generic Section Styling --- */
.page-section {
    padding: 5rem 0;
}
.bg-white {
    background-color: var(--bg-white);
}

.section-title {
    text-align: center;
    margin-bottom: 3rem;
}
.section-title h2 {
    font-size: 2.25rem;
    margin-bottom: 0.5rem;
}
.section-title p {
    color: var(--text-color-muted);
    font-size: 1.1rem;
}

/* --- Services Section --- */
.service-cards-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}
.service-card-link, .service-card-link-disabled {
    text-decoration: none;
    color: inherit;
}
.service-card {
    background-color: var(--bg-white);
    padding: 2.5rem 2rem;
    border-radius: var(--border-radius-md);
    text-align: center;
    box-shadow: var(--shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border-top: 4px solid var(--primary-color);
}
.service-card-link:hover .service-card {
    transform: translateY(-10px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.12);
}

.service-card .card-icon {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 1.5rem;
}
.service-card h3 {
    font-size: 1.4rem;
    margin-bottom: 0.75rem;
}

/* Disabled card style */
.service-card.is-disabled {
    border-top-color: var(--secondary-color);
    background-color: #f9f9f9;
}
.service-card.is-disabled .card-icon {
    color: var(--secondary-color);
    opacity: 0.6;
}
.service-card.is-disabled h3, .service-card.is-disabled p {
    opacity: 0.6;
}

/* --- About Me Section --- */
.about-container {
    display: flex;
    align-items: center;
    gap: 4rem;
}
.about-image-container {
    flex-shrink: 0;
}
.about-profile-pic {
    width: 250px;
    height: 250px;
    object-fit: cover;
    border-radius: 50%;
    border: 8px solid var(--bg-white);
    box-shadow: var(--shadow);
}
.about-text-content h2 {
    font-size: 2.25rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
}
.about-text-content p {
    font-size: 1.1rem;
    margin-bottom: 2rem;
}

/* --- Responsive adjustments for home page --- */
@media (max-width: 992px) {
    .about-container {
        gap: 2rem;
    }
}
@media (max-width: 768px) {
    .hero-content h1 {
        font-size: 2.2rem;
    }
    .hero-content p {
        font-size: 1.1rem;
    }
    .about-container {
        flex-direction: column;
        text-align: center;
    }
    .about-profile-pic {
        width: 180px;
        height: 180px;
    }
}

/*
================================================
12. Page-Specific Styles: About
================================================
*/

.page-header {
    background: var(--primary-color);
    background: linear-gradient(45deg, var(--primary-color), var(--primary-color-dark));
    color: var(--bg-white);
    padding: 3rem 0;
    text-align: center;
    margin-bottom: 4rem;
}
.page-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
}

/* --- About Intro --- */
.about-intro {
    display: flex;
    gap: 2rem;
    align-items: center;
    margin-bottom: 5rem;
}
.about-intro-image {
    flex: 0 0 200px; /* Do not grow, do not shrink, base width 200px */
}
.profile-main-image {
    width: 200px;
    height: 200px;
    object-fit: cover;
    border-radius: 50%;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
}
.about-intro-text h2 {
    font-size: 2rem;
    font-weight: 700;
}
.about-intro-text h3 {
    font-size: 1.2rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-weight: 600;
}

/* --- Timeline --- */
.timeline {
    position: relative;
    max-width: 750px;
    margin: 0 auto 5rem auto;
    padding: 1rem 0;
}
.timeline::after {
    content: '';
    position: absolute;
    width: 3px;
    background-color: var(--primary-color);
    opacity: 0.3;
    top: 0;
    bottom: 0;
    left: 50%;
    margin-left: -1.5px;
}
.timeline-item {
    padding: 1rem 3rem;
    position: relative;
    width: 50%;
}
.timeline-item:nth-child(odd) {
    left: 0;
}
.timeline-item:nth-child(even) {
    left: 50%;
}
.timeline-item::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    top: 24px;
    background-color: white;
    border: 3px solid var(--primary-color);
    border-radius: 50%;
    z-index: 1;
}
.timeline-item:nth-child(odd)::after {
    right: -8px;
}
.timeline-item:nth-child(even)::after {
    left: -8px;
}
.timeline-icon {
    position: absolute;
    top: 17px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background-color: var(--primary-color);
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2;
    font-size: 0.9rem;
}
.timeline-item:nth-child(odd) .timeline-icon {
    right: -45px;
}
.timeline-item:nth-child(even) .timeline-icon {
    left: -45px;
}
.timeline-content {
    padding: 1.5rem;
    background-color: var(--bg-white);
    border-radius: var(--border-radius-md);
    box-shadow: var(--shadow);
    position: relative;
}
.timeline-content h3 {
    margin-top: 0;
    color: var(--primary-color);
}
.timeline-date {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-color-muted);
}

/* --- Skills Grid --- */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    text-align: center;
}
.skill-item {
    background-color: var(--bg-white);
    padding: 2rem 1rem;
    border-radius: var(--border-radius-md);
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    font-weight: 600;
    transition: transform 0.3s, box-shadow 0.3s;
}
.skill-item:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow);
    color: var(--primary-color);
}
.skill-item i {
    margin-right: 0.75rem;
    color: var(--primary-color);
    transition: color 0.3s;
}
.skill-item:hover i {
    color: var(--primary-color-dark);
}

/* --- Responsive for About page --- */
@media (max-width: 768px) {
    .about-intro {
        flex-direction: column;
        text-align: center;
    }
    .timeline::after {
        left: 15px;
    }
    .timeline-item {
        width: 100%;
        padding-left: 50px;
        padding-right: 15px;
    }
    .timeline-item:nth-child(even) {
        left: 0%;
    }
    .timeline-icon,
    .timeline-item:nth-child(odd) .timeline-icon,
    .timeline-item:nth-child(even) .timeline-icon {
        left: 0;
    }
    .timeline-item::after,
    .timeline-item:nth-child(odd)::after,
    .timeline-item:nth-child(even)::after {
        left: 7.5px;
    }
}


/*
================================================
13. Page-Specific Styles: IELTS Hub
================================================
*/

/* --- General Intro Text for Pages --- */
.section-intro-text {
    max-width: 800px;
    margin: 0 auto 3rem auto;
    text-align: center;
    font-size: 1.1rem;
    line-height: 1.7;
}
.section-intro-text strong {
    color: var(--primary-color);
}

/* --- IELTS Tasks Container --- */
.ielts-tasks-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.task-card-item {
    background-color: var(--bg-white);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    overflow: hidden; /* Ensures child elements conform to border-radius */
    transition: transform 0.3s, box-shadow 0.3s;
}

.task-card-item:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 24px rgba(0,0,0,0.1);
}

.task-card-header {
    background: linear-gradient(45deg, #eef7ff, #ffffff);
    padding: 1.5rem;
    border-bottom: 1px solid #e0e7ff;
}
.task-card-header h3 {
    margin: 0;
    font-size: 1.75rem;
    color: var(--primary-color);
}
.task-card-header span {
    color: var(--text-color-muted);
    font-weight: 500;
}

.task-card-body {
    padding: 1.5rem;
    flex-grow: 1; /* Allows this section to grow and push footer down */
}

.task-card-actions {
    background-color: var(--bg-light);
    padding: 1rem 1.5rem;
    display: flex;
    gap: 1rem;
    border-top: 1px solid #e9ecef;
}
.task-card-actions .btn {
    flex-grow: 1; /* Make buttons take equal space */
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

/* --- Responsive for IELTS Hub page --- */
@media (max-width: 768px) {
    .ielts-tasks-container {
        grid-template-columns: 1fr; /* Stack cards on top of each other */
    }
}

/*
================================================
14. Page-Specific Styles: Auth (Login/Register)
================================================
*/

.auth-page-container {
    display: flex;
    justify-content: center;
    align-items: flex-start; /* Aligns to top for better view */
    padding: 4rem 1rem;
    min-height: 80vh;
}

.auth-card {
    width: 100%;
    max-width: 450px;
    background-color: var(--bg-white);
    padding: 2.5rem;
    border-radius: var(--border-radius-lg);
    box-shadow: 0 8px 30px rgba(0,0,0,0.1);
}

.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}
.auth-header i {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}
.auth-header h2 {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
}
.auth-header p {
    color: var(--text-color-muted);
}

.auth-form .form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

/* Common style for form inputs */
.auth-form input[type="text"],
.auth-form input[type="email"],
.auth-form input[type="password"] {
    width: 100%;
    padding: 0.8rem 1rem;
    border: 1px solid #ccc;
    border-radius: var(--border-radius-md);
    font-size: 1rem;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.auth-form input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.25);
}

.btn-full-width {
    width: 100%;
    padding-top: 0.8rem;
    padding-bottom: 0.8rem;
    font-size: 1.1rem;
}

.form-error {
    color: var(--danger-color);
    font-size: 0.85rem;
    margin-top: 0.25rem;
    font-weight: 500;
}

.form-help-text {
    display: block;
    font-size: 0.8rem;
    color: var(--text-color-muted);
    margin-top: 0.25rem;
}

.auth-footer {
    text-align: center;
    margin-top: 2rem;
    font-size: 0.95rem;
}

/*
================================================
15. Page-Specific Styles: Profile & Forms
================================================
*/

/* --- Profile Page --- */
.profile-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}
.profile-card {
    background-color: var(--bg-white);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow);
    overflow: hidden;
}
.profile-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    background-color: var(--bg-light);
    border-bottom: 1px solid #e9ecef;
}
.profile-card-header h3 {
    margin: 0;
    font-size: 1.25rem;
}
.btn-sm {
    padding: 0.3rem 0.8rem;
    font-size: 0.85rem;
}
.btn-sm i {
    margin-right: 0.3rem;
}

.profile-card-body {
    padding: 1.5rem;
}
.profile-avatar-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 2rem;
    text-align: center;
}
.profile-avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 1rem;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}
.profile-avatar-default {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background-color: #e9ecef;
    color: var(--secondary-color);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 3rem;
    margin-bottom: 1rem;
}
.profile-email {
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--text-color-dark);
}

.info-list {
    list-style: none;
    padding: 0;
}
.info-list li {
    display: flex;
    justify-content: space-between;
    padding: 1rem 0;
    border-bottom: 1px solid #f1f1f1;
}
.info-list li:last-child {
    border-bottom: none;
}
.info-list strong {
    color: var(--text-color-dark);
}
.info-list span {
    color: var(--text-color-muted);
    text-align: right;
}
.info-list .about-text {
    text-align: left;
    white-space: pre-wrap; /* Preserve line breaks in about text */
    flex-basis: 70%;
}
.text-muted {
    color: var(--text-color-muted);
    font-style: italic;
}


/* --- Generic Form Page (for edit pages) --- */
.form-page-container {
    display: flex;
    justify-content: center;
    padding: 4rem 1rem;
}
.form-card {
    width: 100%;
    max-width: 650px;
    background-color: var(--bg-white);
    padding: 2.5rem;
    border-radius: var(--border-radius-lg);
    box-shadow: 0 8px 30px rgba(0,0,0,0.1);
}
.form-card h2 {
    text-align: center;
    font-size: 1.8rem;
    margin-bottom: 2rem;
}
.form-card h2 i {
    color: var(--primary-color);
    margin-right: 0.75rem;
}
.styled-form p { /* Targeting <p> tags generated by form.as_p */
    display: flex;
    flex-direction: column;
    margin-bottom: 1.5rem;
}
.styled-form p label {
    margin-bottom: 0.5rem;
    font-weight: 600;
}
.styled-form input,
.styled-form textarea,
.styled-form select {
    width: 100%;
    padding: 0.8rem 1rem;
    border: 1px solid #ccc;
    border-radius: var(--border-radius-md);
    font-size: 1rem;
}
.styled-form input:focus,
.styled-form textarea:focus,
.styled-form select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.25);
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 2rem;
    border-top: 1px solid #e9ecef;
    padding-top: 1.5rem;
}

/*
================================================
16. Page-Specific Styles: Submission Forms
================================================
*/

.large-form-card {
    max-width: 800px;
}
.form-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e9ecef;
}
.form-card-header h2 {
    margin: 0;
}
.btn-back-link {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--secondary-color);
}
.btn-back-link i {
    margin-right: 0.4rem;
}
.submission-form textarea {
    min-height: 250px;
    resize: vertical;
}

.word-counter {
    text-align: right;
    font-size: 0.85rem;
    color: var(--text-color-muted);
    margin-top: 0.5rem;
}
.centered-actions {
    justify-content: center;
}

/* --- Loading Overlay --- */
#loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.9);
    display: none; /* Hidden by default */
    justify-content: center;
    align-items: center;
    z-index: 9999;
    flex-direction: column;
    text-align: center;
    backdrop-filter: blur(5px);
}
#loading-overlay p {
    margin-top: 1rem;
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-color-dark);
}

.spinner {
    border: 5px solid #f3f3f3;
    border-top: 5px solid var(--primary-color);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

#loading-overlay.active {
    display: flex;
}

/*
================================================
17. Component Styles: Custom Form Controls
================================================
*/

/* --- Specific Textarea sizing --- */
.form-textarea-small {
    min-height: 80px;
    resize: vertical;
}

.form-textarea-large {
    min-height: 300px; /* افزایش ارتفاع برای حس بهتر */
    resize: vertical;
}

/* --- Styling for File Input --- */
.form-control-file {
    display: block;
    width: 100%;
}
/* You can add more advanced styling for file input later if you wish */


/*
================================================
18. Page-Specific Styles: Feedback List
================================================
*/

.feedback-list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.feedback-list-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.feedback-item-link {
    text-decoration: none;
    color: inherit;
    display: block;
    transition: transform 0.2s ease;
}

.feedback-item-link:hover {
    transform: translateY(-4px);
}

.feedback-item {
    display: grid;
    grid-template-columns: 1.5fr 3fr 1fr auto;
    gap: 1.5rem;
    align-items: center;
    background-color: var(--bg-white);
    padding: 1.25rem 2rem;
    border-radius: var(--border-radius-md);
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    border-left: 5px solid var(--secondary-color);
    transition: border-color 0.3s ease;
}
.feedback-item:hover {
    border-left-color: var(--primary-color);
}

.feedback-item-date,
.feedback-item-question,
.feedback-item-score {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.feedback-item-date {
    color: var(--text-color-muted);
    font-size: 0.9rem;
}
.feedback-item-question {
    font-size: 0.95rem;
}

.feedback-item-score {
    flex-direction: column;
    background-color: var(--primary-color);
    color: var(--bg-white);
    border-radius: var(--border-radius-md);
    padding: 0.5rem 1rem;
    text-align: center;
    min-width: 100px;
}
.feedback-item-score .score-label {
    font-size: 0.75rem;
    font-weight: 500;
    opacity: 0.8;
}
.feedback-item-score .score-value {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.2;
}

.feedback-item-arrow {
    color: var(--text-color-muted);
    font-size: 1.2rem;
    transition: transform 0.3s ease;
}
.feedback-item:hover .feedback-item-arrow {
    transform: translateX(5px);
    color: var(--primary-color);
}

.no-data-card {
    text-align: center;
    padding: 4rem 2rem;
    background-color: var(--bg-white);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow);
}
.no-data-card i {
    font-size: 4rem;
    color: var(--text-color-muted);
    opacity: 0.5;
    margin-bottom: 1.5rem;
}
.no-data-card h3 {
    font-size: 1.5rem;
}
.no-data-card p {
    color: var(--text-color-muted);
}


/* Responsive for feedback list */
@media (max-width: 768px) {
    .feedback-item {
        grid-template-columns: 1fr;
        gap: 1rem;
        text-align: center;
        padding: 1.5rem;
    }
    .feedback-item > div {
        justify-content: center;
    }
    .feedback-item-score {
        width: 50%;
        margin: 0 auto;
    }
    .feedback-item-arrow {
        display: none; /* Hide arrow on mobile, the whole card is a link */
    }
}

/*
================================================
19. Page-Specific Styles: Feedback Detail
================================================
*/
.feedback-detail-container {
    background-color: var(--bg-white);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow);
    overflow: hidden;
}

/* --- Tab Navigation --- */
.tabs-container {
    background-color: #f7f9fc;
    border-bottom: 1px solid #e9ecef;
}
.tab-nav {
    display: flex;
    overflow-x: auto;
    -ms-overflow-style: none;  /* IE and Edge */
    scrollbar-width: none;  /* Firefox */
}
.tab-nav::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}
.tab-btn {
    padding: 1rem 1.5rem;
    cursor: pointer;
    background: none;
    border: none;
    font-weight: 600;
    color: var(--text-color-muted);
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
    flex-shrink: 0;
}
.tab-btn i {
    margin-right: 0.5rem;
}
.tab-btn.active, .tab-btn:hover {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

/* --- Tab Content --- */
.tab-content-container {
    padding: 2.5rem;
}
.tab-pane {
    display: none;
}
.tab-pane.active {
    display: block;
    animation: fadeIn 0.5s;
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
.tab-pane h4 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: var(--primary-color-dark);
}
/* --- Score Grid --- */
.score-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}
.score-box {
    background-color: #f7f9fc;
    border-radius: var(--border-radius-md);
    padding: 1rem;
    text-align: center;
    border: 1px solid #e9ecef;
}
.score-box span {
    display: block;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-color-muted);
}
.score-box strong {
    display: block;
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
}
.score-box.overall strong {
    color: var(--success-color);
}

/* --- Comments, Corrections, Vocab --- */
.feedback-comments-section ul, .correction-list, .vocab-list {
    list-style: none;
    padding: 0;
}
/* .correction-list li, .vocab-list li {
    background: #f7f9fc;
    border-left: 4px solid var(--primary-color);
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: 0 var(--border-radius-sm) var(--border-radius-sm) 0;
}
.correction-body {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 1.1rem;
}
.error-text { color: var(--danger-color); }
.fix-text { color: var(--success-color); font-weight: 600; } */
.suggestion-section {
    margin-top: 2rem;
}

.suggestion-section h4 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: var(--primary-color-dark);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.suggestion-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.suggestion-item {
    background-color: #fcfdff;
    border: 1px solid #eaf2ff;
    border-radius: var(--border-radius-md);
    overflow: hidden; /* Ensures child elements conform to border-radius */
    box-shadow: 0 4px 12px rgba(0, 81, 178, 0.05);
}

.suggestion-category {
    font-weight: 600;
    font-size: 1.1rem;
    padding: 0.75rem 1.5rem;
    background-color: #eaf2ff;
    color: var(--primary-color-dark);
}

.suggestion-content {
    padding: 1.5rem;
}

/* Specific styling for Corrections */
.correction-item .suggestion-content {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

.block-label {
    display: block;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 0.25rem;
    opacity: 0.7;
}

.error-block, .fix-block, .vocab-definition, .vocab-example {
    line-height: 1.6;
}

.error-block .block-label { color: var(--danger-color); }
.error-block p { 
    background-color: rgba(220, 53, 69, 0.05);
    padding: 0.75rem;
    border-radius: var(--border-radius-sm);
    text-decoration: line-through;
}

.fix-block .block-label { color: var(--success-color); }
.fix-block p {
    background-color: rgba(40, 167, 69, 0.05);
    padding: 0.75rem;
    border-radius: var(--border-radius-sm);
    font-weight: 500;
}

/* Specific styling for Vocabulary */
.vocab-definition, .vocab-example {
    margin-bottom: 1rem;
}
.vocab-definition p, .vocab-example p {
    font-size: 1rem;
}
.vocab-example p {
    font-style: italic;
    color: var(--text-color-muted);
}
.vocab-item .block-label { color: var(--text-color-muted); }


.suggestion-empty {
    text-align: center;
    padding: 2rem;
    background-color: #f7f9fc;
    border-radius: var(--border-radius-md);
    color: var(--text-color-muted);
}
/* --- Original & Rewritten Essay --- */
.original-essay-box, .rewritten-essay {
    background-color: #fdfdfd;
    border: 1px solid #eee;
    padding: 1.5rem;
    border-radius: var(--border-radius-md);
}
.original-essay-box pre {
    white-space: pre-wrap; /* a life saver for displaying text */
    word-wrap: break-word;
    font-family: inherit;
    font-size: 1rem;
    line-height: 1.7;
}

.question-image {
    max-width: 100%;
    margin: 1rem 0;
    border-radius: var(--border-radius-md);
    border: 1px solid #ddd;
}

@media (max-width: 768px) {
    .score-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .score-box.overall {
        grid-column: 1 / -1; /* Make it full width */
    }
}

/*
/*
================================================
20. Page-Specific Styles: Dashboards (No Chart Version)
================================================
*/
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}
.stat-card {
    background-color: var(--bg-white);
    padding: 2rem;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 1.5rem;
    transition: transform 0.3s, box-shadow 0.3s;
}
.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.08);
}
.stat-card-icon {
    font-size: 2.5rem;
    color: var(--primary-color);
}
.stat-card-content {
    display: flex;
    flex-direction: column;
}
.stat-card .stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1.1;
}
.stat-card .stat-label {
    font-size: 1rem;
    color: var(--text-color-muted);
    font-weight: 500;
}
.dashboard-actions {
    text-align: center;
    margin-top: 3rem;
    display: flex;
    justify-content: center;
    gap: 1rem;
}

/*
================================================
21. Component Styles: Loading Overlay
================================================
*/
.loading-overlay-container {
    position: fixed; /* Position relative to the viewport */
    top: 0;
    left: 0;
    width: 100vw; /* Full viewport width */
    height: 100vh; /* Full viewport height */
    background-color: rgba(255, 255, 255, 0.85); /* White background with high opacity */
    backdrop-filter: blur(8px); /* Frosted glass effect */
    -webkit-backdrop-filter: blur(8px); /* For Safari */
    z-index: 9999; /* Make sure it's on top of everything */

    display: flex; /* Using flexbox for easy centering */
    justify-content: center;
    align-items: center;

    /* Hidden by default, made visible with JS */
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0s 0.3s;
}

.loading-overlay-container.active {
    opacity: 1;
    visibility: visible;
    transition: opacity 0.3s ease;
}

.loading-content {
    text-align: center;
}

/* Spinner Animation */
.spinner {
    width: 60px;
    height: 60px;
    border: 6px solid #e0e7ff; /* A light, neutral color for the track */
    border-top-color: var(--primary-color); /* The moving part of the spinner */
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1.5rem auto; /* Center the spinner and add space below */
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading-content p {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-color-dark);
}