/* File: public_html/css/portal_styles.css (Modified - Mobile Navbar Fixes) */
/* --- START: CSS STYLES --- */
:root {
    /* --- Theme Variables (Simplified to Light Theme Only as per request) --- */
    --bg-light-start: #f8f9fa; --bg-light-end: #e9ecef; --text-color-light: #343a40;
    --navbar-bg-light: rgba(255, 255, 255, 0.95); --card-bg-light: rgba(255, 255, 255, 0.95); /* Slightly more opaque */
    --card-border-light: #dee2e6; --border-color-light: #ced4da; --link-color-light: #495057;
    --link-hover-light: #2a9d8f; --brand-color-light: #2a9d8f; --brand-secondary-light: #e77f1b;
    --primary-btn-bg-light: #2a9d8f; --primary-btn-text-light: #ffffff; --success-btn-bg-light: #26a89a;
    --success-btn-text-light: #ffffff; --test-item-hover-bg-light: rgba(42, 157, 143, 0.1);
    --test-item-active-bg-light: var(--brand-color-light); --test-item-active-text-light: #ffffff;
    --heading-color-light: #212529; --shadow-color-light: rgba(0, 0, 0, 0.1);
    --ad-placeholder-bg-light: #e9ecef; --ad-placeholder-text-light: #6c757d;
    --scrollbar-thumb-light: var(--brand-color-light); --scrollbar-track-light: rgba(0, 0, 0, 0.1);
    --gradient-start-light: var(--brand-color-light); --gradient-end-light: #1e6091;
    --brand-color-light-rgb: 42, 157, 143;
    --input-bg-light: #ffffff; --input-border-light: var(--border-color-light); --input-text-light: var(--text-color-light);
    --input-focus-border-light: var(--brand-color-light); --input-focus-shadow-light: 0 0 0 0.25rem rgba(42, 157, 143, 0.25);

    /* Subtopic Tile Specific Variables */
    --tile-bg-light: #ffffff;
    --tile-border-light: #e0e0e0;
    --tile-shadow-light: rgba(0, 0, 0, 0.08);
    --tile-hover-shadow-light: rgba(0, 0, 0, 0.15);
    --diff-easy-bg: #d1e7dd; --diff-easy-text: #0f5132;
    --diff-medium-bg: #fff3cd; --diff-medium-text: #664d03;
    --diff-hard-bg: #f8d7da; --diff-hard-text: #842029;
    --diff-elite-bg: #d3cffc; --diff-elite-text: #491e9c; /* Purple for elite */


    /* Apply light theme variables directly */
    --current-bg-start: var(--bg-light-start); --current-bg-end: var(--bg-light-end);
    --current-text-color: var(--text-color-light); --current-navbar-bg: var(--navbar-bg-light);
    --current-card-bg: var(--card-bg-light); --current-card-border: var(--card-border-light);
    --current-border-color: var(--border-color-light); --current-link-color: var(--link-color-light);
    --current-link-hover: var(--link-hover-light); --current-brand-color: var(--brand-color-light);
    --current-brand-secondary: var(--brand-secondary-light);
    --current-primary-btn-bg: var(--primary-btn-bg-light); --current-primary-btn-text: var(--primary-btn-text-light);
    --current-success-btn-bg: var(--success-btn-bg-light); --current-success-btn-text: var(--success-btn-text-light);
    --current-test-item-hover-bg: var(--test-item-hover-bg-light); --current-test-item-active-bg: var(--test-item-active-bg-light);
    --current-test-item-active-text: var(--test-item-active-text-light); --current-heading-color: var(--heading-color-light);
    --current-shadow-color: var(--shadow-color-light); --current-ad-placeholder-bg: var(--ad-placeholder-bg-light);
    --current-ad-placeholder-text: var(--ad-placeholder-text-light); --current-scrollbar-thumb: var(--scrollbar-thumb-light);
    --current-scrollbar-track: var(--scrollbar-track-light);
    --current-gradient-start: var(--gradient-start-light); --current-gradient-end: var(--gradient-end-light);
    --current-brand-rgb: var(--brand-color-light-rgb);
    --current-input-bg: var(--input-bg-light); --current-input-border: var(--input-border-light); --current-input-text: var(--input-text-light);
    --current-input-focus-border: var(--input-focus-border-light); --current-input-focus-shadow: var(--input-focus-shadow-light);
    --current-text-muted: #6c757d; /* Define text-muted for light theme */

    /* Tile Variables */
    --current-tile-bg: var(--tile-bg-light);
    --current-tile-border: var(--tile-border-light);
    --current-tile-shadow: var(--tile-shadow-light);
    --current-tile-hover-shadow: var(--tile-hover-shadow-light);
}

html { scroll-behavior: smooth; }

body {
    margin: 0; padding: 0; min-height: 100vh; display: flex; flex-direction: column;
    font-family: "Ubuntu", sans-serif; font-weight: 400; line-height: 1.6;
    background: linear-gradient(135deg, var(--current-bg-start), var(--current-bg-end));
    color: var(--current-text-color);
    transition: background 0.5s ease, color 0.5s ease;
    padding-top: 60px; /* Initial estimate, adjust if navbar height changes */
}

/* Contact Section Styles (Keep for contact page) */
.contact-section {
    background-color: var(--current-card-bg); padding: 2rem; border-radius: 8px;
    border: 1px solid var(--current-card-border); box-shadow: 0 2px 5px var(--current-shadow-color);
    color: var(--current-text-color); margin-bottom: 1.5rem;
}
.contact-section h2 { color: var(--current-brand-color); font-size: 1.5rem; margin-bottom: 1.5rem; display: flex; align-items: center; font-weight: 500; padding-bottom: 0.5rem; border-bottom: 1px solid var(--current-border-color); }
.contact-section h2 i { margin-right: 0.75rem; font-size: 1.2em; width: 25px; text-align: center; }
.contact-info p { margin-bottom: 1rem; display: flex; align-items: center; font-size: 1rem; }
.contact-info i { margin-right: 1rem; color: var(--current-brand-color); width: 20px; text-align: center; }
.contact-info a { color: var(--current-link-color); text-decoration: none; }
.contact-info a:hover { color: var(--current-link-hover); text-decoration: underline;}
.contact-form label { font-weight: 500; margin-bottom: 0.5rem; color: var(--current-text-color); }
.contact-form .form-control, .contact-form .form-select {
    background-color: var(--current-input-bg) !important; border: 1px solid var(--current-input-border) !important;
    color: var(--current-input-text) !important; border-radius: 6px;
}
.contact-form .form-control::placeholder { color: var(--current-text-muted); opacity: 0.8; }
.contact-form .form-control:focus { color: var(--current-input-text); background-color: var(--current-input-bg); border-color: var(--current-input-focus-border); outline: 0; box-shadow: var(--current-input-focus-shadow); }
.contact-form textarea.form-control { min-height: 120px; }

/* Navigation Styles - Reduced Height */
.navbar {
    padding-top: 0.4rem; padding-bottom: 0.4rem; background-color: var(--current-navbar-bg); backdrop-filter: blur(12px); transition: background-color 0.4s ease, box-shadow 0.3s ease, padding 0.3s ease; position: fixed; top: 0; left: 0; width: 100%; z-index: 1030; border-bottom: 1px solid transparent;
}
.navbar.scrolled { box-shadow: 0 4px 15px -5px var(--current-shadow-color); border-bottom: 1px solid var(--current-border-color); }
.navbar-brand { font-size: 1.3rem; font-weight: 700; color: var(--current-brand-color) !important; transition: color 0.4s ease; letter-spacing: -0.05em; display: inline-flex; align-items: center; }
.navbar-brand i { font-size: 1.2rem; vertical-align: middle; }
.navbar-nav .nav-link { padding: 0.35rem 0.8rem; color: var(--current-link-color); transition: color 0.2s ease, background-color 0.2s ease; border-radius: 6px; margin: 0 0.2rem; font-weight: 500; position: relative; overflow: hidden; font-size: 0.95rem; }
.navbar-nav .nav-link::after { content: ''; position: absolute; bottom: 0; left: 50%; transform: translateX(-50%); width: 0; height: 2px; background: var(--current-brand-color); transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1); }
.navbar-nav .nav-link:hover { color: var(--current-link-hover); background-color: rgba(128, 128, 128, 0.05); }
.navbar-nav .nav-link:hover::after { width: 70%; }
.navbar-nav .nav-link.active { color: var(--current-brand-color); font-weight: 700; background-color: rgba(128, 128, 128, 0.1); }
.navbar-nav .nav-link.active::after { width: 70%; }
.theme-toggle { display: none; } /* Hide theme toggle as only light theme is used */
/* Toggler icons adjusted for light theme */
.navbar-toggler-icon { background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba(42, 157, 143, 0.8)' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e"); }
.navbar-toggler { border-color: rgba(128, 128, 128, 0.2); padding: 0.25rem 0.5rem; }

/* Subscribe Glow Effect */
.subscribe-glow { position: relative; z-index: 0; overflow: hidden; }
.subscribe-glow:before { content: ''; background: linear-gradient(45deg, #ff0000, #ff7300, #fffb00, #48ff00, #00ffd5, #002bff, #7a00ff, #ff00c8, #ff0000); position: absolute; top: -2px; left: -2px; background-size: 400%; z-index: -1; filter: blur(5px); width: calc(100% + 4px); height: calc(100% + 4px); animation: glowing 20s linear infinite; opacity: 0; transition: opacity .3s ease-in-out; border-radius: inherit;}
.subscribe-glow:active:before, .subscribe-glow:hover:before { opacity: 1; }
.subscribe-glow:after { z-index: -1; content: ''; position: absolute; width: 100%; height: 100%; background: inherit; left: 0; top: 0; border-radius: inherit; }
@keyframes glowing { 0% { background-position: 0 0; } 50% { background-position: 400% 0; } 100% { background-position: 0 0; } }

/* Navbar Credits Styles (copied from navbar.php for consistency) */
.user-credits-navbar { font-weight: 500; color: var(--current-text-color); font-size: 0.9em; white-space: nowrap; display: inline-flex; align-items: center; }
.user-credits-navbar i.fa-coins { margin-right: 0.2em; font-size: 1.1em; color: #ffc107; line-height: 1; }


/* --- Navbar Collapse on Mobile (< 992px) --- */
@media (max-width: 991.98px) {
    .navbar-collapse {
        padding: 0.5rem 0;
        width: 100%;
        max-height: calc(100vh - 70px); /* Prevent excessive height */
        overflow-y: auto; /* Allow scrolling if content overflows */
        border-top: 1px solid var(--current-border-color);
        margin-top: 0.5rem;
    }
    /* Ensure Topics Stack Vertically */
    .navbar-nav {
        width: 100%;
        flex-direction: column !important; /* Force column direction */
        align-items: stretch; /* Stretch items to full width */
    }
    .navbar-nav .nav-item {
        width: 100%;
        text-align: center; /* Center text within item */
    }
    .navbar-nav .nav-link {
        padding: 0.8rem 1rem; /* Slightly more padding */
        margin-bottom: 0.2rem;
        display: block; /* Make link take full width */
        border-bottom: 1px solid rgba(128, 128, 128, 0.1); /* Separator */
    }
    .navbar-nav .nav-link:last-child {
         border-bottom: none;
    }
    .navbar-nav .nav-link::after {
        display: none; /* Hide desktop hover effect */
    }

    /* Styling for the Right-Side Section (Login/Profile) */
    .navbar-right-section {
        width: 100%;
        margin-top: 1rem; /* Space above this section */
        padding-top: 1rem; /* Space inside this section */
        border-top: 1px solid var(--current-border-color); /* Separator */
        flex-direction: column; /* Stack items vertically */
        align-items: stretch; /* Stretch items */
        gap: 0.5rem; /* Space between items */
    }
    .navbar-right-section .nav-item {
         width: 100%; /* Make items take full width */
         margin: 0 !important; /* Reset margins */
    }
     .navbar-right-section .navbar-text {
         display: block; /* Make username block level */
         text-align: center; /* Center username */
         padding: 0.5rem 0;
         margin-bottom: 0.5rem;
         font-weight: 500;
     }
    .navbar-right-section .btn,
    .navbar-right-section form {
        width: 100%; /* Make buttons/forms full width */
    }
     .navbar-right-section .btn {
         text-align: center;
         padding: 0.75rem 1rem; /* Adjust button padding */
     }

    /* Center Google Sign-In Button */
    .navbar-right-section .g_id_signin {
        display: flex;
        justify-content: center; /* Center button horizontally */
        margin-top: 0.5rem; /* Space above */
    }
}

/* Button Styles - Reduced Size */
.btn { padding: 0.6rem 1.2rem; border-radius: 6px; transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); border: none; font-weight: 500; letter-spacing: 0.03em; box-shadow: 0 2px 5px rgba(0,0,0,0.1); font-size: 0.95rem; }
/* .navbar .d-flex .btn { padding: 0.35rem 1rem; font-size: 0.9rem; } */ /* This might be overridden by mobile styles now */
.btn:hover { transform: translateY(-2px); box-shadow: 0 4px 10px rgba(0,0,0,0.15); filter: brightness(110%); }
.btn:active { transform: translateY(0px); box-shadow: 0 2px 5px rgba(0,0,0,0.1); }
.btn-primary { background: linear-gradient(135deg, var(--current-primary-btn-bg), var(--current-brand-color)); color: var(--current-primary-btn-text); }
.btn-success { background: linear-gradient(135deg, var(--current-success-btn-bg), var(--current-brand-color)); color: var(--current-success-btn-text); }
.btn-warning { background: linear-gradient(135deg, var(--current-brand-secondary), var(--current-brand-color)); color: #ffffff; border: none; }

/* Main Content Area */
.main-content { flex: 1; padding: 0; width: 100%; margin: 0 auto; position: relative; }

/* Ad Placeholders */
.ad-placeholder { background: var(--current-ad-placeholder-bg); border: 2px dashed var(--current-brand-color); display: flex; align-items: center; justify-content: center; color: var(--current-ad-placeholder-text); font-size: 0.9rem; text-align: center; margin: 1.5rem auto; min-height: 90px; border-radius: 12px; width: 100%; max-width: 100%; font-weight: 500; letter-spacing: 0.5px; padding: 1rem; }
.ad-placeholder-content { min-height: 250px; max-width: 300px; }
.ad-placeholder-sidebar { min-height: 100px; max-width: 100%; margin: 1rem 0 0 0;}
.ad-placeholder-footer { min-height: 50px; max-width: 728px; margin-bottom: 0; margin-top: 1.5rem;}

/* Card Design */
.card { background-color: var(--current-card-bg); border: 1px solid var(--current-card-border); border-radius: 12px; box-shadow: 0 6px 20px -4px var(--current-shadow-color); transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.4s ease, border-color 0.4s ease; backdrop-filter: blur(10px); overflow: hidden; }
#testLayout .card { height: 100%; } /* Apply height only to cards in the test layout */
.card:hover { transform: translateY(-5px); box-shadow: 0 10px 25px -5px var(--current-shadow-color); }
.card-header { background-color: rgba(128, 128, 128, 0.05); border-bottom: 1px solid var(--current-card-border); font-weight: 700; color: var(--current-heading-color); padding: 0.8rem 1.2rem; display: flex; justify-content: space-between; align-items: center; } /* Use flex for alignment */

/* Typography & Headings - Reduced Sizes */
h1, h2, h3, h4, h5 { color: var(--current-heading-color); font-weight: 700; transition: color 0.4s ease; letter-spacing: -0.03em; line-height: 1.3; }
h1 { font-size: 2.5rem; margin-bottom: 1.5rem !important; text-shadow: 0 1px 3px var(--current-shadow-color);}
h2 { font-size: 1.9rem; margin-bottom: 1.3rem !important;}
h3 { font-size: 1.5rem; margin-bottom: 1.0rem !important;}
h4 { font-size: 1.3rem; margin-bottom: 1.0rem !important;} /* Base h4 size */
.lead { font-size: 1.05rem; font-weight: 400; opacity: 0.9; }

/* Gradient Text Utility */
.gradient-text { background: linear-gradient(90deg, var(--current-gradient-start), var(--current-gradient-end)); -webkit-background-clip: text; background-clip: text; color: transparent; display: inline-block; }

/* Loading Spinner & Overlay */
.loading-overlay { display: none; position: fixed; /* Changed to fixed */ inset: 0; background: rgba(0, 0, 0, 0.4); backdrop-filter: blur(5px); z-index: 1050; opacity: 0; transition: opacity 0.3s ease; }
.loading-spinner { display: none; position: fixed; /* Changed to fixed */ top: 50%; left: 50%; z-index: 1051; width: 3rem; height: 3rem; border: 0.25rem solid rgba(255, 255, 255, 0.3); border-top-color: var(--current-brand-color); border-radius: 50%; animation: spin 1s linear infinite; opacity: 0; transition: opacity 0.3s ease 0.1s; transform: translate(-50%, -50%); }
@keyframes spin { 0% { transform: translate(-50%, -50%) rotate(0deg); } 100% { transform: translate(-50%, -50%) rotate(360deg); } }
.main-content.loading .loading-overlay, .main-content.loading .loading-spinner { display: block; opacity: 1; }
/* Loading state for specific elements (like test details) */
.loading > .loading-overlay, .loading > .loading-spinner { display: block; opacity: 1; } /* Style for loading specific containers */


/* Footer - Single Line */
footer { text-align: center; padding: 0.8rem 1rem; border-top: 1px solid var(--current-border-color); background-color: var(--current-navbar-bg); color: var(--current-text-color); margin-top: auto; transition: background-color 0.4s ease, border-color 0.4s ease, color 0.4s ease; font-size: 0.85rem; backdrop-filter: blur(10px); }
footer .container span { display: inline; margin-top: 0; }
footer .container .mx-2 { display: inline; margin: 0 0.4rem; }
.footer-link { color: var(--current-link-color); text-decoration: none; transition: color 0.2s ease; }
.footer-link:hover { color: var(--current-link-hover); text-decoration: underline; }
footer span:not(.mx-2) { color: var(--current-text-color); opacity: 0.8; }

/* Test Layout Section Styles - Sidebar Adjusted */
#testLayout { display: none; margin-top: 1.5rem; margin-left: auto; margin-right: auto; padding: 0 1rem; }

/* Card Header Font Size Adjustment */
#testAvailable .card-header .h4,
#testDetails .card-header .h4 {
    font-size: 1.3rem; /* Reduced font size */
    font-weight: 600;
    margin-bottom: 0; /* Remove default margin if needed */
}

#testAvailable .card-body, #testDetails .card-body { padding: 1rem; /* Adjusted padding */ }

/* Test List Scrolling */
.test-list-scroll {
    max-height: 60vh; /* Adjust max height as needed */
    overflow-y: auto;
    padding-right: 5px;
    scrollbar-width: thin;
    scrollbar-color: var(--current-scrollbar-thumb) var(--current-scrollbar-track);
}
.test-list-scroll::-webkit-scrollbar { width: 8px; }
.test-list-scroll::-webkit-scrollbar-track { background: var(--current-scrollbar-track); border-radius: 10px; }
.test-list-scroll::-webkit-scrollbar-thumb { background-color: var(--current-scrollbar-thumb); border-radius: 10px; border: 2px solid var(--current-scrollbar-track); background-clip: content-box; }

/* Test List Items - Size Adjustment */
#testListGroup {
    display: flex;      /* Use flexbox layout */
    flex-wrap: wrap;    /* Allow items to wrap to the next line */
    gap: 0.5rem;        /* Add spacing between wrapped items (adjust as needed) */
    /* Remove default list group flush borders if they interfere */
    border: none;
    padding: 0; /* Reset padding if needed */
}

#testListGroup .list-group-item {
    /* Remove fixed margin-bottom used for vertical stacking */
    margin-bottom: 0 !important; /* Use !important if needed to override Bootstrap */

    /* Allow items to size based on content, or set a flex-basis */
    /* flex: 0 0 auto; /* Example: Let item size based on content */
       /* OR */
    /* flex: 1 1 150px; /* Example: Allow growing/shrinking with a base width */

    /* Keep existing styles for appearance, hover, active state, etc. */
    background-color: transparent;
    border: 1px solid var(--current-border-color);
    color: var(--current-text-color);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    padding: 0.6rem 1rem; /* Existing padding */
    position: relative;
    overflow: hidden;
    font-size: 0.9rem; /* Existing font size */
    text-align: center; /* Optional: Center text in buttons */
}

/* Adjust hover/active states if needed for flex layout */
#testListGroup .list-group-item::before {
    /* Keep existing ::before styles */
    content: ''; position: absolute; left: 0; top: 0; height: 100%; width: 4px; background: var(--current-brand-color); opacity: 0; transform: scaleY(0); transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease; transform-origin: bottom;
}
#testListGroup .list-group-item:hover {
    /* Keep existing hover styles, remove transform if it looks odd */
    background-color: var(--current-test-item-hover-bg); border-color: var(--current-brand-color); color: var(--current-link-hover);
    /* transform: translateX(3px); /* Remove this if items wrap */
}
#testListGroup .list-group-item:hover::before {
    /* Keep existing hover ::before styles */
    opacity: 1; transform: scaleY(1); transform-origin: top;
}
#testListGroup .list-group-item.active {
    /* Keep existing active styles */
    background-color: var(--current-test-item-active-bg); color: var(--current-test-item-active-text); border-color: var(--current-test-item-active-bg); font-weight: 700; box-shadow: 0 0 10px -2px var(--current-brand-color);
}
#testListGroup .list-group-item.active::before {
    /* Keep existing active ::before styles */
    opacity: 1; transform: scaleY(1);
}
#testListGroup .list-group-item.active:hover {
    /* Keep existing active hover styles */
    filter: brightness(110%);
    /* transform: translateX(0); /* Ensure no transform on active hover */
}

/* Ensure the scrolling container still works */
.test-list-scroll {
    max-height: 60vh; /* Keep existing height */
    overflow-y: auto; /* Keep vertical scroll */
    padding-right: 5px; /* Keep padding */
    /* Add overflow-x: hidden; if horizontal scrollbar appears undesirably */
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: var(--current-scrollbar-thumb) var(--current-scrollbar-track);
}
/* Keep scrollbar webkit styles */
.test-list-scroll::-webkit-scrollbar { width: 8px; }
.test-list-scroll::-webkit-scrollbar-track { background: var(--current-scrollbar-track); border-radius: 10px; }
.test-list-scroll::-webkit-scrollbar-thumb { background-color: var(--current-scrollbar-thumb); border-radius: 10px; border: 2px solid var(--current-scrollbar-track); background-clip: content-box; }

/* Test Details Placeholder & Content */
.test-details-placeholder { font-style: italic; opacity: 0.6; padding: 2rem 0; text-align: center; }
.subtopic-loading { padding: 2rem; text-align: center; font-style: italic; color: var(--current-text-color); opacity: 0.8; }

#testDetailsContent { position: relative; padding: 0; }
#testDetailsContent p:not(.test-details-placeholder):not(.subtopic-description) {
    color: var(--current-text-color); line-height: 1.7; margin-bottom: 1rem; padding: 0 1rem;
}


/* --- Subtopic Tile Styles --- */
.subtopic-tiles-container {
    padding: 1rem;
}

.subtopic-tile {
    background-color: var(--current-tile-bg);
    border: 1px solid var(--current-tile-border);
    border-radius: 8px;
    box-shadow: 0 2px 5px var(--current-tile-shadow);
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
    overflow: hidden;
}

.subtopic-tile:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 12px var(--current-tile-hover-shadow);
}

.subtopic-tile .card-body {
    padding: 1rem; /* Padding inside the tile */
}

.subtopic-tile .subtopic-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--current-heading-color);
    margin-bottom: 0.5rem;
}

.subtopic-tile .subtopic-description {
    font-size: 0.85rem;
    line-height: 1.5;
    margin-bottom: 1rem;
    min-height: 40px; /* Give description space */
    color: var(--current-text-muted); /* Use muted color */
}

.subtopic-tile .subtopic-meta {
    display: flex;
    flex-wrap: wrap; /* Allow badges to wrap */
    gap: 0.3rem;
    align-items: center;
}

.subtopic-tile .subtopic-meta .badge {
    font-size: 0.75rem;
    padding: 0.3em 0.6em;
    font-weight: 500; /* Make badge text slightly bolder */
}
.subtopic-tile .subtopic-meta .badge i {
    font-size: 0.9em;
    vertical-align: baseline;
    margin-right: 0.2em; /* Space between icon and text */
}

.subtopic-tile .difficulty-badge {
    text-transform: capitalize;
}

/* Difficulty Badge Colors */
.difficulty-easy { background-color: var(--diff-easy-bg) !important; color: var(--diff-easy-text) !important; border: 1px solid var(--diff-easy-text);}
.difficulty-medium { background-color: var(--diff-medium-bg) !important; color: var(--diff-medium-text) !important; border: 1px solid var(--diff-medium-text);}
.difficulty-hard { background-color: var(--diff-hard-bg) !important; color: var(--diff-hard-text) !important; border: 1px solid var(--diff-hard-text);}
.difficulty-elite { background-color: var(--diff-elite-bg) !important; color: var(--diff-elite-text) !important; border: 1px solid var(--diff-elite-text);}


.subtopic-tile .start-subtopic-btn {
    font-size: 0.85rem;
    padding: 0.4rem 0.8rem;
    width: 100%; /* Make button full width within tile */
}
/* --- End Subtopic Tile Styles --- */


/* Alerts */
.alert { border-radius: 6px; padding: 0.8rem 1.2rem; border: none; box-shadow: 0 3px 8px rgba(0,0,0,0.1); font-weight: 500; font-size: 0.95rem;}
.alert-info { background-color: rgba(42, 157, 143, 0.1); color: var(--brand-color-light); border-left: 4px solid var(--brand-color-light); }
.alert-danger { background-color: rgba(231, 76, 60, 0.1); color: #e74c3c; border-left: 4px solid #e74c3c; }
.alert-warning { background-color: rgba(241, 196, 15, 0.1); color: #f1c40f; border-left: 4px solid #f1c40f; } /* Added warning style */


/* Landing Page Specific Styles */
.hero-section { padding: 4rem 1rem 5rem 1rem; text-align: center; min-height: 65vh; display: flex; flex-direction: column; justify-content: center; border-top: 1px solid rgba(var(--current-brand-rgb, 78, 204, 163), 0.2); }
.hero-section h1 { font-size: 2.5rem; margin-bottom: 0.7rem !important; font-weight: 700; }
.hero-section .h3 { font-size: 1.3rem; margin-bottom: 1.3rem !important; font-weight: 500; opacity: 0.9; display: flex; align-items: center; justify-content: center; gap: 0.5rem; }
.hero-section .h3 .fas { color: var(--current-brand-color); font-size: 1em; }
.hero-section .lead { max-width: 600px; margin-left: auto; margin-right: auto; margin-bottom: 1.8rem !important; font-size: 1.05rem; }
.hero-section .topic-links { margin-top: 1.8rem; display: flex; flex-wrap: wrap; justify-content: center; gap: 0.6rem; }
.hero-section .topic-links .btn { width: auto; margin-bottom: 0; background: rgba(128, 128, 128, 0.1); color: var(--current-link-color); font-weight: 500; border: 1px solid var(--current-border-color); box-shadow: none; padding: 0.5rem 1rem; font-size: 0.9rem; transition: all 0.2s ease-in-out; }
.hero-section .topic-links .btn:hover { background: rgba(128, 128, 128, 0.2); color: var(--current-link-hover); border-color: var(--current-brand-color); transform: translateY(-2px) scale(1.02); box-shadow: 0 3px 8px rgba(0,0,0,0.1); }

/* Search Filter Input Styles */
.search-filter-input {
    background-color: var(--current-input-bg); border: 1px solid var(--current-input-border);
    color: var(--current-input-text); border-radius: 6px; padding: 0.375rem 0.75rem;
    font-size: 0.9rem; transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}
.search-filter-input::placeholder { color: var(--current-text-muted); opacity: 0.8; }
.search-filter-input:focus { color: var(--current-input-text); background-color: var(--current-input-bg); border-color: var(--current-input-focus-border); outline: 0; box-shadow: var(--current-input-focus-shadow); }


/* --- Responsive Adjustments --- */
@media (max-width: 991.98px) { /* Below LG - Navbar collapses, Test layout stacks */
    #testAvailable .card { height: auto; margin-bottom: 1.5rem; }
    #testAvailable .card-body { overflow: hidden; }
    .test-list-scroll { max-height: 40vh; }
    .hero-section h1 { font-size: 2.2rem; }
    .hero-section .h3 { font-size: 1.2rem; }
    .hero-section { padding: 3rem 1rem 4rem 1rem; }
    .subtopic-tile .subtopic-name { font-size: 1rem; }
    .subtopic-tile .subtopic-description { font-size: 0.8rem; }
    #testAvailable .card-header .h4, #testDetails .card-header .h4 { font-size: 1.2rem; } /* Adjust header size */

}

@media (max-width: 767.98px) { /* Below MD */
    body { padding-top: 55px; } /* Adjust if navbar height changes */
    .main-content { padding: 0; }
    #testLayout { padding: 0 0.5rem; }
    .hero-section { padding: 2.5rem 1rem; min-height: 60vh; }
    .hero-section h1 { font-size: 2.0rem; }
    .hero-section .h3 { font-size: 1.1rem; }
    .hero-section .lead { font-size: 1rem; }
    h1 { font-size: 1.8rem; } h2 { font-size: 1.6rem; } h3 { font-size: 1.4rem; } h4 { font-size: 1.2rem; }
    .card { margin-bottom: 1.2rem; }
    #testAvailable .card-body, #testDetails .card-body { padding: 1rem; }
    #testDetailsContent .subtopic-tiles-container { padding: 0.5rem; } /* Reduce padding on mobile */
    .subtopic-tile .card-body { padding: 0.8rem; }
    #testLayout { margin-top: 1rem; max-width: none; }
    .btn { padding: 0.7rem 1.2rem; font-size: 1rem; }
    .hero-section .topic-links .btn { padding: 0.5rem 0.8rem; font-size: 0.85rem; }
    #testAvailable .card-header .h4, #testDetails .card-header .h4 { font-size: 1.1rem; } /* Further reduce header */
     /* Stack tiles - Use Bootstrap's col-12 */
     .subtopic-tiles-container .col-sm-6 { flex: 0 0 100%; max-width: 100%; }

}

@media (max-width: 575.98px) { /* Below SM */
    body { padding-top: 50px; } /* Adjust if navbar height changes */
    .hero-section { padding: 2rem 1rem; min-height: 55vh; }
    .hero-section h1 { font-size: 1.7rem; }
    .hero-section .h3 { font-size: 1.0rem; }
    .hero-section .lead { font-size: 0.9rem; }
    h1 { font-size: 1.6rem; } h2 { font-size: 1.4rem; } h3 { font-size: 1.3rem; } h4 { font-size: 1.1rem; }
    .navbar-brand { font-size: 1.2rem; } .navbar-brand i { font-size: 1.1rem; }
    .btn { font-size: 0.9rem; padding: 0.6rem 1rem; }
    .hero-section .topic-links .btn { padding: 0.4rem 0.7rem; font-size: 0.8rem; }
    #testAvailable .card-body, #testDetails .card-body { padding: 0.8rem; }
    #testListGroup .list-group-item { padding: 0.5rem 0.8rem; font-size: 0.85rem; } /* Further reduce button size */
    .test-details-placeholder { padding: 1.2rem 0; font-size: 0.9rem; }
    footer { font-size: 0.8rem; padding: 0.6rem 0.8rem;}
    footer .container .mx-2 { margin: 0 0.3rem; }
    #testLayout { padding: 0 0.25rem; }
    #testAvailable .card-header .h4, #testDetails .card-header .h4 { font-size: 1rem; } /* Smallest header */
    .subtopic-tile .subtopic-name { font-size: 0.95rem; }
}

/* Profile Page Credits (in header) */
.user-credits-profile {
    font-size: 1.1rem;
    font-weight: bold;
    color: var(--current-heading-color);
    display: inline-flex; /* Align icon and text */
    align-items: center;
}
.user-credits-profile i.fa-coins {
    color: #ffc107; /* Gold color for coins */
    margin-right: 0.4em;
    font-size: 1.2em;
    line-height: 1; /* Ensure icon aligns well */
}

/* Desktop homepage enhancements - added for improved default.php design */
.category-card {
    background-color: var(--current-card-bg);
    border: 1px solid var(--current-card-border);
    border-radius: 10px;
    padding: 1.5rem;
    height: 100%;
    transition: all 0.3s ease;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
}

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

.category-icon {
    font-size: 2.5rem;
    color: var(--current-brand-color);
    margin-bottom: 1rem;
    text-align: center;
}

.category-card h4 {
    font-weight: 600;
    color: var(--current-heading-color);
    margin-bottom: 1rem;
    text-align: center;
}

.category-card p {
    font-size: 0.95rem;
    color: var(--current-text-color);
    margin-bottom: 1.5rem;
    text-align: center;
    min-height: 60px;
}

.category-topics {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
}

.category-topics .btn {
    background-color: var(--current-primary-btn-bg);
    color: white;
    border-radius: 5px;
    transition: all 0.2s ease;
}

.category-topics .btn:hover {
    background-color: var(--current-link-hover);
    transform: scale(1.05);
}

/* Benefits section styling */
.benefits-section {
    padding: 2rem 0;
}

.benefit-item {
    text-align: center;
    padding: 1.5rem;
    border-radius: 10px;
    background-color: var(--current-card-bg);
    transition: all 0.3s ease;
    height: 100%;
    border: 1px solid var(--current-card-border);
}

.benefit-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.benefit-icon {
    font-size: 2rem;
    color: var(--current-brand-color);
    margin-bottom: 1rem;
}

.benefit-item h5 {
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--current-heading-color);
}

.benefit-item p {
    font-size: 0.9rem;
    color: var(--current-text-muted);
}

/* --- END: CSS STYLES --- */

/* Profile page enhancements for desktop UI */
.main-profile-card {
    border-radius: 12px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    border: none;
    transition: transform 0.3s ease;
}

.main-profile-card:hover {
    transform: translateY(-5px);
}

.profile-quick-stats {
    display: flex;
    gap: 15px;
}

.stat-badge {
    background-color: var(--current-card-bg);
    border: 1px solid var(--current-card-border);
    border-radius: 8px;
    padding: 5px 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s ease;
}

.stat-badge:hover {
    transform: translateY(-2px);
}

.stat-badge i {
    color: var(--current-brand-color);
    font-size: 16px;
}

.stat-badge span {
    font-weight: 600;
    font-size: 14px;
}

.profile-header-wrapper {
    display: flex;
    align-items: center;
    gap: 20px;
    padding-bottom: 20px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--current-card-border);
}

.profile-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background-color: var(--current-brand-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 36px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.profile-header-info {
    flex: 1;
}

.profile-since {
    margin-top: 10px;
}

/* Activity dashboard styles */
.activity-dashboard {
    margin-bottom: 30px;
}

.activity-metric {
    background-color: var(--current-card-bg);
    border: 1px solid var(--current-card-border);
    border-radius: 10px;
    padding: 15px;
    position: relative;
    height: 100%;
    min-height: 100px;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s ease;
}

.activity-metric:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 12px rgba(0, 0, 0, 0.1);
}

.metric-label {
    font-size: 14px;
    color: var(--current-text-muted);
    font-weight: 500;
}

.metric-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--current-heading-color);
    margin-top: 5px;
}

.metric-icon {
    position: absolute;
    bottom: 10px;
    right: 10px;
    font-size: 32px;
    color: rgba(var(--current-brand-rgb), 0.2);
}

/* Improved chart container */
.chart-container {
    background-color: var(--current-card-bg);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    margin-bottom: 30px;
    height: 300px;
}

/* Index.php new styles */
.homepage-hero {
    padding: 80px 0;
    background: linear-gradient(135deg, var(--current-bg-start), var(--current-bg-end));
    position: relative;
    overflow: hidden;
}

.homepage-hero::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%232a9d8f' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    z-index: 0;
}

.homepage-hero .container {
    position: relative;
    z-index: 1;
}

.animate-text {
    background-image: linear-gradient(90deg, var(--current-brand-color), var(--current-gradient-end));
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
    animation: textShimmer 3s infinite;
}

@keyframes textShimmer {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.stat-counter {
    text-align: center;
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 15px;
    transition: all 0.3s ease;
}

.counter-value {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 5px;
    color: var(--current-brand-color);
}

.counter-label {
    font-size: 0.9rem;
    color: var(--current-text-muted);
}

.hero-illustration {
    position: relative;
    height: 300px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.orbit-container {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    justify-content: center;
    align-items: center;
}

.orbit-circle {
    position: relative;
    width: 250px;
    height: 250px;
    border-radius: 50%;
    border: 2px dashed rgba(var(--current-brand-rgb), 0.2);
    animation: rotate 15s linear infinite;
}

@keyframes rotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.orbit-item {
    position: absolute;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: white;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.5rem;
    color: var(--current-brand-color);
    animation: counterRotate 15s linear infinite;
}

@keyframes counterRotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(-360deg); }
}

.orbit-item-1 { top: 0; left: 50%; transform: translateX(-50%); }
.orbit-item-2 { bottom: 0; left: 50%; transform: translateX(-50%); }
.orbit-item-3 { left: 0; top: 50%; transform: translateY(-50%); }
.orbit-item-4 { right: 0; top: 50%; transform: translateY(-50%); }

/* Section styling */
.section-header {
    margin-bottom: 40px;
}

.section-title {
    position: relative;
    font-weight: 700;
    margin-bottom: 15px;
    display: inline-block;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 3px;
    background-color: var(--current-brand-color);
    border-radius: 3px;
}

.section-subtitle {
    color: var(--current-text-muted);
    max-width: 600px;
    margin: 0 auto;
}

/* Topic cards */
.topic-card {
    display: block;
    text-align: center;
    padding: 20px 15px;
    border-radius: 10px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
    background-color: var(--current-card-bg);
    transition: all 0.3s ease;
    height: 100%;
    text-decoration: none;
    color: var(--current-text-color);
}

.topic-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
    color: var(--current-brand-color);
}

.topic-icon {
    font-size: 2.5rem;
    color: var(--current-brand-color);
    margin-bottom: 15px;
}

.topic-name {
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
}

/* Test cards */
.test-card {
    border-radius: 10px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
    background-color: var(--current-card-bg);
    transition: all 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--current-card-border);
}

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

.test-card.popular {
    border-top: 3px solid var(--current-brand-color);
}

.test-card-header {
    padding: 15px;
    border-bottom: 1px solid var(--current-card-border);
}

.test-tag {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--current-brand-color);
    margin-bottom: 8px;
    padding: 3px 8px;
    border-radius: 20px;
    background-color: rgba(var(--current-brand-rgb), 0.1);
}

.test-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
    color: var(--current-heading-color);
    line-height: 1.3;
}

.test-card-body {
    padding: 15px;
    flex: 1;
}

.test-description {
    font-size: 0.9rem;
    color: var(--current-text-muted);
    margin-bottom: 15px;
    min-height: 40px;
}

.test-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    color: var(--current-text-muted);
}

.popular-badge {
    color: #e77f1b;
    font-weight: 600;
}

.test-card-footer {
    padding: 15px;
    border-top: 1px solid var(--current-card-border);
    text-align: right;
}

/* Feature boxes */
.feature-box {
    text-align: center;
    padding: 25px 20px;
    border-radius: 10px;
    background-color: var(--current-card-bg);
    border: 1px solid var(--current-card-border);
    transition: all 0.3s ease;
    height: 100%;
}

.feature-box:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.feature-icon {
    font-size: 2.5rem;
    color: var(--current-brand-color);
    margin-bottom: 20px;
}

.feature-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--current-heading-color);
}

.feature-description {
    font-size: 0.9rem;
    color: var(--current-text-muted);
    margin: 0;
}

/* Call to action section */
#cta {
    background: linear-gradient(135deg, var(--current-brand-color), var(--current-gradient-end));
}

/* Media queries for responsive design */
@media (max-width: 768px) {
    .homepage-hero {
        padding: 40px 0;
    }
    
    .counter-value {
        font-size: 1.5rem;
    }
    
    .section-title {
        font-size: 1.8rem;
    }
    
    .section-subtitle {
        font-size: 0.9rem;
    }
}