:root {
    --primary-color: #1E3A8A;
    --accent-color: #34D399;
    --text-secondary-color: #D1D5DB;
    --sidebar-bg: #1A1A2E;
    --card-bg: #36395A;
    --text-color: #F8F8F8;
    --search-bg: #30304D;
}

.light-mode {
    --primary-color: #F0F4F8;
    --accent-color: #10B981;
    --text-secondary-color: #6B7280;
    --sidebar-bg: #FFFFFF;
    --card-bg: #E5E7EB;
    --text-color: #1A1A2E;
    --search-bg: #D1D5DB;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 0;
    background-color: var(--primary-color);
    color: var(--text-color);
    transition: background-color 0.3s, color 0.3s;
}

.app-container {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

.sidebar {
    width: 280px;
    background-color: var(--sidebar-bg);
    padding: 30px 20px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
}

.content {
    flex-grow: 1;
    padding: 30px 40px;
    background-color: var(--content-bg);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.logo-highlight {
  color: #34D399;
}

.logo {
    font-size: 1.8em;
    font-weight: 700;
    margin-bottom: 50px;
    color: var(--text-color);
    cursor:pointer;
    text-decoration: none;
}

a {
    text-decoration: none;
    color: var(--text-color)
}

.menu-title {
    font-size: 0.8em;
    color: var(--text-secondary-color);
    margin-top: 0;
    margin-bottom: 10px;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.main-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.nav-item {
    margin-bottom: 5px;
    cursor: pointer;
}

.nav-item a {
    display: block;
    padding: 10px 15px;
    color: var(--text-secondary-color);
    text-decoration: none;
    border-radius: 8px;
    transition: background-color 0.2s, color 0.2s;
    font-weight: 500;
}

.nav-item a i {
    margin-right: 10px;
}

.nav-item a:hover {
    background-color: rgba(52, 211, 153, 0.1);
    color: var(--text-color);
}

.nav-item.active a {
    background-color: var(--accent-color);
    color: var(--sidebar-bg);
    font-weight: 600;
}

.mode-toggle-container {
    margin-top: auto;
    display: flex;
    align-items: center;
    gap: 10px;
    padding-top: 20px;
    color: var(--text-secondary-color);
    font-size: 0.9em;
}

.switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 20px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--text-secondary-color);
    transition: .4s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    transition: .4s;
}

input:checked+.slider {
    background-color: var(--accent-color);
}

input:checked+.slider:before {
    transform: translateX(20px);
}

.slider.round {
    border-radius: 34px;
}

.slider.round:before {
    border-radius: 50%;
}

.top-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.back-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    font-size: 1.2em;
    color: var(--text-secondary-color);
    text-decoration: none;
    background-color: transparent;
    border-radius: 50%;
    transition: background-color 0.2s, color 0.2s;
}

.back-button:hover {
    background-color: var(--search-bg);
    color: var(--text-color);
}

.search-bar {
    background-color: var(--search-bg);
    border-radius: 8px;
    padding: 8px 15px;
    display: flex;
    align-items: center;
    max-width: 50%;
    flex-grow: 1;
}

.search-bar i {
    color: var(--text-secondary-color);
    margin-right: 10px;
}

.search-bar input {
    background: none;
    border: none;
    color: var(--text-color);
    outline: none;
    width: 100%;
    font-size: 1em;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 2px;
    color: var(--text-color);
    font-weight: 400;
    cursor: pointer;
    padding: 5px 10px;
    border-radius: 8px;
}

.user-profile span {
    font-size: 1.1em;
    font-weight: 400;
}

.user-profile img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-right: 5px;
}

.mobile-header, .mobile-nav {
    display: none;
}

.page-header {
    text-align: center;
    padding: 20px 40px;
}

.page-header h1 {
    margin: 0 0 10px 0;
    font-size: 2.5em;
}

.page-header p {
    color: var(--text-secondary-color);
    max-width: 600px;
    margin: 0 auto;
}

.page-content-wrapper {
    padding: 0 40px; 
}

.exercise-container {
    margin-bottom: 40px;
}

.exercise-container h2 {
    font-size: 1.8em;
    border-bottom: 2px solid var(--accent-color);
    padding-bottom: 10px;
    margin-bottom: 20px;
}

.question-card {
    background-color: var(--card-bg);
    padding: 25px 30px;
    border-radius: 12px;
}

.question-text {
    font-size: 1.25em;
    margin: 0 0 25px 0;
    font-weight: 500;
}

.options {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 25px;
}

.options label {
    display: flex;
    align-items: center;
    gap: 12px; 
    padding: 12px 15px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.options label:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

.options input[type="radio"],
.options input[type="checkbox"] {
    transform: scale(1.2);
    accent-color: var(--accent-color);
}

.options select {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--text-secondary-color);
    border-radius: 8px;
    font-size: 1em;
    cursor: pointer;
    background-color: var(--card-bg);
    color: var(--text-color);
}

.submit-btn {
    display: block;
    width: 100%;
    padding: 12px 20px;
    font-size: 1.1em;
    font-weight: bold;
    color: #fff;
    background-color: var(--accent-color);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.submit-btn:hover {
    filter: brightness(1.1);
}

.submit-btn:disabled {
    background-color: #5a6e8a;
    cursor: not-allowed;
    filter: none;
}

.feedback {
    margin-top: 15px;
    padding: 12px;
    border-radius: 6px;
    font-weight: bold;
    text-align: center;
    display: none;
}

.feedback.correct {
    display: block;
    background-color: #10B981;
    color: var(--correct-color);
}

.feedback.incorrect {
    display: block;
    background-color: #ef4444;
    color: var(--incorrect-color);
}

.attempts {
    margin-top: 10px;
    font-size: 0.9em;
    color: var(--text-secondary-color);
    text-align: right;
}

.correct-answer {
    margin-top: 15px;
    padding: 10px;
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-secondary-color);
    border-radius: 6px;
    font-style: italic;
}

.main-footer {
    margin-top: 20px;
    padding-top: 20px;
    text-align: right;
    color: var(--text-secondary-color);
    font-size: 0.9em;
    opacity: 0.6;
}


@media (max-width: 1024px) {
    .sidebar,
    .top-header {
        display: none;
    }

    .app-container {
        flex-direction: column;
    }

    .content {
        padding: 0;
    }

    .mobile-header {
        display: flex;
        justify-content: space-between; 
        align-items: center;
        background-color: var(--sidebar-bg);
        padding: 15px 20px;
        position: sticky;
        top: 0;
        z-index: 1000;
        width: 100%;
    }

    .mobile-header .logo-mobile {
        font-size: 1.4em;
        font-weight: 700;
        color: var(--text-color);
        position: absolute;
        left: 50%;
        transform: translateX(-50%);
    }

   .mobile-header .menu-icon {
        font-size: 1.5em;
        color: var(--text-secondary-color);
        cursor: pointer;
    }
    
    .mobile-header .header-icons {
      display: flex;
      gap: 15px; 
    }

    .mobile-header .profile-icon,
    .mobile-header .search-icon {
        font-size: 1.5em;
        color: var(--text-secondary-color);
        cursor: pointer;
    }

    #mobile-theme-toggle .fa-moon,
    #mobile-theme-toggle .fa-sun {
        font-size: 1.5em;
        color: var(--text-secondary-color);
        cursor: pointer;
    }

    .mobile-nav {
        display: none;
        position: absolute;
        top: 56px;
        left: 0;
        width: 100%;
        background-color: var(--sidebar-bg);
        padding: 20px;
        z-index: 999;
        transition: transform 0.3s ease-in-out;
        transform: translateY(-100%);
    }

    .mobile-nav ul {
        list-style: none;
        padding: 0;
        margin: 0;
    }

    .mobile-nav.show {
        display: block;
        transform: translateY(0);
    }

    .page-content-wrapper {
        padding: 20px; 
    }

    .page-header {
        padding: 0 0 20px 0; 
    }

    .page-header h1 {
        font-size: 2em;
    }

    .question-card {
        padding: 20px;
    }
    
    .main-footer {
        position: static;
        text-align: center;
        margin-top: 40px;
        padding-bottom: 20px;
        opacity: 1;
    }
}