/* ============================================================
   Base
   ============================================================ */

:root {
    --bg: #f4f7fb;
    --surface: #ffffff;
    --surface-soft: #f8fafc;

    --text: #172033;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;

    --border: #e2e8f0;

    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-soft: #eff6ff;

    --header: #172033;

    --success: #16a34a;
    --warning: #d97706;

    --shadow-sm:
        0 1px 2px rgba(15, 23, 42, 0.05);

    --shadow-md:
        0 8px 24px rgba(15, 23, 42, 0.08);

    --shadow-lg:
        0 20px 50px rgba(15, 23, 42, 0.16);

    --radius: 12px;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
}

body {
    font-family:
        "Segoe UI",
        Arial,
        sans-serif;

    background: var(--bg);
    color: var(--text);

    -webkit-font-smoothing: antialiased;
}


/* ==========================================================================
   Application
   ========================================================================== */

#application {
    min-height: 100vh;
}


/* ==========================================================================
   Header
   ========================================================================== */

.header {
    height: 72px;

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

    padding: 0 28px;

    background: var(--header);
    color: #ffffff;

    box-shadow:
        0 2px 8px rgba(15, 23, 42, 0.15);
}

.header-title {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.header h2 {
    margin: 0;

    font-size: 18px;
    font-weight: 600;
    letter-spacing: -0.2px;
}

.header small {
    color: #aeb8c8;

    font-size: 12px;
}


/* ==========================================================================
   Agent Status
   ========================================================================== */

#agent-status {
    display: flex;
    align-items: center;
    gap: 8px;

    padding: 7px 13px;

    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 999px;

    background: rgba(255, 255, 255, 0.08);

    color: #e5e7eb;

    font-size: 13px;
    font-weight: 500;
}


/* ==========================================================================
   Login Banner
   ========================================================================== */

.login-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 20px;

    padding: 12px 24px;

    background: var(--primary-soft);

    border-bottom: 1px solid #dbeafe;
}

.login-message {
    display: flex;
    align-items: center;
    gap: 10px;

    color: #1e3a8a;

    font-size: 13px;
}

.login-icon {
    font-size: 16px;
}

.login-button {
    border: 0;
    border-radius: 7px;

    padding: 8px 18px;

    background: var(--primary);
    color: #ffffff;

    font-family: inherit;
    font-size: 13px;
    font-weight: 600;

    cursor: pointer;

    transition:
        background 0.15s ease,
        transform 0.15s ease,
        box-shadow 0.15s ease;
}

.login-button:hover {
    background: var(--primary-dark);

    box-shadow:
        0 3px 8px rgba(37, 99, 235, 0.25);
}

.login-button:active {
    transform: translateY(1px);
}


/* ==========================================================================
   Main Content
   ========================================================================== */

.content {
    display: flex;

    gap: 20px;

    padding: 20px 24px;

    align-items: flex-start;
}


/* ==========================================================================
   CCP Container
   ========================================================================== */

#ccp {
    width: 400px;
    height: 760px;

    flex-shrink: 0;

    background: var(--surface);

    border: 1px solid var(--border);
    border-radius: var(--radius);

    overflow: hidden;

    box-shadow: var(--shadow-md);
}


/* ==========================================================================
   Sidebar
   ========================================================================== */

.sidebar {
    flex: 1;
    min-width: 280px;

    background: var(--surface);

    border: 1px solid var(--border);
    border-radius: var(--radius);

    padding: 0;

    overflow: hidden;

    box-shadow: var(--shadow-md);
}

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

    padding: 18px 20px;

    border-bottom: 1px solid var(--border);

    background: var(--surface-soft);
}

.sidebar-header h3 {
    margin: 0;

    font-size: 14px;
    font-weight: 600;
}

.sidebar-header span {
    color: var(--text-muted);

    font-size: 11px;
    font-weight: 500;

    text-transform: uppercase;
    letter-spacing: 0.5px;
}


/* ==========================================================================
   Connection Details
   ========================================================================== */

.connection-table {
    width: 100%;

    border-collapse: collapse;
}

.connection-table td {
    padding: 13px 20px;

    border-bottom: 1px solid #eef2f7;

    font-size: 13px;
}

.connection-table tr:last-child td {
    border-bottom: 0;
}

.connection-table td:first-child {
    width: 38%;

    color: var(--text-secondary);

    font-weight: 500;
}

.connection-table td:last-child {
    color: var(--text);

    font-weight: 500;

    word-break: break-word;
}


/* ==========================================================================
   Footer
   ========================================================================== */

.application-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;

    padding: 10px 24px;

    color: var(--text-muted);

    font-size: 11px;
}


/* ==========================================================================
   VDI / MEDIALESS CCP
   ========================================================================== */

.medialess-ccp {
    width: 100%;
}

.medialess-ccp .audio-device-settings,
.medialess-ccp .phone-type-settings {
    display: none !important;
}


/* ==========================================================================
   Mode Selector
   ========================================================================== */

.mode-selector {
    position: fixed;

    inset: 0;

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

    padding: 20px;

    background:
        linear-gradient(
            135deg,
            rgba(15, 23, 42, 0.94),
            rgba(30, 41, 59, 0.96)
        );

    z-index: 10000;
}

.mode-selector-card {
    width: 500px;
    max-width: calc(100vw - 40px);

    background: var(--surface);

    border-radius: 16px;

    overflow: hidden;

    box-shadow: var(--shadow-lg);
}


/* ==========================================================================
   Mode Selector Header
   ========================================================================== */

.mode-selector-header {
    display: flex;
    align-items: center;

    gap: 14px;

    padding: 26px 30px 20px;

    border-bottom: 1px solid var(--border);
}

.brand-icon {
    width: 44px;
    height: 44px;

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

    border-radius: 12px;

    background: var(--primary-soft);

    color: var(--primary);

    font-size: 21px;
}

.mode-selector-header h1 {
    margin: 0;

    color: var(--text);

    font-size: 19px;
    font-weight: 650;
}

.mode-selector-header p {
    margin: 3px 0 0;

    color: var(--text-secondary);

    font-size: 12px;
}


/* ==========================================================================
   Mode Selector Content
   ========================================================================== */

.mode-selector-content {
    padding: 26px 30px 30px;
}

.mode-selector-content h2 {
    margin: 0 0 7px;

    color: var(--text);

    font-size: 18px;
    font-weight: 600;
}

.mode-question {
    margin: 0 0 22px;

    color: var(--text-secondary);

    font-size: 13px;
}


/* ==========================================================================
   Mode Options
   ========================================================================== */

.mode-options {
    display: flex;
    flex-direction: column;

    gap: 12px;
}

.mode-button {
    width: 100%;

    display: flex;
    align-items: center;

    gap: 14px;

    padding: 16px;

    background: var(--surface);

    border: 1px solid var(--border);
    border-radius: 10px;

    color: var(--text);

    cursor: pointer;

    text-align: left;

    font-family: inherit;

    transition:
        border-color 0.15s ease,
        background 0.15s ease,
        box-shadow 0.15s ease,
        transform 0.15s ease;
}

.mode-button:hover {
    border-color: #93c5fd;

    background: #f8fbff;

    box-shadow:
        0 4px 12px rgba(37, 99, 235, 0.08);

    transform: translateY(-1px);
}

.mode-button:active {
    transform: translateY(0);
}

.mode-button:focus-visible {
    outline: 3px solid rgba(37, 99, 235, 0.2);

    border-color: var(--primary);
}


/* ==========================================================================
   Mode Button Icon
   ========================================================================== */

.mode-button-icon {
    width: 42px;
    height: 42px;

    flex-shrink: 0;

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

    border-radius: 10px;

    background: var(--surface-soft);

    font-size: 19px;
}


/* ==========================================================================
   Mode Button Content
   ========================================================================== */

.mode-button-content {
    flex: 1;

    display: flex;
    flex-direction: column;

    gap: 5px;
}

.mode-button strong {
    font-size: 14px;
    font-weight: 600;
}

.mode-button span {
    color: var(--text-secondary);

    font-size: 12px;
    line-height: 1.45;
}


/* ==========================================================================
   Mode Button Arrow
   ========================================================================== */

.mode-button-arrow {
    flex-shrink: 0;

    color: var(--text-muted);

    font-size: 18px;

    transition:
        color 0.15s ease,
        transform 0.15s ease;
}

.mode-button:hover .mode-button-arrow {
    color: var(--primary);

    transform: translateX(3px);
}


/* ==========================================================================
   Mode Selector Footer
   ========================================================================== */

.mode-selector-footer {
    padding: 13px 30px;

    border-top: 1px solid var(--border);

    background: var(--surface-soft);

    color: var(--text-muted);

    font-size: 11px;

    text-align: center;
}


/* ==========================================================================
   Responsive Layout
   ========================================================================== */

@media (max-width: 850px) {

    .content {
        flex-direction: column;
    }

    #ccp {
        width: 100%;
    }

    .sidebar {
        width: 100%;
    }

}

@media (max-width: 600px) {

    .header {
        padding: 0 16px;
    }

    .login-banner {
        padding: 12px 16px;
    }

    .content {
        padding: 16px;
    }

    .application-footer {
        padding: 10px 16px;
    }

    .mode-selector-card {
        width: 100%;
    }

    .mode-selector-header,
    .mode-selector-content {
        padding-left: 22px;
        padding-right: 22px;
    }

}