/* --- NEW UTILITY CLASS FOR THEME ANIMATION --- */
/* This class is added by JS only when the dark mode toggle is clicked. */
.theme-transition {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
}

/* 1. GLOBAL STYLES & VARIABLES
---------------------------------------------------- */
:root {
    /* Light Mode Colors */
    --primary-color: #005A9C; /* A professional, deep blue */
    --primary-hover: #004070; /* Darker blue for hover */
    --accent-color: #007BFF; /* A brighter blue for accents and links */
    --text-color: #333333;
    --light-text-color: #f8f9fa; /* Text color for dark backgrounds (e.g., buttons, header, footer) */
    --background-color: #f8f9fa;
    --background-color-rgb: 248, 249, 250; /* RGB for gradients/transparency */
    --card-background: #ffffff;
    --border-color: #dee2e6;
    --shadow: 0px 4px 15px rgba(0, 0, 0, 0.25);
    --shadow-light: 0px 4px 15px rgba(0, 0, 0, 0.07);
    --header-bg-scrolled: rgba(255, 255, 255, 0.8); /* Semi-transparent white for scrolled header */
    --header-border-scrolled: rgba(222, 226, 230, 0.5); /* Lighter border for scrolled header */
    --blockquote-background: #e9ecef;
    --table-even-row: #f8f9fa;
    --table-hover-row: #e9ecef;
    --chat-bot-bubble-background: #e9ecef;
    --chat-bot-typing-indicator-background: #e9ecef;
    --chat-bot-disclaimer-color: #6c757d;
    --footer-bg: #212529; /* Explicit footer background */

    /* Registration/Auth Form Status Colors */
    --success-bg-light: #d4edda;
    --success-text-light: #155724;
    --error-bg-light: #f8d7da;
    --error-text-light: #721c24;
    --info-bg-light: #d1ecf1;
    --info-text-light: #0c5460;

    /* Admin Panel Colors for Light Mode */
    --admin-bg: #f0f2f5;
    --admin-card-bg: #ffffff;
    --admin-text-color: #333;
    --admin-border-color: #dee2e6;
    --admin-primary: #005A9C;
    --admin-accent: #007BFF;
    --admin-danger: #dc3545;
    --admin-success: #28a745;
    --admin-accent-rgb: 0, 123, 255; /* Added for transparent hover */
}

/* Dark Mode Variables */
[data-theme="dark"] {
    --primary-color: #8ab4f8; /* Lighter blue for dark mode primary */
    --primary-hover: #a7c7ed; /* Slightly darker for hover */
    --accent-color: #6a9ce6; /* A softer blue for accents */
    --text-color: #e0e0e0; /* Light gray text */
    --light-text-color: #f8f9fa;
    --background-color: #1a1a1a; /* Dark background */
    --background-color-rgb: 26, 26, 26;
    --card-background: #2b2b2b; /* Darker background for cards */
    --border-color: #444444; /* Darker border */
    --shadow: 0px 4px 15px rgba(0, 0, 0, 0.5); /* More pronounced shadow */
    --shadow-light: 0px 4px 15px rgba(0, 0, 0, 0.2);
    --header-bg-scrolled: rgba(43, 43, 43, 0.8); /* Semi-transparent dark for scrolled header */
    --header-border-scrolled: rgba(68, 68, 68, 0.5);
    --blockquote-background: #3a3a3a;
    --table-even-row: #2f2f2f;
    --table-hover-row: #3a3a3a;
    --chat-bot-bubble-background: #3a3a3a;
    --chat-bot-typing-indicator-background: #3a3a3a;
    --chat-bot-disclaimer-color: #a0a0a0;
    --footer-bg: #212529; /* Footer background remains dark for brand consistency */

    /* Admin Panel Colors for Dark Mode */
    --admin-bg: #212121;
    --admin-card-bg: #333333;
    --admin-text-color: #e0e0e0;
    --admin-border-color: #555555;
    --admin-primary: #8ab4f8;
    --admin-accent: #a7c7ed;
    --admin-danger: #ff6b6b;
    --admin-success: #69eb7f;
    --admin-accent-rgb: 167, 199, 237; /* Added for transparent hover */

    /* Registration/Auth Form Status Colors for Dark Mode */
    --success-bg-light: #1e3a2e;
    --success-text-light: #69eb7f;
    --error-bg-light: #4a1c22;
    --error-text-light: #ff6b6b;
    --info-bg-light: #1a4e5c;
    --info-text-light: #80d3e8;
}


@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;600;700&display=swap');

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Poppins', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    font-size: 16px;
    line-height: 1.7;
    
    /* FIX: Footer Placement Issue */
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: auto;
    padding: 20px 0;
}

/* FIX: Footer Placement Issue - Main content expands */
main {
    flex-grow: 1; 
}

h1, h2, h3 {
    color: var(--primary-color);
    margin-bottom: 20px;
    font-weight: 600;
}

p {
    margin-bottom: 15px;
}

a {
    color: var(--accent-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

/* 2. HEADER & NAVIGATION
---------------------------------------------------- */
header {
    background: var(--card-background);
    padding: 15px 0;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

/* Header Scrolled Effect */
header.scrolled {
    background-color: var(--header-bg-scrolled); /* Semi-transparent */
    backdrop-filter: blur(8px); /* Blurry background */
    -webkit-backdrop-filter: blur(8px); /* For Safari */
    border-bottom: 1px solid var(--header-border-scrolled);
    box-shadow: var(--shadow-light); /* Lighter shadow when scrolled */
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header .logo {
    font-size: 1.6em;
    font-weight: 700;
    color: var(--primary-color);
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 20px;
}

/* Dark Mode Toggle Button */
.dark-mode-toggle {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.5rem;
    color: var(--primary-color); /* Matches logo/nav link color */
    padding: 5px;
    transition: color 0.2s ease, transform 0.2s ease;
    display: flex; /* To center icon if it's text */
    align-items: center;
    justify-content: center;
    width: 30px;
}

.dark-mode-toggle:hover {
    color: var(--accent-color);
    transform: scale(1.1);
}


header nav ul {
    display: flex;
    list-style: none;
}

header nav ul li {
    margin-left: 25px;
}

header nav a {
    font-weight: 600;
    font-size: 1.1em;
    padding: 5px 0;
    border-bottom: 2px solid transparent;
    transition: border-color 0.3s ease, color 0.3s ease;
}

header nav a:hover, header nav a.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
    text-decoration: none;
}

#auth-icons-container {
    padding-bottom: 5px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.auth-icon {
    font-size: 1.7rem;
    color: var(--primary-color);
    text-decoration: none;
    padding: 5px;
    border-bottom: none !important;
    transition: transform 0.2s ease, color 0.2s ease;
}

.auth-icon:hover {
    color: var(--accent-color);
    text-decoration: none !important;
    transform: scale(1.1);
}

#menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    position: relative;
    width: 30px;
    height: 22px;
    z-index: 10;
}

.bar {
    display: block;
    width: 100%;
    height: 3px;
    background-color: var(--primary-color);
    border-radius: 3px;
    transition: all 0.35s ease-in-out;
    position: absolute;
}

.bar:nth-child(1) {
    top: 0;
}

.bar:nth-child(2) {
    top: 50%;
    transform: translateY(-50%);
}

.bar:nth-child(3) {
    bottom: 0;
}

#menu-toggle.active .bar:nth-child(1) {
    top: 50%;
    transform: translateY(-50%) rotate(45deg);
}

#menu-toggle.active .bar:nth-child(2) {
    opacity: 0;
}

#menu-toggle.active .bar:nth-child(3) {
    bottom: 50%;
    transform: translateY(50%) rotate(-45deg);
}


/* 3. HOME PAGE SPECIFIC STYLES
---------------------------------------------------- */
.hero {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 80px 20px;
    background: var(--card-background);
    gap: 60px;
    box-shadow: var(--shadow-light);
    margin-bottom: 40px; /* Added spacing */
}

.hero-text {
    max-width: 550px;
}

.hero-text .subtitle {
    font-size: 1.5em;
    color: var(--text-color); /* Use variable */
    margin-bottom: 20px;
    font-weight: 300;
    opacity: 0.8;
}

.hero-image img {
    width: 320px;
    height: 320px;
    border-radius: 50%;
    object-fit: cover;
    border: 8px solid var(--primary-color);
    box-shadow: var(--shadow);
}

.btn {
    display: inline-block;
    background: var(--accent-color);
    color: var(--light-text-color);
    padding: 14px 35px; /* Slightly larger padding */
    border-radius: 12px; /* More rounded */
    font-size: 1em; /* Slightly larger font */
    font-weight: 600;
    text-decoration: none;
    transition: background-color 0.3s ease, transform 0.2s ease, color 0.3s ease;
    text-align: center;
    flex: 1;
    border: none; /* Ensure no default border */
}

.btn:hover {
    background: var(--primary-hover);
    color: var(--light-text-color); /* Keep text color consistent on hover */
    transform: translateY(-3px);
    text-decoration: none;
}

.button-group {
    display: flex;
    gap: 15px;
    margin-top: 25px; /* Increased spacing */
}

.stats {
    background: transparent;
    padding: 40px 0;
    text-align: center;
}

.stats .container {
    background: var(--card-background);
    padding: 40px;
    border-radius: 18px; /* More rounded */
    box-shadow: var(--shadow);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

.stat-item {
    background: var(--background-color);
    padding: 30px 20px;
    border-radius: 14px; /* More rounded */
    border: 1px solid var(--border-color);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.stat-item:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-light);
}

.stat-item h3 {
    font-size: 3em;
    margin: 0 0 5px 0;
    color: var(--accent-color);
}

.stat-item p {
    font-size: 1.1em;
    margin: 0;
    color: var(--text-color); /* Use variable */
    opacity: 0.9;
    font-weight: 600;
}

/* 4. GENERIC INNER PAGE STYLES
---------------------------------------------------- */
.page-header {
    background: var(--primary-color);
    color: var(--light-text-color);
    padding: 50px 0;
    text-align: center;
}

.page-header h1 {
    color: var(--light-text-color);
    font-size: 3em;
    margin: 0;
}

blockquote {
    background: var(--blockquote-background);
    border-left: 5px solid var(--accent-color);
    margin: 30px 0;
    padding: 20px 30px;
    font-style: italic;
    font-size: 1.1em;
    border-radius: 0 12px 12px 0; /* More rounded on the right */
}

blockquote cite {
    display: block;
    margin-top: 15px;
    font-weight: 600;
    color: var(--text-color); /* Use variable */
    opacity: 0.8;
    font-style: normal;
}

.list-section {
    background: var(--card-background);
    padding: 30px;
    border-radius: 18px; /* More rounded */
    margin-bottom: 40px;
    box-shadow: var(--shadow);
}
.list-section h3 {
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 15px;
    margin-top: 0;
}
.list-section ul {
    list-style-type: none;
    padding-left: 0;
}
.list-section ul li {
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color); /* Use variable */
}
.list-section ul li:last-child {
    border-bottom: none;
}
.list-section ul li::before {
    content: "■";
    color: var(--accent-color);
    margin-right: 12px;
    font-size: 0.8em;
}


/* 5. TABLES & CONTACT PAGE
---------------------------------------------------- */
.course-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}
.course-table th, .course-table td {
    padding: 15px;
    border: 1px solid var(--border-color);
    text-align: left;
}
.course-table thead {
    background-color: var(--primary-color);
    color: var(--light-text-color);
    font-size: 1.1em;
}
.course-table tbody tr:nth-child(even) {
    background-color: var(--table-even-row);
}
.course-table tbody tr:hover {
    background-color: var(--table-hover-row);
    transition: background-color 0.3s ease;
}

.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: flex-start;
}

.contact-info-item {
    background: var(--card-background);
    padding: 25px;
    border-radius: 14px; /* More rounded */
    box-shadow: var(--shadow);
    margin-bottom: 20px;
}
.contact-info-item h3 {
    margin-top: 0;
    font-size: 1.3em;
}
.contact-info-item p {
    margin-bottom: 5px;
}

/* 6. FOOTER
---------------------------------------------------- */
footer {
    background: var(--footer-bg); /* Use variable for footer background */
    color: var(--light-text-color); /* This will now be light in both modes */
    text-align: center;
    padding: 30px 0;
    margin-top: 40px;
    flex-shrink: 0; /* Ensures footer doesn't shrink */
}
footer p {
    margin: 0;
    opacity: 0.8;
}

/* 7. RESPONSIVE MEDIA QUERIES
---------------------------------------------------- */
@media (max-width: 992px) {
    h1 { font-size: 2.5em; }
    h2 { font-size: 2em; }
    .hero {
        flex-direction: column-reverse;
        text-align: center;
    }
    .hero-text {
        max-width: 100%;
    }
    .btn {
        margin-right: 10px;
        margin-bottom: -5px;
    }
    .contact-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    body {
        font-size: 15px;
    }

    /* Adjust header controls for mobile */
    .header-controls {
        gap: 10px; /* Slightly reduced gap between elements on mobile */
    }

    /* Adjust dark mode toggle for mobile */
    .dark-mode-toggle {
        font-size: 1.3rem; /* Smaller icon size on mobile */
        padding: 3px; /* Reduced padding for more compact look */
    }

    /* FIX: Mobile menu animation */
    header nav ul {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--card-background);
        flex-direction: column;
        width: 100%;
        box-shadow: 0 10px 10px rgba(0,0,0,0.1);
        max-height: 0; /* Hidden by default */
        opacity: 0; /* Hidden by default */
        overflow: hidden;
        transition: max-height 0.4s ease-in-out, opacity 0.4s ease-in-out, background-color 0.3s ease, box-shadow 0.3s ease;
    }

    #nav-links.active {
        max-height: 500px; /* Expands to show content */
        opacity: 1; /* Fully visible */
    }

    #menu-toggle {
        display: block;
    }

    #nav-links li {
        margin: 0;
        text-align: center;
    }

    #nav-links a {
        display: block;
        padding: 15px;
        border-bottom: 1px solid var(--border-color);
    }

    #nav-links a:hover, #nav-links a.active {
        background: var(--background-color);
        border-bottom-color: var(--border-color);
    }


    .hero-image img {
        width: 250px;
        height: 250px;
    }

    .page-header {
        padding: 30px 0;
    }
    .page-header h1 {
        font-size: 2.2em;
    }

    .button-group {
        flex-direction: column;
        width: 73%;
        max-width: 400px;
        margin-left: auto;
        margin-right: auto;
    }


}

/* 8. RESPONSIVE TABLE TRANSFORMATION (CARD LAYOUT)
---------------------------------------------------- */
@media screen and (max-width: 768px) {
    table:not(.convert-to-accordion) {
        border: none;
        box-shadow: none;
    }

    .table-container {
        overflow-x: visible;
        box-shadow: none;
    }

    table:not(.convert-to-accordion) thead {
        border: none;
        clip: rect(0 0 0 0);
        height: 1px;
        margin: -1px;
        overflow: hidden;
        padding: 0;
        position: absolute;
        width: 1px;
    }

    table:not(.convert-to-accordion) tr {
        display: block;
        margin-bottom: 20px;
        border-radius: 14px; /* More rounded */
        background: var(--card-background);
        border: 1px solid var(--border-color);
    }

    table:not(.convert-to-accordion) td {
        border: none;
        border-bottom: 1px solid var(--border-color);
        display: block;
        text-align: right;
        padding: 12px 15px;
        white-space: normal;
    }

    table:not(.convert-to-accordion) td:last-child {
        border-bottom: none;
    }

    table:not(.convert-to-accordion) td::before {
        content: attr(data-label);
        float: left;
        font-weight: bold;
        color: var(--primary-color);
        text-transform: uppercase;
        font-size: 0.9em;
    }
}

/* 9. ACCORDION STYLES (Mobile Only)
---------------------------------------------------- */
.accordion-group {
    margin-bottom: 10px;
    border-radius: 12px; /* More rounded */
    box-shadow: var(--shadow-light);
    overflow: hidden;
    border: 1px solid var(--border-color);
    background: var(--card-background);
}

.accordion-header {
    padding: 15px 20px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    color: var(--primary-color);
}

.accordion-header .accordion-arrow {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-top: 2px solid var(--accent-color);
    border-right: 2px solid var(--accent-color);
    transition: transform 0.4s ease-in-out, border-color 0.3s ease;
    transform: rotate(135deg); /* Default collapsed state */
}

/* FIX: Accordion panel hidden by default, visible when active */
.accordion-panel {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease-in-out;
}

.accordion-panel.active {
    max-height: 1000px; /* A larger value to accommodate more content */
}

/* FIX: Arrow rotation when accordion is active */
.accordion-header.active .accordion-arrow {
    transform: rotate(45deg); /* Rotates to point up/down */
}

.accordion-panel-content {
    min-height: 0;
    overflow: hidden;
    padding: 0 20px;
    border-top: 1px solid var(--border-color);
}

.accordion-content-item {
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color); /* Use variable */
}
.accordion-content-item:last-child {
    border-bottom: none;
    padding-bottom: 15px;
}
.accordion-content-item:first-child {
    padding-top: 15px;
}
.accordion-content-item div {
    padding: 2px 0;
}

@media screen and (max-width: 768px) {
    table.convert-to-accordion {
        display: none;
    }
}

/* 10. TIMELINE TABLE MOBILE STYLES
---------------------------------------------------- */
@media screen and (max-width: 768px) {
    table.timeline-table tr {
        display: flex;
        flex-direction: column;
        padding: 15px;
    }

    table.timeline-table td {
        display: block;
        border: none;
        padding: 0;
        text-align: left;
        line-height: 1.6;
    }

    table.timeline-table td::before {
        content: none;
    }

    table.timeline-table td[data-label="Year"] {
        font-weight: 700;
        color: var(--primary-color);
        font-size: 1.1em;
        line-height: 1.3;
    }
}

/* 11. CUSTOM PARTITION LINES (Mobile Only)
---------------------------------------------------- */
@media screen and (max-width: 768px) {
    table.timeline-table td[data-label="Year"] {
        padding-bottom: 10px;
        margin-bottom: 10px;
        border-bottom: 1px solid var(--border-color);
    }
}

/* 12. BACK TO TOP BUTTON
---------------------------------------------------- */
#back-to-top-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    background-color: var(--primary-color);
    color: var(--light-text-color);
    text-align: center;
    font-size: 24px;
    line-height: 50px;
    border-radius: 50%; /* Full circle */
    z-index: 999;
    cursor: pointer;
    box-shadow: var(--shadow);
    text-decoration: none;

    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease, background-color 0.3s ease, color 0.3s ease;
}

#back-to-top-btn:hover {
    background-color: var(--primary-hover);
    color: var(--light-text-color);
    text-decoration: none;
}

#back-to-top-btn.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

@media (max-width: 768px) {
    #back-to-top-btn {
        width: 45px;
        height: 45px;
        line-height: 45px;
        font-size: 20px;
        right: 15px;
        bottom: 15px;
    }
}

/* 13. WHATSAPP FLOATING BUTTON (MOBILE ONLY)
---------------------------------------------------- */
#whatsapp-fab {
    position: fixed;
    bottom: 20px;
    left: 20px;
    width: 50px;
    height: 50px;
    background-color: #25D366; /* Official WhatsApp Green - keep same for brand identity */
    border-radius: 50%;
    box-shadow: var(--shadow);
    z-index: 999;

    display: flex;
    align-items: center;
    justify-content: center;

    transition: transform 0.2s ease, background-color 0.2s ease, box-shadow 0.3s ease;
}

#whatsapp-fab:hover {
    background-color: #1DA851;
    transform: scale(1.1);
}

#whatsapp-fab img {
    width: 75px;
    height: 75px;
}

@media (max-width: 768px) {
    #whatsapp-fab {
        display: flex;
        width: 45px;
        height: 45px;
        bottom: 15px;
        left: 15px;
    }

    #whatsapp-fab img {
        width: 75px;
        height: 75px;
    }
}

/* 14. VIEWPORT ANIMATIONS
---------------------------------------------------- */
.fade-in-section {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s cubic-bezier(0.2, 0.8, 0.2, 1), transform 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.fade-in-section.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.hero .fade-in-section:nth-child(2) {
    transition-delay: 0.15s;
}

.stats-grid .stat-item.fade-in-section:nth-child(2) {
    transition-delay: 0.15s;
}

.stats-grid .stat-item.fade-in-section:nth-child(3) {
    transition-delay: 0.3s;
}

main .container .list-section.fade-in-section + .list-section.fade-in-section {
    transition-delay: 0.15s;
}

main .container .list-section.fade-in-section + .list-section.fade-in-section + .list-section.fade-in-section {
    transition-delay: 0.3s;
}

.contact-grid > div.fade-in-section:nth-child(2) {
    transition-delay: 0.15s;
}



/* 15. CHATBOT INTERFACE STYLES (FINAL FLOATING CELL VERSION)
---------------------------------------------------- */

.chat-page-body {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

main.chat-container {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    background: transparent;
    overflow: hidden;
    position: relative;
}

main.chat-container::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 160px;
    background: linear-gradient(to top, var(--background-color) 25%, rgba(var(--background-color-rgb), 0));
    pointer-events: none;
}


.chat-page-body > header,
.chat-page-body > footer {
    flex-shrink: 0;
}
.chat-page-body > footer {
    display: none;
}

.chat-header {
    padding: 20px;
    background-color: var(--background-color);
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
    text-align: center;
}

.chat-header h1 { font-size: 1.5em; margin: 0; }

.chat-messages {
    flex-grow: 1;
    padding: 30px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 25px;
    /* INCREASED padding-bottom to make space for BOTH input and sample questions */
    padding-bottom: 220px;
}

.chat-message { display: flex; align-items: flex-start; gap: 15px; max-width: 80%; animation: fadeIn 0.4s ease-in-out; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.chat-message .avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background-color: var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6em;
    flex-shrink: 0;
    box-shadow: var(--shadow-light);
    overflow: hidden;
}
.chat-message .avatar img { width: 100%; height: 100%; object-fit: cover; }
.chat-message .message-content {
    padding: 15px 20px;
    border-radius: 20px; /* Base radius */
    line-height: 1.6;
}
.chat-message.user { align-self: flex-end; flex-direction: row-reverse; }
.chat-message.user .message-content {
    background-color: var(--accent-color);
    color: var(--light-text-color);
    border-top-right-radius: 8px; /* Slightly less rounded top-right for user bubble */
}
.chat-message.user .avatar { background-color: var(--primary-color); color: var(--light-text-color); }
.chat-message.bot { align-self: flex-start; }
.chat-message.bot .message-content {
    background-color: var(--chat-bot-bubble-background);
    color: var(--text-color);
    border-top-left-radius: 8px; /* Slightly less rounded top-left for bot bubble */
}
.chat-message.bot .avatar { background-color: var(--border-color); } /* Use border-color for bot avatar for consistency */

.typing-indicator span { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background-color: #6c757d; margin: 0 2px; animation: typing-bounce 1.4s infinite; }
@keyframes typing-bounce { 0%, 80%, 100% { transform: scale(0); } 40% { transform: scale(1.0); } }

.chat-input-container {
    position: fixed;
    bottom: 50px;
    left: 0;
    right: 0;
    z-index: 1001;
    padding: 0 15px;
    background: transparent;
}

.chat-input-form {
    max-width: 800px;
    margin: 0 auto;
}

.chat-input-wrapper {
    display: flex;
    gap: 10px;
    align-items: flex-end;
    background: var(--card-background);
    border: 1px solid var(--border-color);
    border-radius: 30px; /* More rounded */
    padding: 8px 15px; /* Adjusted padding */
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.chat-input-wrapper textarea {
    flex-grow: 1;
    border: none;
    background: transparent;
    padding: 10px 10px; /* Adjusted padding */
    font-size: 1rem;
    font-family: 'Poppins', sans-serif;
    resize: none;
    line-height: 1.5;
    max-height: 125px;
    overflow-y: auto;
    color: var(--text-color); /* Ensure text color changes */
}

.chat-input-wrapper textarea:focus { outline: none; }
.chat-input-wrapper button {
    background-color: var(--accent-color);
    color: white;
    border: none;
    border-radius: 50%;
    width: 48px; /* Slightly larger button */
    height: 48px;
    font-size: 1.6rem; /* Larger icon */
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
    flex-shrink: 0; display: flex; align-items: center; justify-content: center;
}
.chat-input-wrapper button:hover { background-color: var(--primary-hover); transform: scale(1.05); }
.chat-input-wrapper button:disabled { background-color: #a9a9a9; cursor: not-allowed; transform: none; }

.chat-disclaimer {
    position: fixed;
    bottom: 10px;
    left: 0;
    right: 0;
    font-size: 0.75em;
    color: var(--chat-bot-disclaimer-color);
    text-align: center;
    z-index: 1001;
    padding: 0 15px;
}

@media (max-width: 768px) {
    .chat-messages {
        padding-bottom: 180px; /* Adjust as needed */
    }

    .chat-input-container {
        bottom: 70px;
        padding: 0 10px;
    }

    .chat-disclaimer {
        bottom: 5px;
        padding: 0 10px;
    }

    .chat-input-form {
        max-width: calc(100% - 20px);
        margin: 0 auto;
    }

    .chat-input-wrapper {
        max-width: 100%;
        margin: 0 auto;
    }

    .chat-message {
        flex-direction: column !important;
        gap: 10px;
        max-width: 95%;
        align-items: flex-start;
    }

    .chat-message.user {
        flex-direction: column !important;
        align-items: flex-end;
        align-self: flex-end;
    }

    .chat-message.bot {
        flex-direction: column !important;
        align-items: flex-start;
        align-self: flex-start;
    }

    .chat-message .avatar {
        width: 40px;
        height: 40px;
        align-self: flex-start;
    }

    .chat-message.user .avatar {
        align-self: flex-end;
    }

    .chat-message .message-content {
        width: 100%;
        max-width: 100%;
        margin: 0;
    }

    .chat-messages {
        padding: 20px 15px 190px 15px;
        gap: 20px;
    }

    .chat-disclaimer {
        font-size: 0.7em;
        padding: 0 10px;
    }

    .typing-indicator-container {
        width: 100%;
        margin-top: 5px;
    }

    .chat-header {
        padding: 15px 20px;
    }

    .chat-header h1 {
        font-size: 1.3em;
    }
}

.chat-container {
    scroll-behavior: smooth;
    overflow-y: auto;
    position: relative;
}

.chat-messages {
    scroll-behavior: smooth;
    overflow-y: auto;
    position: relative;
}

.chat-message {
    scroll-margin-top: 20px;
    transition: all 0.3s ease;
}

.typing-indicator {
    scroll-margin-top: 20px;
}

.chat-message.sending {
    opacity: 0.7;
    pointer-events: none;
    position: relative;
}

.chat-message.sending::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    animation: shimmer 1.5s infinite;
    border-radius: 20px;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.chat-message.error {
    border-left: 3px solid #e74c3c;
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.typing-indicator-container {
    position: relative;
    padding: 15px 20px;
    background-color: var(--chat-bot-typing-indicator-background); /* Use variable */
    border-radius: 20px;
    border-bottom-left-radius: 8px; /* Match message bubble rounding */
}

.typing-indicator {
    display: flex;
    align-items: center;
    gap: 5px;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #6c757d; /* Keep fixed for indicator visual */
    animation: typing-bounce 1.4s infinite;
}

.typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing-bounce {
    0%, 80%, 100% { transform: scale(0.8); opacity: 0.5; }
    40% { transform: scale(1.2); opacity: 1; }
}

.chat-input-wrapper.processing {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(var(--background-color-rgb), 0.1); /* Use RGB variable */
}

.chat-input-wrapper.processing::after {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    border-radius: 30px;
    background: linear-gradient(90deg, var(--accent-color), var(--primary-color), var(--accent-color));
    background-size: 200% 100%;
    animation: processing-border 2s linear infinite;
    z-index: -1;
}

@keyframes processing-border {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.chat-input-wrapper button.processing {
    background-color: var(--accent-color);
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.connection-status {
    position: fixed;
    top: 80px;
    right: 20px;
    padding: 8px 12px;
    border-radius: 20px;
    font-size: 0.8em;
    font-weight: 500;
    z-index: 1000;
    transition: all 0.3s ease;
    transform: translateX(200px);
}

.connection-status.show {
    transform: translateX(0);
}

.connection-status.connected {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.connection-status.disconnected {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.connection-status.processing {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

/* 15a. CHATBOT SAMPLE QUESTIONS STYLES */
.sample-questions-wrapper {
    position: fixed;
    bottom: 120px; /* Position it right above the chat input area */
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 0 15px;
    pointer-events: none; /* The wrapper itself should not be clickable */
    transition: opacity 0.3s ease, transform 0.3s ease; /* NEW: Add transition */
}

/* NEW: Class to hide the sample questions wrapper */
.sample-questions-wrapper.hidden {
    opacity: 0;
    transform: translateY(20px);
    pointer-events: none;
}

.sample-questions-container {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 10px;
    pointer-events: auto; /* Re-enable pointer events for the children */
}

.sample-questions {
    display: flex;
    gap: 10px;
    flex-grow: 1;
    overflow-x: auto;
    padding: 5px 2px;
    scrollbar-width: none; /* Hide scrollbar for Firefox */
    -ms-overflow-style: none; /* Hide for IE and Edge */
}

.sample-questions::-webkit-scrollbar {
    display: none; /* Hide scrollbar for Chrome/Safari */
}

.sample-question-bubble {
    flex-shrink: 0;
    padding: 8px 15px;
    border-radius: 20px;
    background-color: var(--chat-bot-bubble-background);
    color: var(--text-color);
    border: 1px solid var(--border-color);
    font-size: 0.85em;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s ease-in-out;
    animation: pop-in 0.4s ease-out forwards;
    opacity: 0; /* Start hidden for animation */
}

.sample-question-bubble:hover {
    background-color: var(--accent-color);
    color: var(--light-text-color);
    border-color: var(--accent-color);
    transform: translateY(-2px);
}

#refresh-questions-btn {
    flex-shrink: 0;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    background-color: var(--card-background);
    color: var(--text-color);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1em;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-light);
}

#refresh-questions-btn:hover {
    color: var(--primary-color);
    border-color: var(--primary-color);
    transform: rotate(90deg);
}

#refresh-questions-btn.active {
    transform: rotate(180deg);
}

@keyframes pop-in {
    from {
        opacity: 0;
        transform: scale(0.8) translateY(10px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@media (max-width: 768px) {
    .sample-questions-wrapper {
        bottom: 145px; /* Adjust position for mobile */
        padding: 0 10px;
    }
    .sample-question-bubble {
        font-size: 0.8em;
        padding: 6px 12px;
    }
    #refresh-questions-btn {
        width: 34px;
        height: 34px;
        font-size: 1em;
    }
}


/* 16. CHATBOT MARKDOWN STYLES
---------------------------------------------------- */
.chat-message .message-content h1,
.chat-message .message-content h2,
.chat-message .message-content h3,
.chat-message .message-content h4 {
    margin-top: 1em;
    margin-bottom: 0.5em;
    line-height: 1.3;
    color: var(--primary-color); /* Apply primary color to headings in chatbot */
}
.chat-message .message-content h1 { font-size: 1.25em; }
.chat-message .message-content h2 { font-size: 1.15em; }
.chat-message .message-content h3 { font-size: 1.1em; }

.chat-message .message-content p { margin-bottom: 0.75em; }
.chat-message .message-content > *:last-child { margin-bottom: 0; }
.chat-message .message-content ul,
.chat-message .message-content ol { padding-left: 25px; margin-bottom: 0.75em; }
.chat-message .message-content li { margin-bottom: 0.4em; }
.chat-message .message-content pre {
    background-color: #2b2b2b; /* Keep dark for code blocks */
    color: #f8f9fa; /* Keep light for code blocks */
    padding: 15px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 1em 0;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.9em;
}
.chat-message .message-content p code,
.chat-message .message-content li code {
    background-color: rgba(0, 0, 0, 0.08); /* Light mode specific */
    padding: 3px 6px;
    border-radius: 4px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.9em;
}
/* Dark mode specific for inline code */
[data-theme="dark"] .chat-message .message-content p code,
[data-theme="dark"] .chat-message .message-content li code {
    background-color: rgba(255, 255, 255, 0.15); /* Lighter for dark mode */
}
.chat-message .message-content pre code { background-color: transparent; padding: 0; }

.auth-icon { display: inline-block; text-decoration: none !important; border-bottom: none !important; padding: 5px; transition: transform 0.2s ease; }
.auth-icon:hover { text-decoration: none !important; transform: scale(1.1); }
.auth-icon i { font-size: 1.5rem; color: var(--primary-color); vertical-align: middle; transition: color 0.2s ease; }
.auth-icon:hover i { color: var(--accent-color); }


/* 17. NEW STYLES FOR COURSE PAGE BUTTON
---------------------------------------------------- */
.centered-button-group { text-align: left; margin-top: 30px; }

@media (max-width: 768px) {
    .centered-button-group { text-align: center; }
}

/* 18. NEW STYLES FOR HOME PAGE CTA
---------------------------------------------------- */
.cta-section {
    background: transparent;
    text-align: center;
    padding: 40px 0 0 0;
    margin-bottom: 40px; /* Added spacing */
}
.cta-section .container {
    background: var(--card-background);
    padding: 40px;
    border-radius: 18px; /* More rounded */
    box-shadow: var(--shadow);
}
.cta-section h2 { color: var(--primary-color); font-size: 2.2em; }
.cta-section p { max-width: 600px; margin-left: auto; margin-right: auto; opacity: 0.9; font-size: 1.1em; }
.cta-section .btn {
    background: var(--accent-color);
    color: var(--light-text-color);
    margin-top: 25px; /* Increased spacing */
    border: none;
    padding: 14px 35px; /* Consistent with other buttons */
    border-radius: 12px; /* Consistent with other buttons */
}
.cta-section .btn:hover { background: var(--primary-hover); color: var(--light-text-color); transform: translateY(-3px); }
.button-group-center { display: flex; justify-content: center; }

/* 19. CONTACT PAGE CARD REFINEMENTS
---------------------------------------------------- */

.list-section .contact-info-item {
    background: transparent;
    box-shadow: none;
    padding: 15px 0;
    margin-bottom: 0;
    border-bottom: 1px solid var(--border-color);
}
.list-section .contact-info-item:last-child { border-bottom: none; padding-bottom: 0; }
.list-section .contact-info-item:first-of-type { padding-top: 0; }
.list-section .contact-info-item h4 { color: var(--primary-color); font-size: 1.15em; margin-top: 0; }

/* 20. ADMIN PANEL SPECIFIC STYLES AND RESPONSIVENESS */

/* Global admin page body style to ensure theme applies */
body.admin-page {
    background-color: var(--admin-bg);
    color: var(--admin-text-color);
}

/* Admin Login Page */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
    background-color: var(--admin-bg); /* Use admin background */
}

.login-box {
    background: var(--admin-card-bg);
    padding: 40px;
    border-radius: 12px;
    box-shadow: var(--shadow); /* Use general shadow */
    max-width: 400px;
    width: 100%;
    text-align: center;
}

.login-box h1 {
    color: var(--admin-primary);
    margin-bottom: 30px;
    font-size: 2.2em;
}

.login-box .form-group {
    margin-bottom: 20px;
}

.login-box input[type="password"] {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--admin-border-color);
    border-radius: 8px;
    font-size: 1.1em;
    color: var(--admin-text-color);
    background-color: var(--background-color); /* Matches general input background */
}

.login-box .btn-submit {
    background-color: var(--admin-primary);
    color: var(--light-text-color);
    padding: 12px 25px;
    border: none;
    border-radius: 8px;
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    transition: background-color 0.3s ease;
}
.login-box .btn-submit:hover {
    background-color: var(--primary-hover);
}

.login-box .error {
    color: var(--error-text-light);
    background-color: var(--error-bg-light);
    padding: 10px;
    border-radius: 8px;
    margin-top: 15px;
    font-size: 0.9em;
}

/* Admin Dashboard & General Admin Layout */
.admin-wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background-color: var(--admin-bg);
}

.admin-header {
    background: var(--admin-card-bg);
    padding: 20px 40px;
    border-bottom: 1px solid var(--admin-border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05); /* Use lighter shadow consistent with site header */
    flex-shrink: 0;
}

.admin-header .logo {
    font-size: 1.8em;
    font-weight: 700;
    color: var(--admin-primary);
}

.admin-header .logout-btn,
.admin-header .nav-links a,
.admin-header .dark-mode-toggle { /* ADDED dark-mode-toggle */
    color: var(--admin-accent);
    text-decoration: none;
    font-weight: 600;
    padding: 8px 15px;
    border-radius: 8px;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.admin-header .logout-btn:hover,
.admin-header .nav-links a:hover,
.admin-header .dark-mode-toggle:hover { /* ADDED dark-mode-toggle */
    background-color: rgba(var(--admin-accent-rgb), 0.1); /* Using RGB variable now */
    color: var(--primary-hover); /* Keep consistent with main site hover */
    text-decoration: none;
}

.admin-header .nav-links {
    display: flex;
    gap: 15px;
    align-items: center; /* Align dark mode toggle with links */
}

.admin-content {
    flex-grow: 1;
    padding: 40px;
    display: flex;
    flex-direction: column;
    gap: 30px;
}

/* Dashboard Navigation Cards */
.dashboard-nav {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.nav-card {
    background: var(--admin-primary);
    color: var(--light-text-color);
    padding: 30px;
    border-radius: 12px;
    text-align: center;
    text-decoration: none;
    box-shadow: var(--shadow-light);
    transition: transform 0.2s ease, background-color 0.3s ease, box-shadow 0.3s ease;
}

.nav-card:hover {
    transform: translateY(-5px);
    background: var(--primary-hover);
    box-shadow: var(--shadow);
    text-decoration: none;
}

.nav-card h2 {
    color: var(--light-text-color);
    margin-top: 0;
    font-size: 1.8em;
}

.nav-card p {
    color: var(--light-text-color);
    opacity: 0.9;
    font-size: 1.1em;
    margin-bottom: 0;
}

/* General Content Card Style (used on Dashboard and Edit/Registrations) */
.content-card {
    background: var(--admin-card-bg);
    padding: 30px;
    border-radius: 12px;
    box-shadow: var(--shadow-light);
}

.content-card h2 {
    color: var(--admin-primary);
    margin-top: 0;
    margin-bottom: 20px;
}

/* Dashboard Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.stat-item {
    background: var(--background-color); /* Use general background for lighter items */
    padding: 20px;
    border-radius: 10px;
    border: 1px solid var(--admin-border-color);
    text-align: center;
    box-shadow: inset 0 0 5px rgba(0,0,0,0.05); /* subtle inner shadow */
}

.stat-item .count {
    font-size: 2.5em;
    font-weight: 700;
    color: var(--admin-accent);
    margin-bottom: 5px;
}

.stat-item .label {
    font-size: 1em;
    color: var(--admin-text-color);
    opacity: 0.8;
}

/* General Admin Table Styles */
.admin-table-wrapper {
    overflow-x: auto; /* Allow horizontal scrolling for wide tables on small screens */
    margin-top: 20px;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.admin-table th, .admin-table td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid var(--admin-border-color);
    color: var(--admin-text-color);
}

.admin-table thead th {
    background-color: var(--admin-card-bg); /* Header background for admin tables */
    color: var(--admin-primary);
    font-weight: 600;
    border-bottom: 2px solid var(--admin-primary); /* Stronger bottom border for header */
}

.admin-table tbody tr:nth-child(even) {
    background-color: var(--admin-bg); /* Use admin background for even rows */
}

.admin-table tbody tr:hover {
    background-color: var(--table-hover-row); /* Use general table hover for consistency */
}

/* Table Actions (Edit, Delete, Copy buttons) */
.table-actions {
    white-space: nowrap; /* Prevent buttons from wrapping */
    display: flex;
    gap: 8px;
    justify-content: flex-start; /* Align actions to the left */
}

.btn-action {
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.9em;
    cursor: pointer;
    font-weight: 500;
    background: none;
    border: 1px solid;
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.btn-action.edit {
    color: var(--admin-accent);
    border-color: var(--admin-accent);
}
.btn-action.edit:hover {
    background: var(--admin-accent);
    color: white;
}

.btn-action.delete {
    color: var(--admin-danger);
    border-color: var(--admin-danger);
}
.btn-action.delete:hover {
    background: var(--admin-danger);
    color: white;
}

.btn-action.copy {
    color: var(--text-color); /* Use general text color */
    border-color: var(--border-color); /* Use general border color */
    font-size: 1.1em; /* Make copy icon slightly larger */
    padding: 6px 10px; /* Adjust padding for icon */
}
.btn-action.copy:hover {
    background: var(--border-color);
    color: var(--primary-color);
}
[data-theme="dark"] .btn-action.copy {
    color: var(--text-color);
    border-color: var(--border-color);
}
[data-theme="dark"] .btn-action.copy:hover {
    background: var(--border-color);
    color: var(--light-text-color);
}


/* Admin Edit Page Specifics */
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--admin-border-color);
    padding-bottom: 15px;
    margin-bottom: 20px;
}

.card-header h2 {
    margin: 0;
    color: var(--admin-primary);
}

.header-actions {
    display: flex;
    gap: 10px;
}

.btn-add {
    background-color: var(--admin-success);
    color: white;
    padding: 10px 18px;
    border-radius: 8px;
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease;
}
.btn-add:hover {
    background-color: #218838; /* Darker green for hover */
}

.btn-reorder {
    background-color: #6c757d; /* Gray for default reorder */
    color: white;
    padding: 10px 18px;
    border-radius: 8px;
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease;
}
.btn-reorder:hover {
    background-color: #5a6268;
}
.btn-reorder.active {
    background-color: var(--admin-primary); /* Primary color when active */
}

/* Reordering Functionality Styles */
.drag-handle {
    display: none; /* Hidden by default */
    cursor: grab;
    font-size: 1.2rem;
    color: #b0b0b0; /* Fixed color for visibility */
    padding: 0 10px;
    font-family: 'Arial';
    vertical-align: middle;
}

tbody.reordering .drag-handle {
    display: inline-block; /* Show when reordering */
}

tbody.reordering .table-actions {
    display: none; /* Hide edit/delete during reorder */
}
tbody.reordering tr {
    cursor: grab;
}
tbody.reordering tr:active {
    cursor: grabbing;
}

tr.dragging {
    opacity: 0.6;
    background: var(--table-hover-row); /* Use hover row color for dragging */
}

/* Admin Registrations Page Specifics */
.controls-wrapper {
    display: flex;
    flex-wrap: wrap; /* Allow items to wrap to next line */
    gap: 15px;
    margin-bottom: 25px;
    align-items: center;
}

.controls-wrapper input[type="search"],
.controls-wrapper select {
    padding: 10px 15px;
    border: 1px solid var(--admin-border-color);
    border-radius: 8px;
    font-size: 1em;
    color: var(--admin-text-color);
    background-color: var(--background-color); /* General background for inputs */
    flex-grow: 1; /* Allow them to grow */
    min-width: 150px; /* Minimum width before wrapping */
}

/* Modal Styles (used for both Edit and Registrations) */
.modal {
    display: none; /* Hidden by default */
    position: fixed;
    z-index: 2000; /* High z-index to be on top */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.6); /* Dark semi-transparent backdrop */
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.modal.active {
    display: flex; /* Show when active */
}

.modal-content {
    background: var(--admin-card-bg);
    padding: 30px;
    border-radius: 12px;
    box-shadow: var(--shadow);
    width: 90%;
    max-width: 700px;
    position: relative;
    animation: fadeInModal 0.3s ease-out;
}

@keyframes fadeInModal {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--admin-border-color);
    padding-bottom: 15px;
    margin-bottom: 20px;
}

.modal-header h3 {
    margin: 0;
    color: var(--admin-primary);
    font-size: 1.6em;
}

.close-btn {
    color: var(--text-color); /* Use general text color */
    font-size: 2em;
    font-weight: bold;
    cursor: pointer;
    background: none;
    border: none;
    line-height: 1;
    transition: color 0.3s ease;
}
.close-btn:hover {
    color: var(--primary-hover);
}

.modal-form .form-group {
    margin-bottom: 15px;
}

.modal-form label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--admin-primary);
}

.modal-form input[type="text"],
.modal-form input[type="email"],
.modal-form input[type="tel"],
.modal-form select,
.modal-form textarea {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid var(--admin-border-color);
    border-radius: 8px;
    font-size: 1em;
    color: var(--admin-text-color);
    background-color: var(--background-color); /* General background for inputs */
}

.modal-form textarea {
    min-height: 80px;
    resize: vertical;
}

.modal-form .form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.modal-form .full-width {
    grid-column: 1 / -1;
}

.modal-actions {
    margin-top: 30px;
    text-align: right;
}

.btn-save {
    background: var(--admin-primary);
    color: white;
    padding: 12px 25px;
    border: none;
    border-radius: 8px;
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease;
}
.btn-save:hover {
    background-color: var(--primary-hover);
}

/* User Auth pages (login_user, register_user, verify_otp, profile) */
.auth-container {
    max-width: 500px;
    margin: 60px auto;
    padding: 0 20px; /* Add padding for smaller screens */
}
.auth-form {
    padding: 40px;
    background: var(--card-background);
    border-radius: 12px;
    box-shadow: var(--shadow-light);
    text-align: center; /* Centered text for login/register/verify */
}
.auth-form h1 {
    text-align: center;
    color: var(--primary-color);
    margin-bottom: 25px;
    font-size: 2em;
}
.form-group {
    margin-bottom: 20px;
    text-align: left; /* Align labels/inputs left within form group */
}
.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--primary-color);
}
.form-group input {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 1rem;
    background-color: var(--background-color);
    color: var(--text-color);
}

/* NEW: Styles for password toggle */
.password-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}
.password-wrapper input {
    padding-right: 40px; /* Make space for the icon */
}
.password-toggle-icon {
    position: absolute;
    right: 15px;
    cursor: pointer;
    color: var(--text-color);
    opacity: 0.6;
    transition: opacity 0.2s;
}
.password-toggle-icon:hover {
    opacity: 1;
}
/* END NEW */

/* Specific style for OTP input */
.auth-form #otp {
    font-size: 1.5rem;
    text-align: center;
    letter-spacing: 0.5em;
    font-weight: bold;
}

.btn-submit {
    display: block;
    width: 100%;
    padding: 15px;
    background: var(--accent-color);
    color: var(--light-text-color);
    border: none;
    border-radius: 6px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s;
}
.btn-submit:hover {
    background: var(--primary-hover);
}
.form-link {
    text-align: center;
    margin-top: 20px;
    display: block;
    color: var(--accent-color);
}
.form-link:hover {
    color: var(--primary-hover);
}
#form-status {
    margin-top: 20px;
    padding: 15px;
    border-radius: 6px;
    text-align: center;
    font-weight: 600;
    display: none; /* Hidden by default */
}
#form-status.success {
    background-color: var(--success-bg-light);
    color: var(--success-text-light);
    display: block;
}
#form-status.error {
    background-color: var(--error-bg-light);
    color: var(--error-text-light);
    display: block;
}
/* Info alert for login_user.html */
.info-alert {
    padding: 15px;
    background-color: var(--info-bg-light);
    color: var(--info-text-light);
    border-radius: 6px;
    margin-bottom: 20px;
    text-align: center;
}

/* 20. ADMIN PANEL SPECIFIC STYLES AND RESPONSIVENESS (CONTINUED) */
/* Admin Responsive Styles */
@media (max-width: 992px) {
    .admin-header, .admin-content {
        padding: 20px;
    }
    .dashboard-nav {
        grid-template-columns: 1fr;
    }
    /* Dashboard Nav Card Adjustment */
    .nav-card {
        padding: 20px; /* Reduced padding for mobile */
    }
    .nav-card h2 {
        font-size: 1.5em; /* Slightly smaller heading */
    }
    .nav-card p {
        font-size: 1em; /* Slightly smaller text */
    }

    /* For registrations.html controls */
    .controls-wrapper {
        flex-direction: column;
        align-items: stretch;
    }
    .controls-wrapper input, .controls-wrapper select {
        width: 100%; /* Make search and filters full width */
    }
    .modal-content {
        width: 95%; /* Adjust modal width on smaller screens */
    }
}

@media (max-width: 768px) {
    .admin-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
        padding: 15px 20px;
    }
    .admin-header .nav-links {
        width: 100%;
        justify-content: space-around;
        gap: 5px; /* Adjust gap for very small screens */
    }
    .admin-header .nav-links a,
    .admin-header .logout-btn,
    .admin-header .dark-mode-toggle {
        padding: 6px 10px; /* Smaller padding for header links/buttons on very small screens */
        font-size: 0.9em; /* Smaller font size */
    }

    .admin-content {
        padding: 20px;
    }

    .card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    /* Table transformation for admin tables */
    .admin-table {
        border: none;
        box-shadow: none;
        width: 100%; /* Ensure it takes full width when breaking to card layout */
    }

    .admin-table thead {
        border: none;
        clip: rect(0 0 0 0);
        height: 1px;
        margin: -1px;
        overflow: hidden;
        padding: 0;
        position: absolute;
        width: 1px;
    }

    .admin-table tr {
        display: block;
        margin-bottom: 20px;
        border-radius: 8px; /* Consistent with admin cards */
        background: var(--admin-card-bg);
        border: 1px solid var(--admin-border-color);
        box-shadow: var(--shadow-light); /* Add shadow for card effect */
        padding: 15px; /* Add padding to the "card" */
    }

    .admin-table td {
        border: none;
        border-bottom: 1px solid var(--admin-border-color);
        display: flex; /* Use flex to align label and value */
        justify-content: space-between;
        align-items: center;
        text-align: right;
        padding: 10px 0; /* Adjust padding for stack layout */
        white-space: normal;
    }

    .admin-table td:last-child {
        border-bottom: none;
        padding-bottom: 0;
    }
    .admin-table td:first-child {
        padding-top: 0;
    }

    .admin-table td::before {
        content: attr(data-label);
        float: left; /* Keep the label on the left */
        font-weight: bold;
        color: var(--admin-primary);
        text-transform: uppercase;
        font-size: 0.9em;
        margin-right: 15px; /* Space between label and value */
    }

    /* Hide drag handle when table is in card layout (as reorder won't make sense) */
    .admin-table-wrapper .drag-handle {
        display: none !important;
    }

    /* Ensure actions align properly in card layout */
    .admin-table .table-actions {
        justify-content: flex-end; /* Align buttons to the right */
        padding-top: 15px; /* Add space above buttons */
        border-top: 1px solid var(--admin-border-color); /* Separator for actions */
        margin-top: 10px;
        flex-wrap: wrap; /* Allow action buttons to wrap */
    }
    
    /* Ensure action buttons are always visible in mobile table layout */
    tbody tr .table-actions {
        display: flex !important; /* Override reordering mode display: none */
    }

    /* Reordering specific overrides for mobile */
    tbody.reordering tr {
        cursor: default; /* Disable grab cursor in mobile card view */
    }

    .modal-form .form-grid {
        grid-template-columns: 1fr; /* Stack modal form fields on mobile */
    }
}

/* 21. REGISTRATION FORM STYLES (for templates/register.html)
---------------------------------------------------- */
.registration-form {
    max-width: 800px;
    margin: 40px auto;
    padding: 30px;
    background: var(--card-background);
    border-radius: 12px;
    box-shadow: var(--shadow-light);
}
.registration-form h3 {
    text-align: left; /* Keep headings left-aligned */
    margin-top: 25px; /* Spacing between sections */
    margin-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
    color: var(--primary-color);
}
.registration-form h3:first-of-type {
    margin-top: 0; /* No top margin for the very first heading */
}

.registration-form .form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}
.registration-form .form-group {
    margin-bottom: 20px;
}
.registration-form .full-width {
    grid-column: 1 / -1;
}
.registration-form label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--primary-color);
}
.registration-form input,
.registration-form select,
.registration-form textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-family: 'Poppins', sans-serif;
    font-size: 1rem;
    background-color: var(--background-color);
    color: var(--text-color);
}
.registration-form input:focus,
.registration-form select:focus,
.registration-form textarea:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(var(--accent-color-rgb), 0.25); /* Using RGB for shadow */
}

.registration-form textarea {
    min-height: 120px;
    resize: vertical;
}
.registration-form .btn-submit {
    display: inline-block;
    width: 100%;
    padding: 15px;
    background: var(--accent-color);
    color: var(--light-text-color);
    border: none;
    border-radius: 6px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}
.registration-form .btn-submit:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
}
.registration-form .btn-submit:disabled {
    background-color: #a9a9a9;
    cursor: not-allowed;
    transform: none;
}

#form-status {
    margin-top: 20px;
    padding: 15px;
    border-radius: 6px;
    text-align: center;
    font-weight: 600;
    display: none;
}
#form-status.success {
    background-color: var(--success-bg-light);
    color: var(--success-text-light);
    display: block;
}
#form-status.error {
    background-color: var(--error-bg-light);
    color: var(--error-text-light);
    display: block;
}

@media(max-width: 600px) {
    .registration-form {
        padding: 20px; /* Adjust padding for smaller screens */
        margin: 20px auto; /* Adjust margin */
    }
    .registration-form .form-grid {
        grid-template-columns: 1fr; /* Stack fields on mobile */
        gap: 15px; /* Slightly reduce gap on mobile */
    }
}

/* 22. LMS PAGE STYLES (UPDATED)
---------------------------------------------------- */
.lms-feature-image-container {
    margin: 30px 0;
    text-align: center;
}

.lms-feature-image {
    max-width: 80%;
    height: auto;
    border-radius: 15px;
    box-shadow: var(--shadow);
    border: 7px solid var(--border-color);
}

/* Grid for the three access buttons */
.lms-access-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    align-items: center;
    justify-content: center;
    padding-top: 30px;
    border-top: 1px solid var(--border-color);
    margin-top: 30px;
}

.lms-access-item {
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Common style for app store badge links */
.btn-app-store, .btn-google-play {
    display: inline-block;
    text-decoration: none;
    transition: transform 0.2s ease;
}

.btn-app-store:hover, .btn-google-play:hover {
    transform: scale(1.05);
    text-decoration: none;
}

/* Specific badge image styles */
.btn-app-store img {
    height: 62px; /* Slightly smaller for balance */
    width: auto;
}

.btn-google-play img {
    height: 60px; /* Standard height for the Google Play badge */
    width: auto;
}

/* (RE-STYLED) Custom button for the web portal to match the badges */
.btn-lms-web {
    background-color: #000000; /* Black background to match badges */
    color: #FFFFFF; /* White text */
    border: 1px solid #aea6a6; /* Subtle border to match */
    height: 65px;
    width: 90%;
    max-width: 200px; /* Control max width on desktop */
    border-radius: 8px; /* Rounded corners to match */
    padding: 0 10px; /* Horizontal padding */
    font-weight: 900;
    font-size: 1.05rem;
    text-decoration: none;
    
    /* Flexbox to align icon and text */
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-right: 0px;
    
    transition: transform 0.2s ease, background-color 0.2s ease;
}

.btn-lms-web i {
    font-size: 1.4rem; /* Icon size */
}

.btn-lms-web:hover {
    background-color: #333; /* Slightly lighter black on hover */
    transform: scale(1.05);
    text-decoration: none;
    color: #FFFFFF;
}

/* (ENHANCED) Responsive adjustments for the grid and page */
@media (max-width: 768px) {
    /* Make image wider on mobile */
    .lms-feature-image {
        max-width: 95%;
    }

    /* Stack the buttons on mobile */
    .lms-access-grid {
        grid-template-columns: 1fr; 
        gap: 15px;
    }

    /* Ensure all buttons take appropriate space */
    .lms-access-item {
        width: 100%;
        max-width: 300px; /* Control max width of badges on mobile */
        margin: 0 auto;
    }

    .btn-lms-web {
        max-width: 184px; 
        height: 59px;
        width: 100%;
        border-radius: 8px; /* Rounded corners to match */
        padding: 0 0px; /* Horizontal padding */
        font-weight: 600;
        font-size: 1.05rem;
    }
    
    .btn-google-play img {
        height: 54px; /* Standard height for the Google Play badge */
        width: auto;
    }

}

/* 23. PROFILE PAGE SPECIFIC BUTTON STYLES
---------------------------------------------------- */

/* This targets ONLY the button group on the profile page */
.profile-action-buttons {
    display: flex;
    gap: 15px;
}

/* This targets ONLY the buttons inside that specific group */
.profile-action-buttons .btn {
    flex: 1; /* On desktop, makes width equal. On mobile, makes height equal. */
    
    /* --- NEW: These lines normalize the buttons and center their text --- */
    display: flex;           /* Make the button a flex container itself */
    align-items: center;     /* Vertically center the text inside */
    justify-content: center; /* Horizontally center the text inside */
}

/* Mobile Optimizations */
@media (max-width: 600px) {
    .profile-action-buttons {
        /* Stacks the buttons vertically */
        flex-direction: column; 
    }
}