:root {
    --primary-color: #2c3e50;
    --secondary-color: #3498db;
    --accent-color: #1abc9c;
    --success-color: #27ae60;
    --warning-color: #f39c12;
    --danger-color: #e74c3c;
    --light-bg: #ecf0f1;
    --dark-text: #2c3e50;
    --light-text: #7f8c8d;
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--light-bg);
    color: var(--dark-text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.bg-primary-custom {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
}

.navbar-brand {
    font-weight: 600;
    font-size: 1.4rem;
}

.main-content {
    flex: 1;
    padding: 20px 0;
}

.card {
    border: none;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.card-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    border-radius: 15px 15px 0 0 !important;
    padding: 15px 20px;
}

.btn-primary-custom {
    background: linear-gradient(135deg, var(--secondary-color) 0%, var(--accent-color) 100%);
    border: none;
    padding: 12px 30px;
    border-radius: 25px;
    font-weight: 600;
    color: white;
    transition: all 0.3s ease;
}

.btn-primary-custom:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 20px rgba(52, 152, 219, 0.4);
    color: white;
}

.btn-success-custom {
    background: linear-gradient(135deg, var(--success-color) 0%, var(--accent-color) 100%);
    border: none;
    padding: 12px 30px;
    border-radius: 25px;
    font-weight: 600;
    color: white;
}

.btn-danger-custom {
    background: linear-gradient(135deg, var(--danger-color) 0%, var(--warning-color) 100%);
    border: none;
    padding: 12px 30px;
    border-radius: 25px;
    font-weight: 600;
    color: white;
}

.stat-card {
    background: white;
    border-radius: 15px;
    padding: 25px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.stat-card .icon {
    font-size: 2.5rem;
    margin-bottom: 15px;
}

.stat-card .icon.primary { color: var(--secondary-color); }
.stat-card .icon.success { color: var(--success-color); }
.stat-card .icon.warning { color: var(--warning-color); }
.stat-card .icon.danger { color: var(--danger-color); }

.stat-card h3 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 5px;
}

.stat-card p {
    color: var(--light-text);
    margin: 0;
}

.exercise-area {
    background: white;
    border-radius: 20px;
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

.exercise-display {
    font-size: 4rem;
    font-weight: 700;
    color: var(--primary-color);
    text-align: center;
    letter-spacing: 5px;
}

.focus-indicator {
    position: absolute;
    font-size: 3rem;
    color: var(--secondary-color);
    animation: pulse 0.5s ease;
}

@keyframes pulse {
    0% { transform: scale(0.5); opacity: 0; }
    50% { transform: scale(1.2); opacity: 1; }
    100% { transform: scale(1); opacity: 1; }
}

.control-panel {
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.control-panel label {
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 8px;
}

.form-control, .form-select {
    border-radius: 10px;
    border: 2px solid #e0e0e0;
    padding: 12px 15px;
    transition: border-color 0.3s ease;
}

.form-control:focus, .form-select:focus {
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.answer-input {
    font-size: 1.5rem;
    text-align: center;
    letter-spacing: 3px;
    text-transform: uppercase;
}

.timer-display {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--primary-color);
}

.level-badge {
    display: inline-block;
    background: linear-gradient(135deg, var(--secondary-color) 0%, var(--accent-color) 100%);
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
    font-weight: 600;
}

.progress-custom {
    height: 25px;
    border-radius: 15px;
    background: #e0e0e0;
}

.progress-custom .progress-bar {
    background: linear-gradient(135deg, var(--success-color) 0%, var(--accent-color) 100%);
    border-radius: 15px;
}

.hero-section {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    padding: 100px 0;
    text-align: center;
}

.hero-section h1 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 20px;
}

.hero-section p {
    font-size: 1.3rem;
    opacity: 0.9;
}

.auth-container {
    max-width: 450px;
    margin: 50px auto;
}

.auth-card {
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

.auth-card h2 {
    text-align: center;
    color: var(--primary-color);
    margin-bottom: 30px;
    font-weight: 700;
}

.auth-card .form-group {
    margin-bottom: 20px;
}

.footer {
    background: white;
    border-top: 1px solid #e0e0e0;
}

.dropdown-menu {
    border: none;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
}

.dropdown-item {
    padding: 10px 20px;
    transition: background-color 0.3s ease;
}

.dropdown-item:hover {
    background: linear-gradient(135deg, var(--secondary-color) 0%, var(--accent-color) 100%);
    color: white;
}

.random-position {
    position: absolute;
}

.correct-feedback {
    animation: correctPulse 0.5s ease;
}

.wrong-feedback {
    animation: wrongPulse 0.5s ease;
}

@keyframes correctPulse {
    0%, 100% { background-color: white; }
    50% { background-color: rgba(39, 174, 96, 0.2); }
}

@keyframes wrongPulse {
    0%, 100% { background-color: white; }
    50% { background-color: rgba(231, 76, 60, 0.2); }
}

.exercise-menu-card {
    cursor: pointer;
    transition: all 0.3s ease;
}

.exercise-menu-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2);
}

.exercise-menu-card .icon-wrapper {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-size: 2rem;
    color: white;
}

.icon-wrapper.eye { background: linear-gradient(135deg, #3498db, #2980b9); }
.icon-wrapper.brain { background: linear-gradient(135deg, #9b59b6, #8e44ad); }
.icon-wrapper.muscle { background: linear-gradient(135deg, #e74c3c, #c0392b); }
.icon-wrapper.book { background: linear-gradient(135deg, #1abc9c, #16a085); }

@media (max-width: 768px) {
    .hero-section h1 { font-size: 2rem; }
    .hero-section p { font-size: 1rem; }
    .exercise-display { font-size: 2.5rem; }
    .stat-card h3 { font-size: 1.5rem; }
    .navbar-brand { font-size: 1.2rem; }
}

@media (max-width: 576px) {
    .auth-container { margin: 20px; }
    .auth-card { padding: 25px; }
    .control-panel { padding: 15px; }
}

.sidebar-wrapper {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 260px;
    background: linear-gradient(180deg, var(--primary-color) 0%, #1a252f 100%);
    color: white;
    position: fixed;
    height: 100vh;
    left: 0;
    top: 0;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-brand {
    color: white;
    text-decoration: none;
    font-size: 1.4rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-brand i {
    font-size: 1.8rem;
    color: var(--accent-color);
}

.sidebar-menu {
    flex: 1;
    padding: 20px 0;
    overflow-y: auto;
}

.sidebar-item {
    display: flex;
    align-items: center;
    padding: 14px 20px;
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    transition: all 0.3s ease;
    border-left: 4px solid transparent;
    gap: 12px;
}

.sidebar-item:hover {
    background: rgba(255,255,255,0.1);
    color: white;
    border-left-color: var(--accent-color);
}

.sidebar-item.active {
    background: rgba(255,255,255,0.15);
    color: white;
    border-left-color: var(--accent-color);
}

.sidebar-item i {
    width: 24px;
    text-align: center;
    font-size: 1.1rem;
}

.sidebar-footer {
    padding: 15px 0;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.main-wrapper {
    flex: 1;
    margin-left: 260px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.top-navbar {
    background: white;
    padding: 15px 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 100;
}

.sidebar-toggle {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--primary-color);
    cursor: pointer;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-name {
    font-weight: 600;
    color: var(--primary-color);
}

.main-content-area {
    flex: 1;
    padding: 25px;
    background: var(--light-bg);
}

.category-card {
    background: white;
    border-radius: 20px;
    padding: 30px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 3px solid transparent;
    height: 100%;
}

.category-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.15);
}

.category-card.active {
    border-color: var(--accent-color);
}

.category-card .category-icon {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-size: 2.5rem;
    color: white;
}

.category-card h5 {
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--primary-color);
}

.category-card p {
    color: var(--light-text);
    font-size: 0.9rem;
    margin: 0;
}

.exercise-card {
    background: white;
    border-radius: 15px;
    padding: 25px;
    text-align: center;
    transition: all 0.3s ease;
    height: 100%;
}

.exercise-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.12);
}

.exercise-card .exercise-icon {
    width: 70px;
    height: 70px;
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 15px;
    font-size: 1.8rem;
    color: white;
}

.exercise-card h6 {
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--primary-color);
}

.exercise-card p {
    color: var(--light-text);
    font-size: 0.85rem;
    margin-bottom: 15px;
}

.exercise-card .btn {
    border-radius: 20px;
    padding: 8px 25px;
    font-size: 0.85rem;
}

.page-title {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 5px;
}

.page-subtitle {
    color: var(--light-text);
    margin-bottom: 25px;
}

@media (max-width: 991px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    .main-wrapper {
        margin-left: 0;
    }
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    cursor: pointer;
}

@media (max-width: 991px) {
    .sidebar-overlay.show {
        display: block;
    }
    .top-navbar {
        padding: 10px 15px;
    }
    .main-content-area {
        padding: 15px;
    }
    .page-title {
        font-size: 1.4rem;
    }
    .stat-card {
        margin-bottom: 12px;
    }
}

@media (max-width: 576px) {
    .main-content-area {
        padding: 10px;
    }
    .page-title {
        font-size: 1.2rem;
    }
    .top-navbar .user-name {
        display: none;
    }
}
