/* ===================================================================
   Style.css (Reorganized & Enhanced Version)
   Author: Keshab Sarkar
   Project: Study With Keshab App
   =================================================================== */

/* --- 1. Settings, Fonts & Variables (সেটিংস, ফন্ট ও ভেরিয়েবল) --- */

@import url('https://fonts.googleapis.com/css2?family=Hind+Siliguri:wght@400;500;600;700&display=swap');

:root {
    /* Day Mode Colors */
    --bg-day: #f4f7f9;
    --card-bg-day: #ffffff;
    --text-color-day: #34495e;
    --heading-color-day: #2c3e50;
    --border-color-day: #e5eaee;
    --accent-color-day: #3498db;
    --accent-color-light-day: #eaf4fb;

    /* Dark Mode Colors */
    --bg-dark: #121212;
    --card-bg-dark: #1e1e1e;
    --text-color-dark: #e0e0e0;
    --heading-color-dark: #ffffff;
    --border-color-dark: #333;
    --accent-color-dark: #5dade2;
    /* ডার্ক মোডের জন্য হালকা নীল */
    --accent-color-light-dark: #2c3e50;
}

/* --- 2. Global & Body Styles (গ্লোবাল ও বডি স্টাইল) --- */

body {
    overflow-x: hidden;
    position: relative;
    max-width: 100%;
    overscroll-behavior-y: none;
    -webkit-tap-highlight-color: transparent;
    -webkit-user-select: none;
    user-select: none;
    touch-action: manipulation;

    font-family: 'Hind Siliguri', sans-serif;
    margin: 0;
    padding: 0;
    padding-bottom: 20px !important;
    background-color: #f8fafc !important;
    transition: background-color 0.4s, color 0.4s;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Allow text selection in inputs and search bar */
input,
textarea,
[contenteditable="true"] {
    -webkit-user-select: auto;
    user-select: auto;
}

/* Day & Dark Mode Theming */
body.day-mode {
    background-color: var(--bg-day);
    color: var(--text-color-day);
    --card-bg: var(--card-bg-day);
    --text-color: var(--text-color-day);
    --heading-color: var(--heading-color-day);
    --border-color: var(--border-color-day);
    --accent-color: var(--accent-color-day);
    --accent-color-light: var(--accent-color-light-day);
}

body.dark-mode {
    background-color: var(--bg-dark);
    color: var(--text-color-dark);
    --card-bg: var(--card-bg-dark);
    --text-color: var(--text-color-dark);
    --heading-color: var(--heading-color-dark);
    --border-color: var(--border-color-dark);
    --accent-color: var(--accent-color-dark);
    --accent-color-light: var(--accent-color-light-dark);
}

.homepage {
    max-width: 100%;
    margin: 0 auto;
}

main {
    max-width: 100% !important;
    width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
}

.card {
    max-width: 100% !important;
    width: 100% !important;
    margin: 0 0 25px 0 !important;
    box-sizing: border-box;
    background: rgba(255, 255, 255, 0.9) !important;
    backdrop-filter: blur(10px);
    border-radius: 0 !important;
    border: none !important;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05) !important;
    box-shadow: none !important;
    padding: 25px !important;
}

@media (max-width: 768px) {
    .card {
        padding: 20px !important;
        margin: 0 0 20px 0 !important;
    }
}

/* --- 3. Utility Components (ইউটিলিটি কম্পোনেন্ট) --- */

/* Preloader */
#preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-day);
    z-index: 1001;
    display: flex;
    justify-content: center;
    align-items: center;
}

body.dark-mode #preloader {
    background: var(--bg-dark);
}

.loader {
    border: 8px solid rgba(0, 0, 0, 0.1);
    border-top: 8px solid var(--accent-color);
    border-radius: 50%;
    width: 60px;
    height: 60px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Dark Mode Button */
.dark-mode-button {
    position: absolute;
    top: 20px;
    right: 0;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    font-size: 1.2rem;
    color: var(--text-color);
    transition: all 0.3s;
}

.dark-mode-button:hover {
    transform: scale(1.1) rotate(15deg);
    background-color: var(--accent-color-light);
}

/* Back to Top Button */
#back-to-top {
    display: none;
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: var(--accent-color);
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    text-decoration: none;
    text-align: center;
    line-height: 50px;
    font-size: 1.5rem;
    z-index: 1000;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    transition: background-color 0.3s, transform 0.3s;
}

#back-to-top:hover {
    transform: translateY(-3px);
}

/* --- 4. Header & Navigation (হেডার ও নেভিগেশন) --- */

.main-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 30px 0;
    position: relative;
    background: linear-gradient(135deg, var(--accent-color) 0%, #2980b9 100%);
    border-radius: 20px;
    margin-bottom: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.profile-pic {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    border: 5px solid white;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease;
}

.profile-pic:hover {
    transform: scale(1.05) rotate(5deg);
}

.header-text h1 {
    font-size: 2.5rem;
    margin: 15px 0 5px;
    color: white;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.header-text p {
    font-size: 1.1rem;
    margin: 0;
    color: rgba(255, 255, 255, 0.95);
}

.search-container {
    background: #fff;
    border-radius: 15px !important;
    padding: 5px 20px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.05);
    margin: 10px 15px 20px 15px !important;
    position: relative;
}

.search-container i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
}

#search-bar {
    width: 100%;
    padding: 12px 12px 12px 45px !important;
    font-size: 1rem;
    border: none !important;
    border-radius: 8px;
    background: transparent !important;
    color: var(--text-color);
    transition: all 0.3s;
}

#search-bar:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px var(--accent-color-light);
}

body.dark-mode #search-bar:focus {
    box-shadow: 0 0 0 3px rgba(93, 173, 226, 0.3);
}

.nav-grid {
    display: grid !important;
    grid-template-columns: repeat(8, 1fr) !important;
    gap: 8px !important;
    padding: 10px !important;
    margin: 0 !important;
}

.nav-button {
    color: white;
    text-decoration: none !important;
    padding: 12px 5px !important;
    border-radius: 12px !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease !important;
    border: none !important;
    font-size: 1rem;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
    position: relative;
    overflow: hidden;
}

.nav-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.2);
    transition: left 0.5s ease;
}

.nav-button:hover::before {
    left: 100%;
}

.nav-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.15) !important;
}

.nav-button:active {
    transform: scale(0.92) !important;
}

.nav-button i {
    font-size: 1.2rem !important;
    margin-bottom: 5px !important;
}

.nav-button span {
    font-weight: 700 !important;
    font-size: 1.1rem !important;
    letter-spacing: 0;
}

/* Navigation Button Colors */
.nav-button.color-home {
    background: linear-gradient(135deg, #ff7e5f, #feb47b);
}

.nav-button.color-dashboard {
    background: linear-gradient(45deg, #4e54c8, #8f94fb);
}

.nav-button.color-notes {
    background: linear-gradient(45deg, #16a085, #1abc9c);
}

.nav-button.color-quiz {
    background: linear-gradient(45deg, #d35400, #e67e22);
}

.nav-button.color-formulas {
    background: linear-gradient(45deg, #f39c12, #f1c40f);
}

.nav-button.color-result {
    background: linear-gradient(45deg, #6a11cb, #9b59b6);
}

.nav-button.color-leaderboard {
    background: linear-gradient(45deg, #8e44ad, #9b59b6);
}

/* === CBT Nav Button Style === */
.nav-button.color-cbt {
    background-color: #00796b;
    /* একটি প্রফেশনাল ডার্ক টিল (Teal) রঙ */
    color: #ffffff;
    /* সাদা টেক্সট এবং আইকন */
}

/* Hover effect for the CBT button */
.nav-button.color-cbt:hover {
    background-color: #00897b;
    /* হোভারের জন্য একটু হালকা শেড */
}

/* --- 5. Main Content & Cards (মূল কন্টেন্ট ও কার্ড) --- */

main {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.card {
    background: var(--card-bg);
    padding: 30px;
    border-radius: 20px;
    border: 1px solid var(--border-color);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.12);
}

/* Dashboard card কে hover effect থেকে বাদ দেওয়া */
#dashboard {
    transform: none !important;
}

#dashboard:hover {
    transform: none !important;
}

.card h2 {
    font-size: 1.8rem;
    color: var(--heading-color);
    margin-top: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.icon-title {
    color: var(--accent-color);
}

.card p {
    margin: 10px 0 20px;
    line-height: 1.6;
}

.link-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.link-container a {
    background: var(--accent-color);
    color: white;
    text-decoration: none;
    padding: 10px 18px;
    border-radius: 25px;
    font-weight: 500;
    transition: background-color 0.2s, transform 0.2s;
}

.link-container a:hover {
    background: #2980b9;
    transform: translateY(-2px);
}

/* =======================================================
   স্টাইল করা লিস্টের জন্য বিশেষ ডিজাইন (অপশন ২)
   ======================================================= */
.link-container.styled-list {
    flex-direction: column;
    /* লিঙ্কগুলো একটির নিচে আরেকটি আসবে */
    gap: 12px;
}

.link-container.styled-list a {
    background: #f8fafc !important;
    color: #334155 !important;
    border: 1px solid #f1f5f9 !important;
    border-radius: 15px !important;
    padding: 15px 20px !important;
    margin-bottom: 10px !important;
    font-weight: 500 !important;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.link-container.styled-list a::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 4px;
    background: var(--accent-color);
    transform: scaleY(0);
    transition: transform 0.3s ease;
}

.link-container.styled-list a:hover::before {
    transform: scaleY(1);
}

.link-container.styled-list a:hover {
    background: #ffffff !important;
    border-color: #6366f1 !important;
    color: #6366f1 !important;
    padding-left: 25px !important;
    box-shadow: 0 5px 20px rgba(99, 102, 241, 0.2);
}

.link-container.styled-list a i.fa-fw {
    color: var(--accent-color);
    /* আইকনের রঙ হবে থিমের অ্যাকসেন্ট কালার */
    margin-right: 15px;
    /* আইকন এবং লেখার মধ্যে ফাঁকা জায়গা */
    width: 20px;
    font-size: 1.1em;
}

/* --- 6. Page-Specific Sections (পেজ-ভিত্তিক সেকশন) --- */

/* User Profile */
#user-profile-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    color: white;
    border: none !important;
    padding: 20px !important;
}

#user-profile-card .profile-header {
    display: flex;
    align-items: center;
    gap: 15px;
    justify-content: flex-start;
}

.profile-pic-large {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid white;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    flex-shrink: 0;
}

.profile-info {
    flex: 1;
    text-align: left;
    overflow: hidden;
}

#user-profile-card h2 {
    margin: 0;
    font-size: 1.1rem;
    color: white;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#user-profile-card p {
    margin: 5px 0 0;
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.85rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Dashboard */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.dashboard-item {
    text-align: center;
    padding: 1rem;
    background-color: var(--card-bg-day);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 250px;
}

.dashboard-chart-container {
    position: relative;
    height: 200px;
    width: 100%;
}

body.dark-mode .dashboard-item {
    background-color: #2c2c2c;
}

.dashboard-item h3 {
    margin-top: 0;
    margin-bottom: 0.8rem;
    font-size: 1.1rem;
    color: var(--heading-color);
}

.progress-bar-container {
    width: 100%;
    background-color: #e0e0e0;
    border-radius: 30px;
    margin: 0.8rem 0;
    overflow: hidden;
    height: 18px;
}

body.dark-mode .progress-bar-container {
    background-color: #444;
}

.progress-bar {
    height: 18px;
    width: 0%;
    background-color: #27ae60;
    border-radius: 30px;
    transition: width 1s ease-in-out;
}

#chapter-progress-text {
    font-weight: 600;
    color: var(--text-color);
    font-size: 0.95rem;
    margin: 0.5rem 0 0 0;
}

.challenge-box {
    background-color: #fff;
    border: 2px dashed var(--accent-color);
    padding: 0.8rem;
    border-radius: 8px;
    margin-top: 0.8rem;
}

.challenge-box p {
    margin: 0;
    font-size: 0.95rem;
}

body.dark-mode .challenge-box {
    background-color: #333;
}

.achievements-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-top: 0.8rem;
}

.achievement-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 70px;
    text-align: center;
    opacity: 0.4;
    filter: grayscale(100%);
    transition: all 0.4s;
}

.achievement-badge.unlocked {
    opacity: 1;
    filter: grayscale(0%);
    transform: scale(1.1);
}

.achievement-badge i {
    font-size: 2rem;
    color: #f1c40f;
}

.achievement-badge span {
    font-size: 0.75rem;
    font-weight: 600;
    margin-top: 5px;
}

/* Leaderboard Table */
.leaderboard-container {
    margin-top: 1.5rem;
    overflow-x: auto;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    background: var(--card-bg);
}

th,
td {
    padding: 15px 18px;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

thead {
    background: linear-gradient(135deg, var(--accent-color), #2980b9);
    color: white;
}

thead th {
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.9rem;
    letter-spacing: 0.5px;
}

tbody tr {
    transition: background-color 0.2s ease;
}

tbody tr:hover {
    background-color: var(--accent-color-light);
}

body.dark-mode thead {
    background: linear-gradient(135deg, #5dade2, #3498db);
}

body.dark-mode tbody tr:hover {
    background-color: rgba(93, 173, 226, 0.1);
}

td i.fa-trophy,
td i.fa-medal {
    margin-right: 8px;
    font-size: 1.2em;
}

.toggle-details-btn {
    background: none;
    border: none;
    color: var(--accent-color);
    cursor: pointer;
    font-size: 1.2rem;
    padding: 5px;
    transition: transform 0.3s ease;
}

.details-row {
    display: none;
}

.details-content {
    background-color: var(--accent-color-light);
    padding: 15px;
    border-left: 4px solid var(--accent-color);
}

body.dark-mode .details-content {
    background-color: #2c2c2c;
}

.details-content ul {
    list-style-type: none;
    padding-left: 0;
    margin: 0;
}

.details-content li {
    margin-bottom: 8px;
    font-size: 0.9em;
}

.details-content li:last-child {
    margin-bottom: 0;
}

.details-content li .label {
    font-weight: bold;
    color: var(--heading-color);
}

body.dark-mode .details-content li .label {
    color: #bbb;
}

/* Result Section (আমার রেজাল্ট) */
#result-card-container {
    margin-top: 20px;
}

.result-card {
    border-width: 2px;
    border-style: solid;
    border-color: transparent;
    /* Initially transparent, will be colored by rank class */
    border-radius: 15px;
    padding: 25px;
    background-color: var(--card-bg);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.07);
    text-align: center;
    max-width: 500px;
    margin: auto;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.result-card:hover {
    transform: translateY(-5px);
}

.result-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 15px;
}

.result-profile-pic {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 3px solid var(--accent-color);
    margin-bottom: 10px;
    object-fit: cover;
}

.result-user-name {
    font-size: 1.5em;
    font-weight: bold;
    color: var(--heading-color);
}

.rank-badge-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-top: 10px;
}

.badge-item {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85em;
    font-weight: 600;
}

.badge-item.topper {
    background-color: #ffd700;
    color: #333;
}

.badge-item.accuracy {
    background-color: #2ecc71;
    color: white;
}

/* === নতুন কোড এখানে যোগ করা হয়েছে === */
.badge-item.top-three {
    background-color: #c0c0c0;
    color: #333;
}

/* Silver */
.badge-item.top-ten {
    background-color: #cd7f32;
    color: white;
}

/* Bronze */
.badge-item.rising-star {
    background-color: #5dade2;
    color: white;
}

/* Light Blue */
.badge-item.high-accuracy {
    background-color: #1abc9c;
    color: white;
}

/* Teal */
.badge-item.completionist {
    background-color: #8e44ad;
    color: white;
}

/* Purple */
/* === নতুন কোড শেষ === */

.motivational-quote {
    font-style: italic;
    color: var(--text-color);
    opacity: 0.9;
    margin-top: 15px;
    margin-bottom: 20px;
    padding: 12px;
    background-color: var(--accent-color-light);
    border-left: 4px solid var(--accent-color);
    border-radius: 4px;
    text-align: left;
}

.result-stats-grid {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    align-items: center;
    gap: 20px;
    margin-bottom: 25px;
}

.chart-container {
    position: relative;
    max-width: 150px;
    height: 150px;
    margin: auto;
}

.result-details {
    display: flex;
    flex-direction: column;
    gap: 15px;
    text-align: left;
}

.result-item h4 {
    margin: 0;
    font-size: 1em;
    color: var(--text-color);
    opacity: 0.7;
    font-weight: normal;
}

.result-item p {
    margin: 5px 0 0;
    font-size: 1.8em;
    font-weight: bold;
    color: var(--accent-color);
}

.performance-comparison {
    font-size: 0.95em;
    font-weight: 500;
    margin-top: -10px;
    margin-bottom: 20px;
}

.result-share {
    margin-top: 20px;
    border-top: 1px solid var(--border-color);
    padding-top: 20px;
}

.result-share p {
    margin-bottom: 15px;
    font-weight: bold;
}

.share-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.share-btn {
    padding: 10px 20px;
    border-radius: 25px;
    color: #fff !important;
    text-decoration: none;
    font-weight: bold;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: opacity 0.3s ease;
}

.share-btn:hover {
    opacity: 0.85;
}

.share-btn.whatsapp {
    background-color: #25D366;
}

.share-btn.facebook {
    background-color: #1877F2;
}

#download-result-btn {
    background-color: #16a085;
    color: white;
    padding: 12px 25px;
    border-radius: 8px;
    font-weight: bold;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 15px;
    border: none;
    cursor: pointer;
    transition: background-color 0.3s;
}

#download-result-btn:hover {
    background-color: #117a65;
}

#download-result-btn:disabled {
    background-color: #95a5a6;
    cursor: not-allowed;
}

body.dark-mode #download-result-btn {
    background-color: #1abc9c;
}

body.dark-mode #download-result-btn:hover {
    background-color: #16a085;
}

/* Dynamic Border & Shadow Colors for Result Card */
.result-card.rank-gold {
    border-color: #ffd700;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
}

.result-card.rank-silver {
    border-color: #c0c0c0;
    box-shadow: 0 0 20px rgba(192, 192, 192, 0.5);
}

.result-card.rank-bronze {
    border-color: #cd7f32;
    box-shadow: 0 0 20px rgba(205, 127, 50, 0.5);
}

/* "No Result" Message Styles */
#no-result-message {
    text-align: center;
    padding: 40px 20px;
    background: linear-gradient(135deg, var(--accent-color-light), rgba(52, 152, 219, 0.1));
    border-radius: 15px;
    border: 2px dashed var(--accent-color);
}

#no-result-message p {
    font-size: 1.1rem;
    margin-bottom: 20px;
    color: var(--text-color);
}

#no-result-message .button-primary {
    background: linear-gradient(135deg, var(--accent-color), #2980b9);
    color: white;
    padding: 12px 30px;
    text-decoration: none;
    border-radius: 25px;
    font-weight: bold;
    display: inline-block;
    margin-top: 10px;
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.3);
    transition: all 0.3s ease;
}

#no-result-message .button-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(52, 152, 219, 0.4);
}

body.dark-mode #no-result-message {
    background: linear-gradient(135deg, rgba(93, 173, 226, 0.1), rgba(52, 152, 219, 0.05));
}

/* --- 7. Modals (মোডাল) --- */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    /* সেমি-ট্রান্সপারেন্ট ব্যাকগ্রাউন্ড */
    z-index: 1001;
    display: flex;
    /* এটি display: none থেকে পরিবর্তন করা হয়েছে ট্রানজিশনের জন্য */
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(4px);
    opacity: 0;
    /* ডিফল্টভাবে স্বচ্ছ থাকবে */
    visibility: hidden;
    /* ডিফল্টভাবে লুকানো থাকবে */
    transition: opacity 0.3s ease, visibility 0.3s ease;
    /* সুন্দর ফেড-ইন ইফেক্ট */
}

.modal-overlay.active {
    opacity: 1;
    /* .active ক্লাস যোগ হলে দৃশ্যমান হবে */
    visibility: visible;
}

.modal-content {
    /* ===== 👇 মূল সমাধান এখানে 👇 ===== */
    background-color: var(--card-bg);
    /* থিম অনুযায়ী সঠিক ব্যাকগ্রাউন্ড কালার ব্যবহার করা হয়েছে */
    color: var(--text-color);
    /* থিম অনুযায়ী টেক্সট কালার */

    padding: 25px 30px;
    border-radius: 15px;
    width: 90%;
    max-width: 650px;
    position: relative;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    text-align: left;

    /* সুন্দর স্কেল-আপ অ্যানিমেশন */
    transform: scale(0.9);
    transition: transform 0.3s ease;

    /* লম্বা কনটেন্টের জন্য স্ক্রল যুক্ত করা হয়েছে */
    max-height: 85vh;
    overflow-y: auto;
}

.modal-overlay.active .modal-content {
    transform: scale(1);
    /* .active ক্লাস যোগ হলে মোডালটি বড় হয়ে আসবে */
}

.modal-content h2 {
    color: var(--heading-color);
    /* থিমের হেডিং কালার ব্যবহার */
    margin-top: 0;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--border-color);
    /* থিমের বর্ডার কালার ব্যবহার */
    text-align: center;
}

.modal-content ul {
    list-style-type: none;
    padding-left: 0;
}

.modal-content li {
    padding: 12px 0;
    font-size: 1.1rem;
    border-bottom: 1px solid var(--border-color);
}

.modal-content li:last-child {
    border-bottom: none;
}

.modal-content strong {
    color: var(--heading-color);
    /* গুরুত্বপূর্ণ টেক্সটের জন্য */
}

.modal-close-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    background: transparent;
    border: none;
    font-size: 2rem;
    color: var(--text-color);
    opacity: 0.7;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    transition: color 0.2s, transform 0.2s, opacity 0.2s;
}

.modal-close-btn:hover {
    color: var(--accent-color);
    opacity: 1;
    transform: rotate(90deg);
}

/* --- 8. Footer (ফুটার) --- */

footer {
    text-align: center;
    padding: 30px 0;
    margin-top: 30px;
    border-top: 1px solid var(--border-color);
}

.social-links a {
    margin: 0 10px;
    color: var(--text-color);
    font-size: 1.2rem;
    transition: color 0.3s, transform 0.3s;
    display: inline-block;
}

.social-links a:hover {
    color: var(--accent-color);
    transform: translateY(-3px);
}

/* --- 9. Responsive Design (রেসপন্সিভ ডিজাইন) --- */

@media (max-width: 768px) {
    body {
        padding: 0;
        padding-bottom: 20px !important;
    }

    main {
        width: 100%;
        padding: 0 !important;
        margin: 0 !important;
    }

    .nav-grid {
        grid-template-columns: repeat(8, 1fr) !important;
        gap: 8px !important;
        padding: 10px !important;
    }

    .nav-button {
        padding: 10px 3px !important;
        border-radius: 10px !important;
    }

    .nav-button i {
        font-size: 1rem !important;
    }

    .nav-button span {
        font-size: 0.95rem !important;
    }

    .main-header {
        padding: 15px;
        border-radius: 0 0 20px 20px;
    }

    #user-profile-card .profile-header {
        flex-direction: column;
        text-align: center;
    }

    .quick-stats-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
    }
}

@media (max-width: 400px) {
    .nav-grid {
        grid-template-columns: repeat(8, 1fr) !important;
        gap: 6px !important;
    }
    .nav-button span {
        font-size: 0.85rem !important;
    }
}

@media (max-width: 480px) {
    body {
        padding: 15px;
    }

    .header-text h1 {
        font-size: 2rem;
    }

    .nav-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .card {
        padding: 20px;
    }

    .dark-mode-button {
        top: 10px;
        right: 10px;
    }

    .result-stats-grid {
        grid-template-columns: 1fr;
        /* ছোট স্ক্রিনে একটার নিচে আরেকটা */
    }

    .result-details {
        text-align: center;
    }

    .motivational-quote {
        text-align: center;
    }

}

/* =================================
   Custom Button Color for PDF Note
   ================================= */

/* পিডিএফ নোট বাটনের ডিফল্ট স্টাইল */
.nav-button.color-pdf {
    background: linear-gradient(135deg, #e53935, #c62828);
    /* সুন্দর লাল গ্র্যাডিয়েন্ট */
    color: #ffffff;
    /* সাদা টেক্সট */
    transition: all 0.3s ease-in-out;
    /* হোভারের জন্য মসৃণ অ্যানিমেশন */
}

/* মাউস হোভার করলে বাটনের স্টাইল */
.nav-button.color-pdf:hover {
    background: linear-gradient(135deg, #c62828, #b71c1c);
    /* গাঢ় লাল গ্র্যাডিয়েন্ট */
    transform: translateY(-4px);
    /* বাটনটি সামান্য উপরে উঠবে */
    box-shadow: 0 6px 12px rgba(229, 57, 53, 0.4);
    /* একটি সুন্দর লালচে শ্যাডো */
}


/* কুইজ সেট section এর জন্য বিশেষ স্টাইল */
.card.disabled-section {
    position: relative;
    overflow: hidden;
}

.card.disabled-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: repeating-linear-gradient(45deg,
            transparent,
            transparent 10px,
            rgba(52, 152, 219, 0.03) 10px,
            rgba(52, 152, 219, 0.03) 20px);
    pointer-events: none;
}


/* === Enhanced Dashboard Features === */

/* Quick Stats Cards */
.quick-stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin: 1.5rem 0;
}

.stat-card {
    background: #ffffff !important;
    border-radius: 20px !important;
    padding: 20px !important;
    border: 1px solid #eef2f6 !important;
    text-align: center;
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.1) !important;
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-card .stat-number {
    font-size: 1.8rem !important;
    font-weight: 700 !important;
    color: #4f46e5 !important;
    margin: 0.5rem 0;
}

.stat-card .stat-label {
    color: #64748b !important;
    font-size: 0.9rem !important;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Study Streak */
.streak-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, #f39c12, #e67e22);
    border-radius: 12px;
    color: white;
    margin: 1rem 0;
}

.streak-icon {
    font-size: 3rem;
}

.streak-info h3 {
    margin: 0;
    font-size: 2rem;
}

.streak-info p {
    margin: 0.3rem 0 0 0;
    opacity: 0.9;
}

/* Weekly Activity Chart */
.weekly-chart {
    display: flex;
    justify-content: space-around;
    align-items: flex-end;
    height: 150px;
    gap: 0.5rem;
    margin: 1rem 0;
    padding: 1rem;
    background: var(--accent-color-light);
    border-radius: 12px;
}

.day-bar {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.bar {
    width: 100%;
    background: var(--accent-color);
    border-radius: 8px 8px 0 0;
    transition: all 0.3s ease;
    min-height: 20px;
}

.bar:hover {
    background: #2980b9;
    transform: scaleY(1.1);
}

.day-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-color);
}

/* Recent Activity */
.recent-activity-list {
    list-style: none;
    padding: 0;
    margin: 1rem 0;
}

.activity-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 0.8rem;
    transition: all 0.3s ease;
}

.activity-item:hover {
    background: var(--accent-color-light);
    transform: translateX(5px);
}

.activity-icon {
    width: 40px;
    height: 40px;
    background: var(--accent-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.activity-details h4 {
    margin: 0;
    font-size: 1rem;
    color: var(--heading-color);
}

.activity-details p {
    margin: 0.3rem 0 0 0;
    font-size: 0.85rem;
    color: var(--text-color);
    opacity: 0.7;
}

/* Study Time Tracker */
.time-tracker {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem;
    background: linear-gradient(135deg, #16a085, #1abc9c);
    border-radius: 12px;
    color: white;
    margin: 1rem 0;
}

.time-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.time-icon {
    font-size: 2.5rem;
}

.time-details h3 {
    margin: 0;
    font-size: 1.8rem;
}

.time-details p {
    margin: 0.3rem 0 0 0;
    opacity: 0.9;
}

/* Rank Badge */
.rank-badge-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, #8e44ad, #9b59b6);
    border-radius: 12px;
    color: white;
    margin: 1rem 0;
}

.rank-icon {
    font-size: 3rem;
}

.rank-info h3 {
    margin: 0;
    font-size: 2rem;
}

.rank-info p {
    margin: 0.3rem 0 0 0;
    opacity: 0.9;
}

/* Motivational Quote */
.motivational-quote-box {
    padding: 1.5rem;
    background: linear-gradient(135deg, rgba(52, 152, 219, 0.1), rgba(41, 128, 185, 0.05));
    border-left: 4px solid var(--accent-color);
    border-radius: 8px;
    margin: 1rem 0;
    font-style: italic;
}

.motivational-quote-box p {
    margin: 0;
    font-size: 1.1rem;
    color: var(--text-color);
    line-height: 1.6;
}

.motivational-quote-box .quote-author {
    margin-top: 0.8rem;
    text-align: right;
    font-size: 0.9rem;
    opacity: 0.7;
    font-style: normal;
}

/* Target Progress */
.target-progress-container {
    padding: 1.5rem;
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    margin: 1rem 0;
}

.target-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.target-header h4 {
    margin: 0;
    color: var(--heading-color);
}

.target-percentage {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--accent-color);
}

.target-bar {
    width: 100%;
    height: 25px;
    background: var(--border-color);
    border-radius: 20px;
    overflow: hidden;
    position: relative;
}

.target-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-color), #2980b9);
    border-radius: 20px;
    transition: width 1s ease;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 10px;
    color: white;
    font-size: 0.85rem;
    font-weight: bold;
}

body.dark-mode .target-bar {
    background: #333;
}

/* PDF Grid Premium Style */
.pdf-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 15px;
}

.pdf-card {
    background: #fff !important;
    border-radius: 18px !important;
    padding: 15px !important;
    border: 1px solid #f1f5f9 !important;
    transition: all 0.3s ease;
    cursor: pointer;
}

.pdf-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.15);
    border-color: #6366f1 !important;
}