/* Vocabulary Practice Challenge System - Main Stylesheet */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f5f7fa;
    color: #333;
    line-height: 1.6;
}

/* Navigation Bar */
.navbar {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 15px 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

.nav-brand {
    font-size: 24px;
    font-weight: bold;
    color: white;
    text-decoration: none;
    z-index: 1001;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 30px;
    align-items: center;
}

.nav-menu a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    transition: opacity 0.3s;
}

.nav-menu a:hover {
    opacity: 0.8;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
    color: white;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: #667eea;
}

/* Mobile Menu Toggle */
.nav-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
    z-index: 1001;
}

.nav-toggle span {
    width: 25px;
    height: 3px;
    background: white;
    margin: 3px 0;
    transition: 0.3s;
    border-radius: 3px;
}

.nav-toggle.active span:nth-child(1) {
    transform: rotate(-45deg) translate(-5px, 6px);
}

.nav-toggle.active span:nth-child(2) {
    opacity: 0;
}

.nav-toggle.active span:nth-child(3) {
    transform: rotate(45deg) translate(-5px, -6px);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .nav-toggle {
        display: flex;
    }
    
    .nav-menu {
        position: fixed;
        left: -100%;
        top: 70px;
        flex-direction: column;
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        width: 100%;
        text-align: center;
        transition: 0.3s;
        box-shadow: 0 10px 27px rgba(0,0,0,0.05);
        padding: 20px 0;
        gap: 0;
    }
    
    .nav-menu.active {
        left: 0;
    }
    
    .nav-menu li {
        padding: 15px 0;
        width: 100%;
    }
    
    .nav-menu a {
        display: block;
        padding: 10px;
    }
    
    .user-info {
        position: fixed;
        top: 15px;
        right: 80px;
        flex-direction: row-reverse;
        font-size: 14px;
    }
    
    .user-info .user-avatar {
        width: 35px;
        height: 35px;
    }
    
    .user-info div {
        display: none;
    }
    
    .container {
        padding: 0 15px;
    }
    
    .nav-container {
        padding: 0 15px;
    }
}

/* Container */
.container {
    max-width: 1400px;
    margin: 30px auto;
    padding: 0 30px;
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
    margin-bottom: 30px;
}

/* Card Styles */
.card {
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
    transition: transform 0.3s, box-shadow 0.3s;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.card-title {
    font-size: 20px;
    font-weight: 600;
    color: #333;
}

.card-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.card-body {
    margin-top: 15px;
}

.stat-number {
    font-size: 36px;
    font-weight: bold;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.stat-label {
    color: #666;
    font-size: 14px;
    margin-top: 5px;
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border-radius: 10px;
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-block;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #f0f0f0;
    color: #333;
}

.btn-success {
    background: linear-gradient(135deg, #4caf50 0%, #45a049 100%);
    color: white;
}

.btn-danger {
    background: linear-gradient(135deg, #f44336 0%, #e53935 100%);
    color: white;
}

/* Form Styles */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: #333;
}

.form-control {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 14px;
    transition: all 0.3s;
}

.form-control:focus {
    border-color: #667eea;
    outline: none;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

textarea.form-control {
    resize: vertical;
    min-height: 120px;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.6);
    z-index: 2000;
    animation: fadeIn 0.3s;
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    border-radius: 20px;
    padding: 30px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideIn 0.3s;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
}

.modal-title {
    font-size: 24px;
    font-weight: 600;
}

.modal-close {
    font-size: 28px;
    cursor: pointer;
    color: #999;
    transition: color 0.3s;
}

.modal-close:hover {
    color: #333;
}

/* Table */
.table {
    width: 100%;
    border-collapse: collapse;
}

.table th {
    background: #f8f9fa;
    padding: 12px;
    text-align: left;
    font-weight: 600;
    border-bottom: 2px solid #e0e0e0;
}

.table td {
    padding: 12px;
    border-bottom: 1px solid #f0f0f0;
}

.table tr:hover {
    background: #f8f9fa;
}

/* Badge */
.badge {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.badge-success {
    background: #d4edda;
    color: #155724;
}

.badge-warning {
    background: #fff3cd;
    color: #856404;
}

.badge-danger {
    background: #f8d7da;
    color: #721c24;
}

.badge-info {
    background: #d1ecf1;
    color: #0c5460;
}

/* Progress Bar */
.progress {
    width: 100%;
    height: 8px;
    background: #f0f0f0;
    border-radius: 10px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    transition: width 0.3s;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideIn {
    from { transform: translateY(-30px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* Responsive */
@media (max-width: 768px) {
    .nav-container {
        flex-direction: column;
        gap: 15px;
    }
    
    .nav-menu {
        flex-direction: column;
        gap: 10px;
    }
    
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

/* Dark Mode Styles */
body.dark-mode {
    background: #1a1a1a;
    color: #e0e0e0;
}

body.dark-mode .navbar {
    background: linear-gradient(135deg, #4a5568 0%, #2d3748 100%);
}

body.dark-mode .card {
    background: #2d2d2d;
    border-color: #404040;
}

body.dark-mode .card-header {
    color: #e0e0e0;
}

body.dark-mode .form-group input,
body.dark-mode .form-group select,
body.dark-mode .form-group textarea {
    background: #2d2d2d;
    border-color: #404040;
    color: #e0e0e0;
}

body.dark-mode .form-group label {
    color: #b0b0b0;
}

body.dark-mode table {
    background: #2d2d2d;
}

body.dark-mode table thead {
    background: #1a1a1a;
}

body.dark-mode table tr:hover {
    background: #3a3a3a;
}

body.dark-mode .btn-secondary {
    background: #4a5568;
}

body.dark-mode .btn-secondary:hover {
    background: #5a6678;
}

body.dark-mode .progress {
    background: #3a3a3a;
}

body.dark-mode .alert {
    background: #3a3a3a;
    border-color: #4a4a4a;
    color: #e0e0e0;
}

body.dark-mode .badge {
    background: #4a5568;
}

/* Dark Mode Toggle */
.dark-mode-toggle-container {
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 1000;
}

.dark-mode-switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 34px;
}

.dark-mode-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.dark-mode-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.4s;
    border-radius: 34px;
}

.dark-mode-slider:before {
    position: absolute;
    content: "☀️";
    height: 26px;
    width: 26px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: 0.4s;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

input:checked + .dark-mode-slider {
    background-color: #667eea;
}

input:checked + .dark-mode-slider:before {
    transform: translateX(26px);
    content: "🌙";
}

/* Pagination Styles */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin: 30px 0;
    flex-wrap: wrap;
}

.pagination-numbers {
    display: flex;
    gap: 5px;
}

.pagination-btn,
.pagination-number {
    padding: 8px 16px;
    border: 2px solid #667eea;
    background: white;
    color: #667eea;
    text-decoration: none;
    border-radius: 5px;
    font-weight: 600;
    transition: all 0.3s;
    cursor: pointer;
    display: inline-block;
}

.pagination-btn:hover:not(.disabled),
.pagination-number:hover:not(.active) {
    background: #667eea;
    color: white;
    transform: translateY(-2px);
}

.pagination-number.active {
    background: #667eea;
    color: white;
    cursor: default;
}

.pagination-btn.disabled {
    opacity: 0.3;
    cursor: not-allowed;
    border-color: #ccc;
    color: #ccc;
}

.pagination-ellipsis {
    padding: 8px 12px;
    color: #999;
}

.pagination-info {
    text-align: center;
    color: #666;
    margin: 20px 0;
    font-size: 14px;
}

body.dark-mode .pagination-btn,
body.dark-mode .pagination-number {
    background: #2d2d2d;
    border-color: #667eea;
    color: #667eea;
}

body.dark-mode .pagination-btn:hover:not(.disabled),
body.dark-mode .pagination-number:hover:not(.active) {
    background: #667eea;
    color: white;
}

body.dark-mode .pagination-number.active {
    background: #667eea;
    color: white;
}

body.dark-mode .pagination-info {
    color: #b0b0b0;
}

/* Utility Classes */
.text-center { text-align: center; }
.text-right { text-align: right; }
.mt-10 { margin-top: 10px; }
.mt-20 { margin-top: 20px; }
.mt-30 { margin-top: 30px; }
.mb-10 { margin-bottom: 10px; }
.mb-20 { margin-bottom: 20px; }
.mb-30 { margin-bottom: 30px; }
.p-10 { padding: 10px; }
.p-20 { padding: 20px; }
.p-30 { padding: 30px; }
