﻿/* ====== General layout ====== */
body {
    background-color: #f8f9fa;
}

h2, h4, h5 {
    color: #333;
}

.nowrap {
    white-space: nowrap;
}

/* NOTE: This overrides Bootstrap's .container width globally. If intentional, keep it.
   If not, consider using .container.custom-container instead. */
.container {
    max-width: 1100px;
}

.checkbox-label {
    vertical-align: middle;
}

/* ====== Bootstrap icon colours ====== */
.bi-whatsapp {
    color: #25D366;
}

.bi-facebook {
    color: #1877F2;
}

.bi-instagram {
    color: #E4405F;
}

.bi-chat-text {
    color: #6c757d;
}

.bi-voicemail {
    color: #343a40;
}

/* special Whatsapp blue "message read" colour */
.bg-whatsapp-read {
    background-color: #34B7F1 !important;
    color: #fff;
}

/* ====== Navbar ====== */

/* Make the navbar genuinely compact */
.navbar {
    background-color: darkblue !important;
    padding-top: 0.15rem;
    padding-bottom: 0.15rem;
}

    /* Force white text everywhere in the navbar */
    .navbar,
    .navbar a,
    .navbar .navbar-brand,
    .navbar .navbar-nav .nav-link,
    .navbar .navbar-text,
    .navbar .signin-info,
    .navbar .signin-info .agent-name {
        color: #fff !important;
    }

        /* Slightly dim normal links, brighten on hover */
        .navbar .navbar-nav .nav-link {
            color: rgba(255,255,255,0.9) !important;
            padding-top: 0.15rem;
            padding-bottom: 0.15rem;
            line-height: 1.1;
        }

            .navbar .navbar-nav .nav-link:hover {
                color: #fff !important;
            }

        /* Brand/title sizing without adding height */
        .navbar .navbar-brand {
            font-size: 1.7rem;
            font-weight: 700;
            line-height: 1.05;
            padding-top: 0;
            padding-bottom: 0;
            margin: 0;
            font-family: 'Trebuchet MS','Lucida Sans Unicode','Lucida Grande','Lucida Sans',Arial,sans-serif;
        }

        /* Signed-in line compact */
        .navbar .signin-info {
            font-size: 0.8em;
            line-height: 1.1;
            margin-top: -2px; /* keep if you like the visual nudge */
        }

/* Optional: thin divider line between header row and nav row if you're doing a 2-line header
.navbar .nav-divider {
    border-top: 1px solid rgba(255,255,255,0.35);
}
*/

/* Light hamburger icon for small screens */
.navbar-dark .navbar-toggler-icon {
    background-image: url("data:image/svg+xml;charset=utf8,%3Csvg viewBox='0 0 30 30' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath stroke='rgba(255,255,255,1)' stroke-width='2' stroke-linecap='round' stroke-miterlimit='10' d='M4 7h22M4 15h22M4 23h22'/%3E%3C/svg%3E");
}

/* Small-screen adjustments */
@media (max-width: 576px) {
    .navbar .navbar-brand {
        font-size: 1rem;
        line-height: 1.1;
    }

    h2, h4 {
        font-size: 1.2rem;
    }
}

/* ====== API status block in navbar ====== */
.api-status {
    color: #fff;
    font-size: 0.75rem;
    line-height: 1.15;
    margin-right: 0.75rem; /* spacing before hamburger */
}

    .api-status .status-line {
        display: block;
        white-space: nowrap; /* prevents ugly mid-timestamp wrapping */
    }

/* Mobile: make it a bit tighter */
@media (max-width: 576px) {
    .api-status {
        font-size: 0.7rem;
        line-height: 1.05;
        margin-right: 0.5rem;
    }
}

/* ====== Navbar header: mobile wrapping fixes ====== */
@media (max-width: 576px) {

    /* Allow row 1 to wrap onto multiple lines */
    .navbar .navbar-header-row {
        flex-wrap: wrap;
        align-items: flex-start;
    }

    /* Make status take a full row under the logo/sign-in */
    .navbar .navbar-api-status {
        order: 3; /* after logo + toggler */
        flex: 0 0 100%; /* full width row */
        width: 100%;
        margin-left: 0 !important; /* override ms-auto */
        margin-right: 0 !important;
        text-align: left !important;
        padding-left: 0px; /* aligns under text (approx logo+gap) */
        padding-top: 2px;
    }

        /* On real mobile, allow wrapping (timestamps are long) */
        .navbar .navbar-api-status .status-line {
            white-space: normal;
        }

    /* Keep hamburger on the top line to the right */
    .navbar .navbar-toggler {
        margin-left: auto;
        order: 2;
    }
}


/* ====== Ticket list (Default.aspx) ====== */
.table {
    background-color: #fff;
    border-radius: 0.5rem;
    overflow: hidden;
}

    .table th {
        white-space: nowrap;
        background-color: #e9ecef;
    }

    .table td,
    .table th {
        vertical-align: middle;
        padding: 0.6rem 0.8rem;
    }

    /* Reduce the width of action buttons in tables */
    .table .btn {
        padding: 0.25rem 0.6rem;
    }

/* ====== Message list (Ticket.aspx) ====== */
.list-group-item {
    border: 1px solid #dee2e6;
    border-radius: 0.5rem;
    margin-bottom: 0.75rem;
    background-color: #fff;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

    .list-group-item p {
        margin-bottom: 0.5rem;
        white-space: pre-wrap; /* preserve line breaks */
    }

/* Audio player */
audio {
    width: 100%;
    max-width: 400px;
    display: block;
    margin-top: 0.5rem;
}

/* ====== Reply box ====== */
#txtReply {
    resize: vertical;
}

/* ====== Paging of grid ====== */
.gridview-pager {
    text-align: center;
    padding: 10px;
}

    .gridview-pager a,
    .gridview-pager span {
        margin: 0 4px;
        padding: 4px 8px;
        border-radius: 4px;
    }

    .gridview-pager a {
        background-color: #f8f9fa;
        color: #007bff;
        text-decoration: none;
    }

    .gridview-pager span {
        background-color: #007bff;
        color: white;
    }
