/* assets/css/style.css */
:root {
    --primary-blue: #0056b3;
    --dark-blue: #003366;
    --accent-gold: #FFD700;
    --bg-light: #f4f7f9;
    --white: #ffffff;
    --text-dark: #333333;
    --text-muted: #666666;
    --error-red: #dc3545;
    --success-green: #28a745;
    --warning-orange: #ffc107;
    --sidebar-bg: #f8f9fa;
    --sidebar-active: #007bff20;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.12);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --border-radius-lg: 12px;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg-light);
    color: var(--text-dark);
    margin: 0;
    padding: 0;
    min-height: 100vh;
}

body.auth-page {
    display: flex;
    justify-content: center;
    align-items: center;
}

.auth-container {
    background: var(--white);
    padding: 2rem;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 51, 102, 0.15);
    width: 100%;
    max-width: 420px;
    border-top: 6px solid var(--accent-gold);
    animation: fadeIn 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    margin: 20px;
    margin-top: 2rem;
}

h2 {
    color: var(--primary-blue);
    text-align: center;
    margin-bottom: 1.5rem;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--primary-blue);
    font-weight: 600;
}

.form-control {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 6px;
    box-sizing: border-box;
    /* Fix padding issue */
    transition: border-color 0.3s;
}

.form-control:focus {
    border-color: var(--accent-gold);
    outline: none;
    box-shadow: 0 0 5px rgba(212, 175, 55, 0.5);
}

.btn-primary {
    background-color: var(--primary-blue);
    color: var(--accent-gold);
    border: none;
    padding: 12px 20px;
    width: 100%;
    border-radius: 6px;
    font-size: 16px;
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.3s, transform 0.1s;
}

.btn-primary:hover {
    background-color: #002244;
}

.btn-primary:active {
    transform: scale(0.98);
}

.btn-logout {
    text-decoration: none;
    padding: 8px 15px;
    border-radius: 4px;
    color: white !important;
    background-color: #d9534f;
    font-weight: bold;
    border: 1px solid #d43f3a;
    display: inline-block;
    transition: opacity 0.3s;
    font-size: 0.9rem;
}

.btn-logout:hover {
    opacity: 0.9;
    background-color: #c9302c;
}

.auth-links {
    margin-top: 1rem;
    text-align: center;
    font-size: 0.9em;
}

.auth-links a {
    color: var(--primary-blue);
    text-decoration: none;
}

.auth-links a:hover {
    text-decoration: underline;
    color: var(--accent-gold);
}

.role-toggle {
    display: flex;
    justify-content: space-around;
    margin-bottom: 1.5rem;
    background: #eef2f5;
    padding: 5px;
    border-radius: 30px;
}

.role-toggle label {
    flex: 1;
    text-align: center;
    padding: 10px;
    cursor: pointer;
    border-radius: 25px;
    transition: background 0.3s;
    color: var(--primary-blue);
    font-weight: bold;
}

.role-toggle input[type="radio"] {
    display: none;
}

.role-toggle input[type="radio"]:checked+label {
    background: var(--primary-blue);
    color: var(--accent-gold);
}

.alert {
    padding: 10px;
    margin-bottom: 1rem;
    border-radius: 6px;
    text-align: center;
}

.alert-error {
    background-color: #fce4e4;
    color: var(--error-red);
    border: 1px solid #fcc2c3;
}

.alert-success {
    background-color: #d4edda;
    color: var(--success-green);
    border: 1px solid #c3e6cb;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- Card System & Teacher UI --- */
.card {
    background: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 2rem;
    margin-bottom: 2rem;
    border: 1px solid #eee;
}

.status-badge {
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    display: inline-block;
}

.status-draft {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
}

.status-published {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.lesson-list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: var(--bg-light);
    border-radius: 8px;
    margin-bottom: 0.5rem;
    border: 1px solid #e0e0e0;
    transition: all 0.2s;
}

.lesson-list-item:hover {
    border-color: var(--primary-blue);
    background: #fff;
}

.order-controls {
    display: flex;
    gap: 5px;
}

.order-btn {
    background: none;
    border: 1px solid #ccc;
    padding: 2px 8px;
    cursor: pointer;
    border-radius: 4px;
    color: #666;
}

.order-btn:hover {
    background: var(--primary-blue);
    color: white;
    border-color: var(--primary-blue);
}

.practice-indicator {
    font-size: 0.8rem;
    background: var(--accent-gold);
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 10px;
}

/* WYSIWYG Editor Height */
.ql-container {
    height: 300px;
    font-size: 1rem;
}

.ql-toolbar {
    border-radius: 8px 8px 0 0;
}

.ql-container {
    border-radius: 0 0 8px 8px;
}

/* Language Switcher Styles */
.lang-switcher {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.lang-btn {
    text-decoration: none;
    color: var(--primary-blue);
    padding: 5px 10px;
    border: 1px solid var(--primary-blue);
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: bold;
    transition: all 0.3s;
}

.lang-btn:hover {
    background: var(--primary-blue);
    color: var(--primary-gold);
}

.lang-btn.active {
    background: var(--primary-gold);
    color: var(--primary-blue);
    border-color: var(--primary-gold);
}

/* Adjust auth-container to have language switcher */
.auth-container .lang-switcher {
    justify-content: center;
}

/* For main layout pages where switcher might be in the corner */
.top-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #ddd;
}

/* Enhanced Dashboard Styles */
.dashboard-card {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 4px 20px rgba(0, 51, 102, 0.08);
    margin-bottom: 2rem;
    border: 1px solid #e1e8ed;
}

.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-item {
    background: linear-gradient(135deg, var(--primary-blue), #004d99);
    color: white;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
}

.stat-item h4 {
    margin: 0;
    font-size: 0.9rem;
    opacity: 0.9;
}

.stat-item .value {
    font-size: 1.8rem;
    color: var(--accent-gold);
    font-weight: bold;
}

.collapsible-trigger {
    background: var(--primary-blue);
    color: white;
    padding: 15px 20px;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    font-weight: bold;
    margin-top: 15px;
}

.collapsible-content {
    display: none;
    padding: 20px;
    border: 1px solid var(--primary-blue);
    border-top: none;
    border-bottom-left-radius: 8px;
    border-bottom-right-radius: 8px;
}

.collapsible-content.active {
    display: block;
}


/* Accordion Styles */
.accordion {
    width: 100%;
}

.accordion-item {
    border: 1px solid #e1e8ed;
    border-radius: 8px;
    margin-bottom: 10px;
    overflow: hidden;
    background: #fff;
}

.accordion-header {
    background: #f8fafc;
    padding: 15px 20px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    transition: background 0.3s;
    user-select: none;
}

.accordion-header:hover {
    background: #edf2f7;
}

.accordion-header::after {
    content: '\25BC';
    font-size: 0.7rem;
    transition: transform 0.3s;
}

.accordion-item.active .accordion-header::after {
    transform: rotate(180deg);
}

.accordion-item.active .accordion-header {
    border-bottom: 1px solid #e1e8ed;
    color: var(--primary-blue);
}

.accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out, padding 0.3s;
    background: #fff;
}

.accordion-item.active .accordion-content {
    max-height: 1000px;
    /* Adjust as needed */
    padding: 15px 20px;
}

/* Report Table inside Accordion */
.report-details {
    width: 100%;
    margin-top: 10px;
}

.report-details th {
    background: #f1f5f9 !important;
    color: #475569 !important;
}

.btn-secondary {
    background-color: #64748b;
    color: white;
    padding: 10px 20px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: bold;
    display: inline-block;
    transition: opacity 0.3s;
}

.btn-secondary:hover {
    opacity: 0.9;
}

/* --- New Student Lesson View Layout --- */
.lesson-container-modern {
    display: flex;
    min-height: calc(100vh - 60px);
    background: #f0f2f5;
}

.lesson-sidebar-modern {
    width: 320px;
    background: #fff;
    border-right: 1px solid #e1e8ed;
    height: calc(100vh - 60px);
    position: sticky;
    top: 60px;
    overflow-y: auto;
    z-index: 10;
}

.sidebar-nav-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-nav-item {
    border-bottom: 1px solid #f0f2f5;
}

.sidebar-nav-link {
    display: flex;
    padding: 15px 20px;
    text-decoration: none;
    color: #4a5568;
    font-size: 0.95rem;
    line-height: 1.4;
    transition: all 0.2s;
    border-left: 4px solid transparent;
}

.sidebar-nav-link:hover {
    background: #f8fafc;
    color: var(--primary-blue);
}

.sidebar-nav-item.active .sidebar-nav-link {
    background: #003366;
    /* Darker blue as in screenshot */
    color: #fff;
    border-left-color: #ffcc00;
    /* Yellow accent from screenshot */
}

.sidebar-item-order {
    margin-right: 12px;
    font-weight: 600;
    flex-shrink: 0;
}

.lesson-content-modern {
    flex: 1;
    padding: 2rem;
    max-width: 1000px;
    margin: 0 auto;
}

.lesson-main-card {
    background: #fff;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
}

.lesson-main-title {
    color: #0056b3;
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid #ffcc00;
    padding-bottom: 10px;
}

.summary-box-accent {
    background: #f8fafc;
    border-left: 5px solid #0056b3;
    padding: 1.5rem;
    border-radius: 4px;
    margin-bottom: 2rem;
}

.summary-box-accent strong {
    color: #0056b3;
    display: block;
    margin-bottom: 0.5rem;
}

.practical-tasks-accordion {
    margin-top: 2rem;
}

.practical-tasks-header {
    background: #0056b3;
    color: #fff;
    padding: 15px 25px;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    font-weight: 700;
    font-size: 1.1rem;
    transition: background 0.3s;
}

.practical-tasks-header:hover {
    background: #004494;
}

.practical-tasks-content {
    display: none;
    padding-top: 1rem;
}

.practical-tasks-content.active {
    display: block;
}

/* Drag-and-Drop Improved UI */
.dd-zone {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    margin: 1rem 0;
}

.dd-col {
    flex: 1;
    background: #f8fafc;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.dd-col-title {
    font-weight: bold;
    color: #334155;
    margin-bottom: 10px;
    text-align: center;
}

.dd-list {
    min-height: 50px;
}

.dd-item-modern {
    background: #fff;
    padding: 10px;
    margin-bottom: 8px;
    border-radius: 4px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    border: 1px solid #e2e8f0;
    cursor: pointer;
    text-align: center;
}

.dd-item-modern:hover {
    border-color: #0056b3;
}

.dd-item-modern.selected {
    border-color: #0056b3;
    background: #eef2f7;
}