/* Global Design System */
:root {
    --bg-pure: #000000;
    --bg-card: #0a0a0a;
    --bg-sidebar: #050505;
    --border-main: #ffffff;
    --border-subtle: #333333;
    --text-main: #ffffff;
    --text-dim: #a0a0a0;
    --accent-blue: #0070f3;
    /* Premium Blue */
    --hover-bg: #111111;
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Body & Root */
body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    margin: 0;
    display: flex;
    justify-content: center;
    min-height: 100vh;
    background: var(--bg-pure);
    color: var(--text-main);
    overflow-x: hidden;
}

/* Auth Container */
#auth-container {
    background: var(--bg-card);
    padding: 40px;
    border-radius: 0;
    /* Sharp minimalist look */
    border: 1px solid var(--border-main);
    box-shadow: 0 0 30px rgba(255, 255, 255, 0.05);
    width: 100%;
    max-width: 400px;
    margin-top: 80px;
    height: fit-content;
    text-align: center;
}

h2,
h3 {
    margin-top: 0;
    color: var(--text-main);
    font-weight: 700;
    letter-spacing: -0.02em;
}

/* Dashboard Layout */
#learner-dashboard {
    width: 100%;
    max-width: 1400px;
    margin: 20px;
    background: var(--bg-pure);
    border: 1px solid var(--border-main);
    overflow: hidden;
    height: calc(100vh - 40px);
    display: flex;
    flex-direction: column;
}

.dashboard-wrapper {
    display: flex;
    width: 100%;
    height: 100%;
}

/* Sidebar */
.sidebar {
    width: 280px;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border-main);
    display: flex;
    flex-direction: column;
    padding: 30px;
    box-sizing: border-box;
    position: relative;
    /* For popup positioning */
}

.sidebar h2 {
    font-size: 1.5rem;
    color: var(--text-main);
    margin-bottom: 40px;
    text-transform: uppercase;
    letter-spacing: 4px;
}

.sidebar-subjects {
    flex: 1;
    overflow-y: scroll;
    /* Loopable scroll */
    margin-bottom: 20px;
    -ms-overflow-style: none;
    /* IE and Edge */
    scrollbar-width: none;
    /* Firefox */
}


.sidebar-subjects-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.add-subj-btn-mini {
    background: transparent;
    border: 1px solid var(--border-subtle);
    color: var(--text-main);
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    font-size: 1.2rem;
    padding: 0;
    line-height: 1;
}

.add-subj-btn-mini:hover {
    border-color: var(--accent-blue);
    transform: scale(1.1);
}

.sidebar-subjects::-webkit-scrollbar {
    display: none;
    /* Chrome, Safari and Opera */
}


.sidebar-subjects li {
    background: transparent;
    margin: 10px 0;
    padding: 0;
    /* Remove padding from LI, handled by button */
    border: none;
    list-style: none;
}

.sidebar-subject-btn {
    width: 100%;
    background: transparent;
    border: 1px solid var(--border-subtle);
    color: var(--text-dim);
    padding: 16px;
    text-align: left;
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.sidebar-subject-btn:hover {
    border-color: var(--border-main);
    color: var(--text-main);
}


/* Main Dashboard Area */
.main-dashboard {
    flex: 1;
    background: var(--bg-pure);
    padding: 40px;
    overflow-y: auto;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
}

.main-dashboard.chat-active {
    padding: 0;
    overflow: hidden;
}

.top-row {
    display: grid;
    grid-template-columns: 1fr 2fr;
    /* Profile is 1/3 of the width */
    gap: 20px;
    margin-bottom: 30px;
}

/* Profile Card */
.profile-card-new {
    background: var(--bg-card);
    border: 1px solid var(--border-main);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 20px;
}

.profile-img-container {
    width: 180px;
    /* Wider/Square */
    height: 180px;
    border: 1px solid var(--border-main);
    overflow: hidden;
    flex-shrink: 0;
    position: relative;
    cursor: pointer;
}

.profile-img-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: grayscale(100%);
    /* Monochrome aesthetic */
}

.profile-initials {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4rem;
    font-weight: 700;
    color: var(--text-dim);
    background: var(--bg-card);
    text-transform: uppercase;
}

.profile-img-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    opacity: 0;
    transition: var(--transition);
}

.profile-img-container:hover .profile-img-overlay {
    opacity: 1;
}

.profile-info h1 {
    color: var(--text-main);
    font-size: 2rem;
    margin: 0 0 10px 0;
}

.profile-info p {
    color: var(--text-dim);
    margin: 4px 0;
    font-size: 1rem;
}

.profile-quote {
    font-size: 0.5rem;
    font-style: italic;
    color: var(--text-dim);
    margin-top: 15px;
    border-left: 2px solid var(--border-subtle);
    padding-left: 10px;
}

/* Grid of Mini Cards */
.sub-cards-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(2, 1fr);
    gap: 15px;
}

.sub-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    padding: 15px;
    align-items: flex-start;
    justify-content: space-between;
    transition: var(--transition);
    min-height: 120px;
}

.card-subject {
    color: var(--text-main);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.card-advice {
    color: var(--text-dim);
    font-size: 0.65rem;
    line-height: 1.4;
    margin: 8px 0;
}

.card-score {
    align-self: flex-end;
    font-weight: 900;
    font-size: 1.2rem;
    color: var(--text-main);
}

.card-score.critical {
    color: #ff4d4d;
    /* Subtle red exception for critical alert */
}


/* Bottom Visuals */
.bottom-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.stats-card {
    background: var(--bg-card);
    border: 1px solid var(--border-main);
    padding: 30px;
}

/* Progress Chart */
.chart-bars {
    display: flex;
    align-items: flex-end;
    justify-content: space-around;
    height: 160px;
    border-bottom: 1px solid var(--border-subtle);
}

.bar {
    width: 30px;
    background: var(--border-subtle);
    transition: var(--transition);
}

.bar:hover {
    background: var(--text-main);
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.2);
}

/* Auth Element Overrides */
.role-selector {
    display: flex;
    border: 1px solid var(--border-main);
    padding: 2px;
    margin-bottom: 25px;
}

.role-btn {
    flex: 1;
    background: transparent;
    border: none;
    padding: 10px;
    color: var(--text-dim);
    cursor: pointer;
    font-weight: 600;
    transition: var(--transition);
}

.role-btn.active {
    background: var(--text-main);
    color: var(--bg-pure);
}

input,
select {
    width: 100%;
    padding: 14px;
    margin: 10px 0;
    background: var(--bg-pure);
    color: var(--text-main);
    border: 1px solid var(--border-subtle);
    border-radius: 0;
    box-sizing: border-box;
    transition: var(--transition);
}

input:focus,
select:focus {
    border-color: var(--border-main);
    outline: none;
}

/* Buttons */
.primary-btn,
.logout-btn {
    background: var(--bg-pure);
    color: var(--text-main);
    border: 1px solid var(--border-main);
    padding: 14px 24px;
    cursor: pointer;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    transition: var(--transition);
}

.primary-btn:hover,
.logout-btn:hover {
    border-color: var(--accent-blue) !important;
    /* Blue border on hover */
    color: var(--text-main);
}

.logout-btn {
    margin-top: auto;
    border-color: var(--border-subtle);
}

.form-group label {
    display: block;
    margin-bottom: 10px;
    font-weight: 700;
    color: var(--text-main);
    font-size: 0.8rem;
    text-transform: uppercase;
}

a {
    color: var(--text-main);
    text-decoration: underline;
    font-weight: 600;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg-pure);
}

::-webkit-scrollbar-thumb {
    background: var(--border-subtle);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--border-main);
}

/* Subject Portal & ATP Styles */
.portal-header h1 {
    font-size: 2.5rem;
    margin: 10px 0;
    letter-spacing: -1px;
}

.atp-list {
    margin-top: 25px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.atp-item {
    border-bottom: 1px solid var(--border-subtle);
    padding: 15px 0;
    display: flex;
    gap: 30px;
    align-items: flex-start;
}

.atp-item:last-child {
    border-bottom: none;
}

.term {
    min-width: 80px;
    font-weight: 900;
    text-transform: uppercase;
    font-size: 0.75rem;
    color: var(--text-main);
    border: 1px solid var(--border-main);
    padding: 4px 8px;
    text-align: center;
}

.atp-item p {
    margin: 0;
    font-size: 0.9rem;
    color: var(--text-dim);
    line-height: 1.5;
}

.sidebar-subject-btn.active {
    border-color: var(--accent-blue);
    color: var(--text-main);
    background: var(--bg-card);
    box-shadow: inset 0 0 10px rgba(0, 112, 243, 0.1);
}

/* Topic Portal & AI Chat Styles */
.lesson-history-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.lesson-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.lesson-card h4 {
    margin: 0;
    font-size: 1rem;
}

.chat-room {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--bg-pure);
    position: relative;
    /* Anchor for absolute input */
    overflow: hidden;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    padding-bottom: 80px;
    /* Space for the pinned input footer */
    display: flex;
    flex-direction: column;
    gap: 12px;
    scrollbar-width: thin;
}

.message {
    max-width: 80%;
    padding: 10px 14px;
    font-size: 0.9rem;
    line-height: 1.4;
    position: relative;
    border-radius: 12px;
    margin-bottom: 8px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.message.ai {
    align-self: flex-start;
    background: #1f1c1c;
    border: 1px solid #333;
    color: #fff;
    border-top-left-radius: 2px;
    /* WhatsApp-style tail */
}

.message.user {
    align-self: flex-end;
    background: #ffffff;
    color: #000;
    font-weight: 500;
    border-top-right-radius: 2px;
    /* WhatsApp-style tail */
}

.chat-input-area {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 10px 15px;
    display: flex;
    gap: 10px;
    background: rgba(5, 5, 5, 0.95);
    /* Semi-transparent base */
    backdrop-filter: blur(10px);
    /* Glassmorphism effect */
    align-items: center;
    border-top: 1px solid var(--border-subtle);
    box-sizing: border-box;
    z-index: 10;
}

.img-preview-area {
    position: absolute;
    bottom: 85px;
    /* Sit right above the input area */
    left: 20px;
    right: 20px;
    display: flex;
    gap: 10px;
    padding: 10px;
    background: rgba(10, 10, 10, 0.95);
    border: 1px solid var(--border-subtle);
    z-index: 11;
}

.chat-input {
    flex: 1;
    margin: 0 !important;
    border-radius: 20px !important;
    padding: 10px 18px !important;
    background: #121212;
    border: 1px solid #333 !important;
    color: #fff;
    min-height: 40px;
}

.chat-tool-btn {
    background: transparent;
    border: 1px solid var(--border-subtle);
    color: var(--text-main);
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
}

.chat-tool-btn:hover {
    border-color: var(--accent-blue);
    background: rgba(255, 255, 255, 0.05);
}

.chat-tool-btn.listening {
    border-color: #ff4d4d;
    background: rgba(255, 77, 77, 0.1);
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(255, 77, 77, 0.4);
    }

    70% {
        transform: scale(1.05);
        box-shadow: 0 0 0 10px rgba(255, 77, 77, 0);
    }

    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(255, 77, 77, 0);
    }
}

.img-preview-area {
    display: flex;
    gap: 10px;
    padding: 10px 15px;
    background: var(--bg-sidebar);
    border-top: 1px solid var(--border-subtle);
}

.preview-thumb {
    width: 60px;
    height: 60px;
    border: 1px solid var(--border-main);
    position: relative;
}

.preview-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.remove-preview {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ff4d4d;
    color: white;
    border-radius: 50%;
    width: 16px;
    height: 16px;
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: none;
}

.chat-send-btn {
    background: #fff;
    color: #000;
    border: none;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
}

/* SVG icon styling for chat buttons */
.chat-tool-btn svg,
.chat-send-btn svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.chat-tool-btn svg {
    stroke: currentColor;
}

.chat-send-btn svg {
    fill: currentColor;
}

/* Assessment UI */
.assessment-view {
    padding: 30px;
}

.question-box {
    margin-bottom: 25px;
    padding: 20px;
    border-left: 3px solid var(--border-main);
    background: rgba(255, 255, 255, 0.02);
}

.upload-zone {
    border: 2px dashed var(--border-subtle);
    padding: 40px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    border-radius: 8px;
}

.upload-zone:hover {
    border-color: var(--accent-blue);
    background: rgba(0, 112, 243, 0.05);
}

.upload-zone svg {
    opacity: 0.5;
}

/* Code Blocks in Chat */
.code-block {
    background: #1a1a1a;
    border: 1px solid var(--border-subtle);
    border-radius: 6px;
    padding: 15px;
    margin: 10px 0;
    overflow-x: auto;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.85rem;
    line-height: 1.5;
}

.inline-code {
    background: rgba(255, 255, 255, 0.1);
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.9em;
}

/* Math Equation Styling */
.katex-display {
    margin: 15px 0;
    overflow-x: auto;
}

.katex {
    font-size: 1.1em;
}

/* ========================================
   POPUP & MODAL SYSTEM
   ======================================== */

/* Overlay backdrop for modals */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
    z-index: 4000;
    justify-content: center;
    align-items: center;
}

.modal-overlay.active {
    display: flex;
}

/* Centered Modal (for Add Topic) */
.modal-content {
    background: var(--bg-card);
    border: 1px solid var(--border-main);
    padding: 30px;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    overflow-y: auto;
    animation: modalSlideIn 0.25s ease-out;
}

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

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.modal-header h3 {
    margin: 0;
}

.modal-close-btn {
    background: transparent;
    border: 1px solid var(--border-subtle);
    color: var(--text-main);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.2rem;
    transition: var(--transition);
}

.modal-close-btn:hover {
    border-color: #ff4d4d;
    color: #ff4d4d;
}

/* Sidebar Popup (for Add Subject on Desktop) */
.sidebar-popup {
    display: none;
    position: absolute;
    bottom: 70px;
    left: 10px;
    right: 10px;
    background: var(--bg-card);
    border: 1px solid var(--border-main);
    padding: 20px;
    z-index: 100;
    animation: popupSlideUp 0.2s ease-out;
}

.sidebar-popup.active {
    display: block;
}

@keyframes popupSlideUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.sidebar-popup h4 {
    margin: 0 0 15px 0;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Footer Popup (for Add Subject on Mobile) */
.footer-popup {
    display: none;
    position: fixed;
    bottom: 60px;
    left: 0;
    right: 0;
    background: var(--bg-card);
    border-top: 1px solid var(--border-main);
    padding: 20px;
    z-index: 2500;
    animation: popupSlideUp 0.2s ease-out;
}

.footer-popup.active {
    display: block;
}

.footer-popup h4 {
    margin: 0 0 15px 0;
    font-size: 0.9rem;
}

.popup-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.popup-actions button {
    flex: 1;
    padding: 12px;
    font-size: 0.75rem;
}

/* Base states for mobile elements (Hidden on Desktop) */
.mobile-header,
.mobile-footer {
    display: none;
}

/* --- Mobile Responsiveness (max-width: 768px) --- */
@media (max-width: 768px) {
    body {
        flex-direction: column;
        overflow-x: hidden;
    }

    /* Auth Screens */
    #auth-container {
        margin: 40px auto;
        max-width: 90%;
        padding: 30px 20px;
    }

    /* Dashboard Shell */
    #learner-dashboard {
        margin: 0;
        height: 100vh !important;
        border: none;
        max-width: 100%;
        display: flex !important;
        flex-direction: column;
        overflow: hidden !important;
        /* Lock body scroll */
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
    }

    .dashboard-wrapper {
        flex-direction: column;
        padding-top: 35px !important;
        /* Narrower header space */
        padding-bottom: 35px !important;
        /* Narrower footer space */
        height: auto !important;
        min-height: calc(100vh - 125px);
    }

    .dashboard-wrapper:has(.chat-active),
    .main-dashboard.chat-active~.dashboard-wrapper {
        padding-top: 0 !important;
        padding-bottom: 0 !important;
    }

    .sidebar {
        display: none !important;
    }

    .main-dashboard {
        padding: 20px;
        flex: 1;
        overflow-y: auto;
    }

    .main-dashboard.chat-active {
        padding: 0;
        overflow: hidden;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 3000;
    }

    /* Mobile Header & Footer */
    .mobile-header {
        display: flex !important;
        justify-content: space-between;
        align-items: center;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 35px;
        /* Narrower */
        background: var(--bg-sidebar);
        padding: 0 10px;
        border-bottom: 1px solid var(--border-main);
        z-index: 2000;
        box-sizing: border-box;
    }

    .mobile-header h2 {
        font-size: 1rem;
        margin: 0;
        letter-spacing: 2px;
    }

    .logout-btn-mini {
        background: transparent;
        border: 1px solid var(--border-subtle);
        color: var(--text-dim);
        padding: 6px 12px;
        font-size: 0.7rem;
        text-transform: uppercase;
        cursor: pointer;
    }

    .mobile-footer {
        display: flex !important;
        align-items: center;
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        height: 35px;
        /* Narrower */
        background: var(--bg-sidebar);
        border-top: 1px solid var(--border-main);
        z-index: 2000;
        padding: 0 10px;
        gap: 15px;
        box-sizing: border-box;
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .mobile-footer.hidden {
        transform: translateY(100%);
        pointer-events: none;
    }

    .mobile-subjects-bar {
        flex: 1;
        overflow-x: scroll;
        white-space: nowrap;
        -ms-overflow-style: none;
        scrollbar-width: none;
    }

    .mobile-subjects-bar::-webkit-scrollbar {
        display: none;
    }

    .mobile-subjects-bar ul {
        display: flex;
        padding: 0;
        margin: 0;
        list-style: none;
        gap: 10px;
        height: 100%;
        align-items: center;
    }

    .mobile-subjects-bar li {
        flex-shrink: 0;
    }

    .mobile-subjects-bar .sidebar-subject-btn {
        width: auto;
        padding: 10px 15px;
        font-size: 0.7rem;
    }

    /* Dashboard Content Grid Adjustments */
    .top-row {
        grid-template-columns: 1fr !important;
        gap: 20px;
    }

    .profile-card-new {
        flex-direction: column !important;
        text-align: center;
        padding: 30px 20px;
    }

    .profile-img-container {
        width: 150px;
        height: 150px;
    }

    .profile-info h1 {
        font-size: 1.5rem;
    }

    .sub-cards-grid {
        grid-template-columns: 1fr 1fr !important;
        gap: 10px;
    }

    .sub-card {
        min-height: 100px;
        padding: 10px;
    }

    .card-score {
        font-size: 1rem;
    }

    .bottom-grid {
        grid-template-columns: 1fr !important;
    }

    /* Portal & Lesson Adjustments */
    .portal-header h1 {
        font-size: 1.8rem;
    }

    .atp-item {
        flex-direction: column !important;
        gap: 10px;
    }

    .term {
        width: 100%;
        box-sizing: border-box;
    }

    .chat-room {
        height: calc(100vh - 250px);
    }

    .lesson-history-grid {
        grid-template-columns: 1fr !important;
    }
}

.chat-header-whatsapp {
    display: flex;
    align-items: center;
    background: var(--bg-sidebar);
    padding: 0 10px;
    border-bottom: 1px solid var(--border-subtle);
    gap: 2px;
    height: 45px;
    /* Compact but holds info */
    box-sizing: border-box;
}

.chat-back-btn {
    background: transparent;
    border: none;
    color: var(--text-main);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.chat-profile {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}

.chat-avatar {
    width: 32px;
    height: 32px;
    background: var(--border-main);
    color: var(--bg-pure);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.8rem;
}

.chat-name-info h4 {
    margin: 0;
    font-size: 0.95rem;
    color: var(--text-main);
}

.chat-name-info span {
    font-size: 0.6rem;
    color: #00ffff;
}

/* Ensure full screen on mobile for chat */
@media (max-width: 768px) {
    .chat-room {
        height: 100%;
        width: 100%;
    }

    .chat-messages {
        height: 100%;
        padding-bottom: 70px;
        /* Reduced clearance for fixed footer */
    }

    .chat-input-area {
        position: fixed;
        /* Fixed to viewport bottom on mobile */
        bottom: 0;
        left: 0;
        /*padding-bottom: env(safe-area-inset-bottom, 15px);*/
        /* Support modern notches */
    }

    .chat-header-whatsapp {
        height: 45px;
        /* Taller for better info display */
    }
}