/* =========================
   GENERAL STYLES
   ========================= */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #003d82;
    --secondary-color: #ff8c42;
    --accent-color: #17a2b8;
    --light-bg: #f8f9fa;
    --text-dark: #212529;
    --text-light: #6c757d;
    --border-color: #dee2e6;
    --success-color: #28a745;
    --error-color: #dc3545;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    background-color: #fff;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* =========================
   NAVBAR
   ========================= */

.navbar {
    background-color: #fff;
    padding: 15px 0;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--primary-color);
    font-weight: bold;
    font-size: 20px;
}

.logo-img {
    width: 40px;
    height: 40px;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 30px;
    align-items: center;
}

.nav-menu a {
    text-decoration: none;
    color: var(--text-dark);
    transition: color 0.3s;
    font-weight: 500;
}

.nav-menu a:hover {
    color: var(--primary-color);
}

.btn-login {
    background-color: var(--primary-color);
    color: white !important;
    padding: 8px 20px;
    border-radius: 5px;
    transition: background-color 0.3s;
}

.btn-login:hover {
    background-color: #002856;
}

.dropdown {
    position: relative;
}

.dropdown-toggle::after {
    content: ' ▼';
    font-size: 10px;
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background-color: white;
    list-style: none;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    min-width: 150px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.dropdown:hover .dropdown-menu {
    display: block;
}

.dropdown-menu li {
    padding: 0;
}

.dropdown-menu a {
    display: block;
    padding: 10px 20px;
    text-decoration: none;
    color: var(--text-dark);
}

.dropdown-menu a:hover {
    background-color: var(--light-bg);
}

.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
}

.hamburger span {
    width: 25px;
    height: 3px;
    background-color: var(--text-dark);
    margin: 5px 0;
    transition: 0.3s;
}

/* =========================
   BUTTONS
   ========================= */

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: #002856;
    transform: translateY(-2px);
}

.btn-secondary {
    background-color: var(--secondary-color);
    color: white;
}

.btn-secondary:hover {
    background-color: #ff7939;
}

.btn-outline {
    background-color: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.btn-outline:hover {
    background-color: var(--primary-color);
    color: white;
}

.btn-accent {
    background-color: var(--secondary-color);
    color: white;
}

.btn-accent:hover {
    background-color: #ff7939;
}

.btn-full {
    width: 100%;
}

.btn-small {
    padding: 8px 16px;
    font-size: 14px;
}

/* =========================
   HERO SECTION
   ========================= */

.hero {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 80px 0;
}

.hero .container {
    display: flex;
    align-items: center;
    gap: 50px;
}

.hero-content {
    flex: 1;
}

.hero h1 {
    font-size: 48px;
    color: var(--primary-color);
    margin-bottom: 10px;
    line-height: 1.2;
}

.hero h2 {
    font-size: 42px;
    color: var(--secondary-color);
    margin-bottom: 20px;
}

.hero p {
    font-size: 18px;
    color: var(--text-light);
    margin-bottom: 30px;
}

.hero-buttons {
    display: flex;
    gap: 20px;
}

.hero-illustration {
    flex: 1;
    position: relative;
    height: 300px;
}

.illustration-placeholder {
    position: relative;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 30% 40%, rgba(0, 61, 130, 0.1) 0%, transparent 50%),
                radial-gradient(circle at 70% 60%, rgba(255, 140, 66, 0.1) 0%, transparent 50%);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 80px;
}

.icon-student {
    position: absolute;
    top: 20px;
    left: 40px;
    animation: float 3s ease-in-out infinite;
}

.icon-chart {
    position: absolute;
    top: 30px;
    right: 60px;
    animation: float 3s ease-in-out 0.5s infinite;
}

.icon-pie {
    position: absolute;
    top: 140px;
    left: 20px;
    animation: float 3s ease-in-out 1s infinite;
}

.icon-robot {
    position: absolute;
    bottom: 40px;
    right: 30px;
    animation: float 3s ease-in-out 1.5s infinite;
}

.icon-bulb {
    position: absolute;
    bottom: 50px;
    left: 50%;
    transform: translateX(-50%);
    animation: float 3s ease-in-out 2s infinite;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-20px);
    }
}

/* =========================
   FEATURES SECTION
   ========================= */

.features {
    padding: 60px 0;
    background-color: var(--light-bg);
}

.features .container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
}

.feature-item {
    background: white;
    padding: 30px;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s;
}

.feature-item:hover {
    transform: translateY(-5px);
}

.feature-icon {
    font-size: 50px;
    margin-bottom: 15px;
}

.feature-item h3 {
    color: var(--primary-color);
    margin-bottom: 10px;
}

.feature-item p {
    color: var(--text-light);
}

/* =========================
   WORKSHEETS SECTION
   ========================= */

.worksheets {
    padding: 80px 0;
}

.worksheets h2 {
    font-size: 36px;
    color: var(--primary-color);
    text-align: center;
    margin-bottom: 50px;
}

.worksheets-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
}

.worksheet-card {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s, box-shadow 0.3s;
}

.worksheet-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.15);
}

.worksheet-image {
    background: linear-gradient(135deg, #003d82 0%, #17a2b8 100%);
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.placeholder-image {
    background: rgba(255, 255, 255, 0.2);
    padding: 40px;
    border-radius: 10px;
    color: white;
    text-align: center;
    font-size: 16px;
    font-weight: bold;
}

.worksheet-card h3 {
    padding: 15px 20px 5px;
    color: var(--primary-color);
    font-size: 18px;
}

.worksheet-desc {
    padding: 0 20px 10px;
    color: var(--text-light);
    font-size: 14px;
    line-height: 1.5;
}

.worksheet-meta {
    display: flex;
    gap: 15px;
    padding: 0 20px 15px;
    font-size: 13px;
    color: var(--text-light);
}

.worksheet-meta .difficulty {
    padding: 3px 10px;
    border-radius: 15px;
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
}

.worksheet-meta .difficulty.easy {
    background: #d4edda;
    color: #155724;
}

.worksheet-meta .difficulty.medium {
    background: #fff3cd;
    color: #856404;
}

.worksheet-meta .difficulty.hard {
    background: #f8d7da;
    color: #721c24;
}

.worksheet-actions {
    display: flex;
    gap: 10px;
    padding: 0 20px 20px;
}

.worksheet-actions .btn {
    flex: 1;
    padding: 10px;
    font-size: 14px;
}

.worksheet-actions .btn:disabled,
.worksheet-actions .disabled-btn {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
    background: #ccc;
    border-color: #ccc;
    color: #666;
}

.no-worksheets {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    background: #f8f9fa;
    border-radius: 15px;
    color: var(--text-light);
}

.no-worksheets p {
    font-size: 18px;
}

/* =========================
   WHY CHOOSE SECTION
   ========================= */

.why-choose {
    padding: 80px 0;
    background-color: var(--light-bg);
}

.why-choose h2 {
    font-size: 36px;
    color: var(--primary-color);
    text-align: center;
    margin-bottom: 50px;
}

.benefits-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
}

.benefit-item {
    background: white;
    padding: 30px;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.benefit-icon {
    font-size: 60px;
    margin-bottom: 15px;
}

.benefit-item h3 {
    color: var(--primary-color);
    margin-bottom: 10px;
}

/* =========================
   FOOTER
   ========================= */

.footer {
    background-color: var(--primary-color);
    color: white;
    padding: 50px 0 20px;
    margin-top: 80px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 30px;
    margin-bottom: 30px;
}

.footer-section h3 {
    margin-bottom: 15px;
}

.footer-section ul {
    list-style: none;
}

.footer-section a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: color 0.3s;
}

.footer-section a:hover {
    color: white;
}

.footer-section li {
    margin-bottom: 10px;
}

.social-links {
    display: flex;
    gap: 15px;
    margin-top: 15px;
}

.social-icon {
    display: inline-block;
    width: 35px;
    height: 35px;
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    text-align: center;
    line-height: 35px;
    transition: background-color 0.3s;
}

.social-icon:hover {
    background-color: rgba(255, 255, 255, 0.4);
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    padding-top: 20px;
    text-align: center;
}

/* =========================
   AUTH SECTION
   ========================= */

.auth-section {
    padding: 80px 0;
    background-color: var(--light-bg);
    min-height: calc(100vh - 200px);
}

.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
}

.auth-box {
    background: white;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 400px;
}

.auth-box h1 {
    color: var(--primary-color);
    margin-bottom: 10px;
}

.auth-subtitle {
    color: var(--text-light);
    margin-bottom: 30px;
}

.auth-form {
    margin-bottom: 20px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-dark);
    font-weight: 600;
}

.form-group input {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 61, 130, 0.1);
}

.auth-link {
    text-align: center;
    color: var(--text-light);
}

.auth-link a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
}

.alert {
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 20px;
}

.alert-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

/* =========================
   DASHBOARD SECTION
   ========================= */

.dashboard-section {
    padding: 40px 0;
    min-height: calc(100vh - 200px);
}

.dashboard-header {
    margin-bottom: 40px;
}

.dashboard-header h1 {
    color: var(--primary-color);
    font-size: 32px;
    margin-bottom: 10px;
}

.dashboard-header p {
    color: var(--text-light);
}

.dashboard-grid {
    display: grid;
    gap: 30px;
}

.stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.stat-card {
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    gap: 20px;
}

.stat-icon {
    font-size: 40px;
}

.stat-content h3 {
    font-size: 14px;
    color: var(--text-light);
    margin-bottom: 5px;
}

.stat-number {
    font-size: 28px;
    color: var(--primary-color);
    font-weight: bold;
}

.dashboard-section-card {
    background: white;
    border-radius: 10px;
    padding: 30px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.dashboard-section-card h2 {
    color: var(--primary-color);
    margin-bottom: 20px;
}

.worksheets-list,
.tests-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.worksheet-item,
.test-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    transition: background-color 0.3s;
}

.worksheet-item:hover,
.test-item:hover {
    background-color: var(--light-bg);
}

.worksheet-info h4 {
    color: var(--primary-color);
    margin-bottom: 5px;
}

.worksheet-info p {
    color: var(--text-light);
    font-size: 14px;
}

.worksheet-progress {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    margin: 0 20px;
}

.progress-bar {
    flex: 1;
    height: 8px;
    background-color: var(--light-bg);
    border-radius: 10px;
    overflow: hidden;
    min-width: 100px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--secondary-color) 0%, var(--accent-color) 100%);
}

.test-info h4 {
    color: var(--primary-color);
    margin-bottom: 5px;
}

.test-info p {
    color: var(--text-light);
    font-size: 14px;
}

.test-score {
    display: flex;
    gap: 20px;
    align-items: center;
}

.score {
    font-weight: bold;
    color: var(--primary-color);
}

.grade {
    background-color: var(--success-color);
    color: white;
    padding: 5px 10px;
    border-radius: 5px;
    font-weight: bold;
}

/* =========================
   RESPONSIVE DESIGN
   ========================= */

@media (max-width: 768px) {
    .nav-menu {
        display: none;
        position: absolute;
        top: 70px;
        left: 0;
        width: 100%;
        flex-direction: column;
        gap: 0;
        background-color: white;
        box-shadow: 0 5px 10px rgba(0, 0, 0, 0.1);
    }
    
    .nav-menu.active {
        display: flex;
    }
    
    .nav-menu li {
        padding: 15px 20px;
        border-bottom: 1px solid var(--border-color);
    }
    
    .hamburger {
        display: flex;
    }
    
    .hero .container {
        flex-direction: column;
        gap: 30px;
    }
    
    .hero h1 {
        font-size: 32px;
    }
    
    .hero h2 {
        font-size: 28px;
    }
    
    .hero-buttons {
        flex-direction: column;
    }
    
    .hero-buttons .btn {
        width: 100%;
    }
    
    .worksheets h2,
    .why-choose h2 {
        font-size: 28px;
    }
    
    .auth-box {
        padding: 30px 20px;
    }
    
    .stat-card {
        flex-direction: column;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .hero h1 {
        font-size: 24px;
    }
    
    .hero h2 {
        font-size: 20px;
    }
    
    .btn {
        padding: 10px 16px;
        font-size: 14px;
    }
}

/* =========================
   ADMIN PANEL
   ========================= */

.admin-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 30px 20px;
    min-height: calc(100vh - 200px);
    background: linear-gradient(135deg, #f5f7fa 0%, #e4e8ec 100%);
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    background: linear-gradient(135deg, var(--primary-color) 0%, #0056b3 100%);
    padding: 25px 30px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 61, 130, 0.3);
}

.admin-header h1 {
    font-size: 32px;
    color: white;
    margin: 0;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.admin-header .btn-secondary {
    background: rgba(255,255,255,0.2);
    border: 2px solid white;
    color: white;
    padding: 12px 24px;
    font-weight: 600;
    backdrop-filter: blur(10px);
}

.admin-header .btn-secondary:hover {
    background: white;
    color: var(--primary-color);
}

.admin-sections {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 30px;
}

.admin-section {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
    border: 1px solid rgba(0,0,0,0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.admin-section:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.12);
}

.admin-section h2 {
    font-size: 22px;
    margin-bottom: 25px;
    color: var(--primary-color);
    border-bottom: 3px solid var(--secondary-color);
    padding-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.admin-section .form-group {
    margin-bottom: 20px;
}

.admin-section .form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.admin-section .form-group input,
.admin-section .form-group select,
.admin-section .form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 15px;
    transition: border-color 0.3s, box-shadow 0.3s;
    background: #fafafa;
}

.admin-section .form-group input:focus,
.admin-section .form-group select:focus,
.admin-section .form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(0, 61, 130, 0.1);
    background: white;
}

.admin-section .form-group textarea {
    min-height: 100px;
    resize: vertical;
}

.upload-area {
    border: 3px dashed var(--primary-color);
    border-radius: 15px;
    padding: 40px 20px;
    text-align: center;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    cursor: pointer;
    transition: all 0.3s ease;
}

.upload-area:hover {
    background: linear-gradient(135deg, #e9ecef 0%, #dee2e6 100%);
    border-color: var(--secondary-color);
    transform: scale(1.02);
}

.upload-area.dragover {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    border-color: #28a745;
}

.upload-area input[type="file"] {
    display: none;
}

.upload-area p {
    margin: 0;
    color: #666;
    font-size: 16px;
}

.upload-area .file-name {
    margin-top: 15px;
    color: var(--primary-color);
    font-weight: bold;
    font-size: 14px;
}

.download-info {
    background: linear-gradient(135deg, #e7f3ff 0%, #cce5ff 100%);
    padding: 15px 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    color: #004085;
    border-left: 4px solid var(--primary-color);
}

.worksheets-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.worksheets-table th {
    background: linear-gradient(135deg, var(--primary-color) 0%, #0056b3 100%);
    padding: 15px;
    text-align: left;
    font-weight: 600;
    color: white;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.worksheets-table td {
    padding: 15px;
    border-bottom: 1px solid #eee;
    background: white;
}

.worksheets-table tr:hover td {
    background: #f8f9fa;
}

.worksheets-table tr:last-child td {
    border-bottom: none;
}

.badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-featured {
    background: linear-gradient(135deg, #ffc107 0%, #ffb300 100%);
    color: #333;
    box-shadow: 0 2px 8px rgba(255, 193, 7, 0.4);
}

.badge-not-featured {
    background: #e9ecef;
    color: #666;
}

.action-buttons {
    display: flex;
    gap: 8px;
}

.action-buttons form {
    display: inline;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 12px;
    border-radius: 8px;
    font-weight: 600;
}

.btn-success {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    border: none;
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
}

.btn-success:hover {
    background: linear-gradient(135deg, #218838 0%, #1abc9c 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(40, 167, 69, 0.4);
}

.btn-danger {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    color: white;
    border: none;
    box-shadow: 0 4px 15px rgba(220, 53, 69, 0.3);
}

.btn-danger:hover {
    background: linear-gradient(135deg, #c82333 0%, #bd2130 100%);
    transform: translateY(-2px);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, #0056b3 100%);
    box-shadow: 0 4px 15px rgba(0, 61, 130, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 61, 130, 0.4);
}

@media (max-width: 992px) {
    .admin-sections {
        grid-template-columns: 1fr;
    }
    
    .admin-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
}

@media (max-width: 768px) {
    .admin-container {
        padding: 15px;
    }
    
    .admin-section {
        padding: 20px;
    }
    
    .worksheets-table {
        font-size: 12px;
    }
    
    .worksheets-table th,
    .worksheets-table td {
        padding: 10px;
    }
    
    .admin-header h1 {
        font-size: 24px;
    }
}
