﻿/* =========================================================
   🎨 COLOR VARIABLES & THEMES
   ========================================================= */
:root {
    --bg-color: #ffffff;
    --text-color: #000000;
    --link-color: #0d6efd;
    /* Brand */
    --mat-primary: #0d6efd;
    --mat-primary-dark: #0056d2;
    /* Buttons */
    --btn-secondary: #6c757d;
    --btn-secondary-dark: #5a6268;
    --btn-success: #28a745;
    --btn-success-dark: #1e7e34;
    --btn-danger: #dc3545;
    --btn-danger-dark: #b02a37;
    --btn-warning: #ffc107;
    --btn-warning-dark: #e0a800;
    /* General */
    --bassoft-red: #b30000;
    --bassoft-gray: #f8f8f8;
    --bassoft-dark-bg: #1e1e1e;
    --bassoft-dark-card: #2b2b2b;
}

/* =========================================================
   🌙 DARK THEME
   ========================================================= */

.narrow-form {
    max-width: 500px;
    margin: 0 auto;
}


.dark-theme {
    --bg-color: #121212;
    --text-color: #f0f0f0;
    --link-color: #66b0ff;
    background: var(--bassoft-dark-bg) !important;
    color: var(--text-color) !important;
}

    .dark-theme .content-area {
        background: var(--bassoft-dark-card);
    }

    .dark-theme .navbar {
        background: var(--bassoft-dark-bg) !important;
        border-color: #333333;
    }

    .dark-theme footer {
        background: #222222;
        color: #bbbbbb;
    }

/* =========================================================
   🌐 BASE LAYOUT
   ========================================================= */
html {
    font-size: 13px;
    scroll-behavior: smooth;
}

@media (min-width: 768px) {
    html {
        font-size: 15px;
    }
}

@media (min-width: 992px) {
    html {
        font-size: 16px;
    }
}

@media (min-width: 1200px) {
    html {
        font-size: 17px;
    }
}

body {
    margin: 0;
    padding: 0;
    background: var(--bg-color);
    color: var(--text-color);
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.4;
    font-size: 1.05rem;
}

/* =========================================================
   📦 CONTAINERS
   ========================================================= */
.container,
.container-fluid {
    padding-top: 0 !important;
}

/* Main page column – keeps cards & QR aligned */
.content-wrapper {
    max-width: 900px;
    width: 100%;
    margin: 0 auto;
    padding: 0.6rem;
    min-height: 70vh;
    background-color: transparent !important;
}

.content-area {
    background: transparent;
    padding: 1rem;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

/* =========================================================
   🅰️ TYPOGRAPHY
   ========================================================= */
h1,
h2,
h3,
h4,
h5,
h6,
p,
label,
li {
    margin: 0.2rem 0;
    line-height: 1.5;
    font-size: 0.95rem;
}

.page-title,
.signin-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--mat-primary);
    margin-bottom: 0.2rem;
    text-align: center;
}

.page-subtitle {
    text-align: center;
    font-size: 1.2rem;
    color: #000000;
    margin-bottom: 1rem;
    font-weight: 600;
}

/* =========================================================
   💠 SECTION HEADERS
   ========================================================= */
.mat-header {
    background: lightgray;
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px solid #cfdfff;
    transition: background-color 0.2s ease-in-out;
}

    .mat-header:hover {
        background: #d9ebff;
    }

/* =========================================================
   🧭 NAVBAR
   ========================================================= */
.navbar {
    background: #ffffff !important;
    border-bottom: 1px solid #dddddd;
    padding: 6px 0 !important;
}

.navbar-center {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 10px;
    text-align: center;
}

    .navbar-center img {
        height: 34px;
    }

.navbar-user-info {
    font-style: italic;
    font-size: 0.9rem;
    color: #666666;
}

/* =========================================================
   🧭 Scroll
   ========================================================= */

.scroll-box {
    max-height: 250px; /* adjust height */
    overflow-y: auto; /* vertical scroll only */
    overflow-x: hidden; /* prevent sideways scrolling */
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: #fafafa;
}

    /* smooth scrolling */
    .scroll-box::-webkit-scrollbar {
        width: 6px;
    }

    .scroll-box::-webkit-scrollbar-thumb {
        background: #c7c7c7;
        border-radius: 3px;
    }

        .scroll-box::-webkit-scrollbar-thumb:hover {
            background: #999;
        }



/* =========================================================
   🔘 NAV BUTTONS
   ========================================================= */
.nav-btn,
.support-btn {
    color: var(--bassoft-red) !important;
    border: 1.5px solid var(--bassoft-red) !important;
    background: transparent !important;
    font-weight: 600;
    font-size: 0.9rem !important;
    border-radius: 6px;
    transition: all 0.25s ease-in-out;
    text-decoration: none !important;
}

    .nav-btn:hover,
    .support-btn:hover {
        color: #ffffff !important;
        background: var(--bassoft-red) !important;
        box-shadow: 0 0 6px rgba(179, 0, 0, 0.4);
    }

.support-btn {
    width: 34px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}

/* =========================================================
   🔗 LINKS
   ========================================================= */
a {
    color: var(--link-color);
}

    a:hover {
        color: var(--mat-primary-dark);
    }

    a.btn,
    .top-action-bar a,
    .connection-actions a {
        text-decoration: none !important;
    }

    /* =========================================================
   🔘 GLOBAL BUTTONS
   ========================================================= */
    button,
    .btn,
    a.btn {
        font-weight: 600;
        font-size: 0.9rem;
        border: none;
        border-radius: 6px;
        padding: 0.4rem 1rem;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
        transition: all 0.2s ease-in-out;
        cursor: pointer;
    }

        .btn i {
            margin-right: 6px;
            font-size: 0.9rem;
        }

.btn-primary,
.btn-mat-primary {
    background: var(--mat-primary);
    color: #ffffff !important;
    padding: 0.35rem 0.9rem !important;
    font-size: 0.85rem !important;
    display: inline-flex; /* NEW */
    align-items: center; /* NEW → vertically center text */
    justify-content: center; /* NEW → horizontally center text */
}

    .btn-primary:hover,
    .btn-mat-primary:hover {
        background: var(--mat-primary-dark);
    }

/* Button variants */
.btn-secondary {
    background: var(--btn-secondary);
    color: #ffffff !important;
}

    .btn-secondary:hover {
        background: var(--btn-secondary-dark);
    }

.btn-success {
    background: var(--btn-success);
    color: #ffffff !important;
}

    .btn-success:hover {
        background: var(--btn-success-dark);
    }

.btn-danger {
    background: var(--btn-danger);
    color: #ffffff !important;
}

    .btn-danger:hover {
        background: var(--btn-danger-dark);
    }

.btn-warning {
    background: var(--btn-warning);
    color: #000000 !important;
}

    .btn-warning:hover {
        background: var(--btn-warning-dark);
    }

/* Compact Add/Remove buttons */
.btn-action,
.btn-mat-primary,
.btn-mat-secondary {
    padding: 3px 10px !important;
    font-size: 0.80rem !important;
}

/* Small action buttons in connection list */
.btn-action {
    padding: 6px 14px;
    font-size: 0.85rem;
    border-radius: 6px;
    color: #fff !important;
    margin-right: 6px;
    display: inline-flex; /* keeps icon + text aligned */
    align-items: center; /* vertically centers content */
    justify-content: center; /* horizontally centers content */
    font-weight: 600; /* matches other buttons */
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    cursor: pointer;
    white-space: nowrap; /* prevents wrapping */
    text-decoration: none !important;
}

    .btn-action:hover,
    .btn-action:focus {
        text-decoration: none !important;
    }

.btn-delete {
    background: #e53935;
}

    .btn-delete:hover {
        background: #b71c1c;
    }

/* Disable the global "Processing..." text for specific buttons */
.no-processing:disabled::after {
    content: "" !important;
}


/* Container for action buttons (horizontal scroll if overflow) */
.connection-actions {
    margin-top: 10px;
    display: flex;
    gap: 2px;
    overflow-x: auto;
    white-space: nowrap;
    padding-bottom: 4px;
    scrollbar-width: thin; /* Firefox */
}

    .connection-actions::-webkit-scrollbar {
        height: 6px;
    }

    .connection-actions::-webkit-scrollbar-thumb {
        background: #bbbbbb;
        border-radius: 3px;
    }

/* =========================================================
   📋 TABLES
   ========================================================= */
.table {
    border-collapse: collapse;
    display: block;
    overflow-x: auto;
    white-space: nowrap;
    font-size: 0.85rem;
}

    .table td,
    .table th {
        padding: 0.10rem 0.5rem;
        font-size: 1rem;
    }

/* =========================================================
   SUPER COMPACT FLEX FILTER BAR (NO GRID, ZERO COLUMNS)
========================================================= */

.filter-bar {
    background: lightgray;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 0.6rem 0.8rem;
    display: flex;
    flex-wrap: wrap; /* free-flow layout */
    gap: 0.5rem 0.8rem; /* compact spacing */
    align-items: flex-end;
    overflow-x: auto; /* enable scroll when needed */
    white-space: nowrap;
}

/* Each label + dropdown block */

/* All form labels */
.form-label,
.filter-item label {
    font-size: 1rem;
    font-weight: 500;
    margin-bottom: 2px;
    white-space: nowrap;
}

/* Filter item container */
.filter-item {
    display: flex;
    flex-direction: column;
    white-space: normal;
    margin-right: 0.4rem;
}

/* Auto width dropdowns */
.filter-bar select.form-select,
.filter-bar select.form-select-sm {
    width: auto !important;
    min-width: 110px;
    max-width: 200px;
    padding-right: 1.4rem;
    white-space: nowrap;
}

/* Search button, aligns cleanly */
.btn-search-wide {
    padding: 0.4rem 1rem !important;
    font-size: 0.85rem !important;
    align-self: center;
    white-space: nowrap;
}


/* =========================================================
   🎨 TOP ACTION BAR
   ========================================================= */
.top-action-bar {
    display: flex;
    flex-wrap: nowrap;
    justify-content: center;
    gap: 0.4rem;
    white-space: nowrap;
    overflow-x: scroll;
    scrollbar-width: thin;
}

    .top-action-bar a,
    .top-action-bar button {
        background: var(--mat-primary);
        color: #ffffff !important;
        padding: 0.35rem 0.9rem;
        border-radius: 6px;
    }

/* =========================================================
   🦶 FOOTER
   ========================================================= */
footer {
    background: var(--bassoft-gray);
    padding: 16px 0;
    text-align: center;
    font-size: 0.9rem;
    color: #666666;
}

    footer img {
        max-height: 40px;
    }

/* =========================================================
   📱 RESPONSIVE (MOBILE)
   ========================================================= */
@media (max-width: 576px) {
    form .form-label {
        display: block;
        width: auto;
        margin-bottom: 0.2rem;
    }

    form .form-control,
    form select,
    form textarea {
        width: 100%;
        max-width: none;
    }

    .filter-bar select {
        width: 100%;
    }

    .btn-search-wide {
        width: 100%;
        margin-top: 0.4rem;
    }

    .top-action-bar {
        justify-content: flex-start;
    }
}

@media (min-width: 400px) {
    .filter-bar .col-6 {
        width: 48% !important; /* 2 columns */
    }

    /* =========================================================
   💬 CHAT + MESSAGE COLLAPSE
   ========================================================= */
    .chat-container {
        display: flex;
        flex-direction: column;
        gap: 12px;
    }

    /* =====================================
   GLOBAL CLEANUP – RESET UNWANTED SPACE
   ===================================== */
    .msg-box, .msg-box * {
        box-sizing: border-box;
    }

    /* Ensure <details> adds ZERO padding/margin */
    details.msg-details-container,
    details.msg-details-container > summary {
        margin: 0 !important;
        padding: 0 !important;
    }

    /* =====================================
   MESSAGE PANEL (OUTER CONTAINER)
   ===================================== */
    .msg-box {
        margin: 0;
        padding: 0;
    }

    /* =====================================
   THE PANEL HEADER (Messages (X))
   ===================================== */
    .msg-summary {
        background: #f1f6ff;
        padding: 8px 12px;
        font-weight: 600;
        border-radius: 6px;
        cursor: pointer;
        margin-bottom: 8px !important;
        color: #333;
    }

    /* Smaller nicer default arrow */
    summary::marker {
        color: #456fb4;
        font-size: 16px;
    }

    /* =====================================
   PANEL CONTENT (AFTER EXPANDING)
   ===================================== */
    .msg-box-content {
        background: #e8f1ff;
        border-radius: 6px;
        padding: 10px 12px;
        margin-top: 2px;
    }

    /* =====================================
   EACH MESSAGE BLOCK
   ===================================== */
    .msg-details {
        background: #d9e8ff;
        border-radius: 10px;
        padding: 10px 14px;
        margin-bottom: 12px;
        width: 100%;
    }

        /* Remove all top space inside bubble */
        .msg-details:first-child {
            margin-top: 0 !important;
        }

    /* =====================================
   DATE + USERNAME LINE (TOP LINE)
   ===================================== */
    .msg-header {
        font-weight: 700;
        color: #333;
        margin: 0 !important;
        padding: 0 !important;
        text-align: left !important; /* FIX */
        line-height: 1.2;
    }

    /* =====================================
   SUBJECT LINE
   ===================================== */
    .msg-subject {
        margin-top: 4px;
        font-size: 14px;
        font-weight: 600;
        color: #003c8f;
        text-align: left !important;
    }

        /* Make subject links clickable */
        .msg-subject a {
            color: #0057c2;
            text-decoration: underline;
            font-weight: 600;
        }

    /* =====================================
   MESSAGE BODY
   ===================================== */
    .msg-body {
        margin-top: 6px;
        line-height: 1.45;
        white-space: pre-wrap;
        overflow-wrap: break-word;
        word-break: break-word;
        font-size: 14px;
    }

        /* Make URLs clickable inside body */
        .msg-body a {
            color: #0066cc;
            text-decoration: underline;
        }

    /* =====================================
   CHAT BUBBLE (used for fallback)
   ===================================== */
    .chat-bubble {
        background: #e9f4ff;
        padding: 8px 12px;
        border-radius: 6px;
        border: 1px solid #cfe8ff;
        /* KEY FIXES */
        margin-top: 4px !important; /* prevents large top gap */
        margin-bottom: 8px;
        text-align: left !important; /* force left alignment */
        line-height: 1.4;
        white-space: normal !important;
        overflow-wrap: break-word;
    }

    .msg-box summary {
        margin-bottom: 6px; /* avoid pushing bubble down */
    }

    .msg-box {
        padding-top: 0 !important; /* remove extra space */
    }
    /* Keep both buttons in ONE LINE */
    .send-row {
        display: flex;
        gap: 10px;
        align-items: center;
        flex-wrap: nowrap; /* prevents breaking into new line */
    }

    /* Summary behaves like a button, not a block */
    .send-details summary {
        list-style: none;
        cursor: pointer;
        display: inline-block;
    }

        .send-details summary::-webkit-details-marker {
            display: none;
        }

    /* Only the MESSAGE BOX goes to new line */
    .send-box-container {
        width: 100%;
        margin-top: 8px;
    }

    /* Force content inside <details> to NOT push buttons */
    .send-details {
        display: inline-block;
    }

        .send-details[open] {
            display: block;
            width: 100%;
        }

    /* Margin/padding for send/cancel buttons */
    .msg-details button.btn {
        margin-right: 6px;
        margin-top: 4px;
    }

    /* =====================================
   CLEANER SPACING BETWEEN ALL ELEMENTS
   ===================================== */
    .msg-details > *:first-child {
        margin-top: 0 !important;
    }

    .msg-details > *:last-child {
        margin-bottom: 0 !important;
    }

    .formatted-message {
        white-space: normal !important; /* allow wrapping */
        word-break: break-word !important; /* break long words/URLs */
        overflow-wrap: break-word !important;
        line-height: 1.4;
        padding: 0;
        margin: 0;
    }

    /* ============================================
   COMPACT MOBILE-FRIENDLY FORM (GLOBAL)
   ============================================ */

    /* Reduce spacing between form sections */
    .content-area .mb-3,
    .content-area .filter-item {
        margin-bottom: 4px !important;
    }



    /* Compact dropdowns */
    .content-area select.form-select-sm {
        height: 34px !important;
        padding: 2px 6px !important;
        font-size: 0.85rem !important;
    }

    /* Compact textboxes */
    .content-area input.form-control-sm,
    .content-area textarea.form-control-sm {
        height: 34px !important;
        padding: 2px 6px !important;
        font-size: 0.85rem !important;
    }

    /* Compact Education Table Selects */
    #educationTable select.form-select-sm {
        height: 32px !important;
        padding: 2px 4px !important;
    }

    /* Reduce row height in Education table */
    #educationTable tbody tr td {
        padding: 4px !important;
    }



    /* Make the entire page appear more mobile friendly */
    .content-wrapper {
        max-width: 700px;
    }

    .content-wrapper {
        min-height: auto !important;
        padding-bottom: 10px !important;
    }

    /* Compact page title */
    .page-title {
        font-size: 1.3rem;
        margin-bottom: 10px;
        text-align: center;
    }
}

.connection-btn-block .row-1 {
    margin-bottom: 6px;
}

.connection-btn-block .row-2 {
    display: flex;
    gap: 8px;
    flex-wrap: nowrap;
    align-items: center;
    margin-bottom: 6px;
}

.connection-btn-block .row-3 {
    width: 100%;
    margin-top: 4px;
}

.btn-share-row {
    background: #808080;
    color: #fff !important;
    padding: 6px 14px;
    border-radius: 6px;
}

.btn-msghistory,
.btn-sendmsg {
    white-space: nowrap;
}


/* WhatsApp Message Input Bar oval shape bar */
.wa-reply-bar {
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 30px;
    padding: 6px 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.wa-input {
    color: #000 !important;
    font-size: 1rem;
    line-height: 1.4;
    width: 100%;
    border: none;
    outline: none;
    resize: none;
    font-size: 0.95rem;
    padding: 6px 8px;
    }

    /* Make placeholder darker */
    .wa-input::placeholder {
        color: #555 !important; /* darker placeholder */
        opacity: 1 !important;
    }

.wa-send-btn {
    background: #0d6efd;
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 42px;
    height: 42px;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
}

    .wa-send-btn:hover {
        background: #0d6efd;
    }

/* Reply body message */
.wa-thread {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 10px 0;
}


.wa-row {
    display: flex;
    width: 100%;
    align-items: flex-start !important; /* prevent vertical centering */
}

    .wa-row.me {
        justify-content: flex-end;
    }

    .wa-row.them {
        justify-content: flex-start;
    }

.wa-bubble {
    max-width: 75%;
    padding: 10px 12px;
    border-radius: 12px;
    background: #ffffff;
    color: #000;
    font-size: 1rem;
    line-height: normal;
    white-space: initial !important;
    word-break: break-word !important;
    overflow-wrap: break-word !important;
    box-shadow: 0 1px 2px rgba(0,0,0,0.12);
    }

    .wa-bubble.me {
        background: rgba(0, 0, 0, 0.1);
        border-bottom-right-radius: 0;
        
    }

.wa-body {
    color: #000 !important; /* Dark black text */
    font-size: 1rem;
    line-height: 1.35; /* perfect readability */
    white-space: pre-line !important;
    word-break: break-word !important;
}

.wa-header {
    font-weight: 700;
    font-size: 1rem;
    margin-bottom: 2px;
    opacity: 0.8;
    }

.wa-time {
    font-size: 0.72rem;
    opacity: 0.55;
    text-align: right;
    margin-top: 4px;
    }

@media (max-width: 576px) {
    .wa-bubble {
        max-width: 90%;
    }
}


.btn-processing-fixed {
    min-width: 120px;
    text-align: center;
}

/* Make Sign In button same width as Create Account header */
.btn-action.btn-mat-primary {
    width: 100%;
    font-size: 1.5rem;
    padding: 12px 0;
    display: block;
    margin: 0 auto;
}

/* Make Create an Account header match size */
.section-header {
    width: 100%;
    font-size: 1.3rem;
    padding: 12px 0;
    display: block;
    text-align: center;
    cursor: pointer;
}

