﻿:root {
    --headerLight: url('../images/headerLight.png');
    --headerDark: url('../images/headerDark.png');
    --headerBackgroundImageUrl: var(--headerLight);

    /* CBS Brand Colors */
    --cbs-berry-blue: #26245D;
    --cbs-iris-blue: #494DA1;
    --cbs-steel-blue: #3D7492;
    --cbs-seafoam-green: #579487;
    --cbs-tan: #AC8158;
    --cbs-charcoal-gray: #181C1C;
    --cbs-cinder-gray: #E3E3E3;
}

/* Brand Font Override - Montserrat (CBS Web Typeface) */
* {
    font-family: 'Montserrat', sans-serif !important;
}

html, body {
    max-width: 100%;
    overflow-x: hidden;
}

.mud-theme-provider {
    --mud-palette-primary: #26245D;
    --mud-palette-secondary: #494DA1;
}

/* Button Overrides for Brand Colors */
.mud-button-filled-primary {
    background-color: var(--cbs-berry-blue) !important;
    color: white !important;
}

    .mud-button-filled-primary:hover {
        background-color: var(--cbs-iris-blue) !important;
    }

.mud-button-filled-secondary,
.mud-button-filled-secondary:not(:disabled) {
    background-color: var(--cbs-iris-blue) !important;
    color: white !important;
}

/* Input and Form Controls */
.mud-input-control-input-container {
    font-family: 'Montserrat', sans-serif !important;
}

.mud-input {
    font-family: 'Montserrat', sans-serif !important;
}

.mud-input-input-container input,
.mud-input-input-container textarea,
.mud-input input,
.mud-input textarea,
.mud-select-input input,
.mud-input-slot {
    font-weight: 400 !important;
}

/* Tab Controls */
.mud-tabs .mud-tab {
    font-family: 'Montserrat', sans-serif !important;
}

.mud-button-filled-secondary:hover {
    background-color: var(--cbs-steel-blue) !important;
}

header .mud-toolbar {
    /* background-image: var(--headerBackgroundImageUrl); */
    height: 64px;
    background-position: left;
    background-repeat: no-repeat;
}


@media screen and (min-width: 960px) {
    div.widgetsTable > div.mud-table-container > table > thead > tr > th:nth-child(1) {
        width: 11em;
    }

    div.gizmosTable > div.mud-table-container > table > thead > tr > th:nth-child(1) {
        width: 5em;
    }
}

.mud-nav-link.active .mud-nav-link-text {
    color: var(--cbs-berry-blue) !important;
}

.mud-nav-link.active .mud-icon-root {
    color: var(--cbs-berry-blue) !important;
}

.mud-nav-link.active {
    background-color: var(--cbs-cinder-gray) !important;
}

.mud-nav-link:hover {
    background-color: var(--cbs-cinder-gray) !important;
}

.mud-drawer .mud-drawer-content {
    height: 100%;
    max-height: 100%;
    display: flex;
    flex: 0 0 auto;
    flex-direction: column;
    background: var(--cbs-cinder-gray);
}

.custom-tabs {
    background-color: transparent !important;
}

    .custom-tabs .mud-tabs-tabbar {
        background-color: transparent !important;
    }

    .custom-tabs .mud-tabs-toolbar {
        background-color: transparent !important;
        gap: 32px;
        padding: 0 12px;
    }

    .custom-tabs .mud-tab {
        color: #a0a1a3;
        font-weight: 600;
        min-width: auto;
        padding: 16px 0;
    }

        .custom-tabs .mud-tab.mud-tab-active {
            color: var(--cbs-iris-blue);
        }

    .custom-tabs .mud-tab-slider-bar {
        background-color: var(--cbs-berry-blue) !important;
        height: 3px;
        border-radius: 2px;
    }

.mud-tabs-tabbar-content {
    width: 100%;
    flex: 1 1 auto;
    display: inline-block;
    position: relative;
    white-space: nowrap;
    overflow: hidden;
    padding-bottom: 10px;
}

.mud-paper-outlined {
    border: 0px solid var(--mud-palette-lines-default)
}

/* Radzen Time Picker Styles */
.time-picker-click-wrapper {
    cursor: pointer;
}

.radzen-time-picker .rz-inputtext {
    color: var(--cbs-charcoal-gray) !important;
    font-family: 'Montserrat', sans-serif !important;
    height: 56px !important;
    border-radius: 4px;
    border: 1px solid rgba(0, 0, 0, 0.23);
}

    .radzen-time-picker .rz-inputtext:hover {
        border-color: rgba(0, 0, 0, 0.87);
    }

    .radzen-time-picker .rz-inputtext:focus {
        outline: none;
        border-color: var(--cbs-berry-blue);
        border-width: 2px;
    }

.radzen-time-picker .rz-datepicker-trigger {
    color: var(--cbs-berry-blue) !important;
}

/* Fix Radzen icon display */
.rzi {
    font-family: 'Material Icons' !important;
    font-weight: normal !important;
    font-style: normal;
    font-size: 24px;
    line-height: 1;
    letter-spacing: normal;
    text-transform: none;
    display: inline-block;
    white-space: nowrap;
    word-wrap: normal;
    direction: ltr;
}

.rzi-chevron-up::before {
    content: 'expand_less';
}

.rzi-chevron-down::before {
    content: 'expand_more';
}

.rzi-calendar::before {
    content: 'calendar_today';
}

.rzi-clock::before {
    content: 'access_time';
}

/* Radzen AM/PM toggle buttons */
.rz-timepicker-ampm {
    display: flex !important;
    flex-direction: column;
    gap: 4px;
}

    .rz-timepicker-ampm button {
        color: #333 !important;
        background-color: transparent !important;
        border: 1px solid rgba(0, 0, 0, 0.23) !important;
        padding: 4px 12px;
        min-width: 50px;
        border-radius: 4px;
    }

        .rz-timepicker-ampm button.rz-state-active {
            background-color: #232c65 !important;
            color: white !important;
            border-color: #232c65 !important;
        }

        .rz-timepicker-ampm button:hover:not(.rz-state-active) {
            background-color: rgba(35, 44, 101, 0.1) !important;
        }

/* Ensure Radzen DatePicker wrapper has consistent height */
.radzen-time-picker {
    display: flex;
    align-items: stretch;
}

    .radzen-time-picker .rz-datepicker {
        width: 100%;
    }

/* Style the selected time value */
.rz-timepicker-hour .rz-state-active,
.rz-timepicker-minute .rz-state-active {
    background-color: #232c65 !important;
    color: white !important;
    font-weight: 500 !important;
}

/* Time picker panel styling */
.rz-timepicker {
    font-family: 'Open Sans', sans-serif !important;
}

    .rz-timepicker span {
        color: #333 !important;
    }

/* Radzen secondary button override */
.rz-button.rz-secondary {
    background-color: #d3d3d3 !important;
    color: #333 !important;
}

    .rz-button.rz-secondary:hover {
        background-color: #bcbcbc !important;
    }

/* =============================================
   SHARED PAGE LAYOUT
   ============================================= */

/* Loading spinner centered in page */
.page-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 600px;
}

/* Busy overlay — blocks interaction while saving/deleting */
.busy-overlay {
    position: fixed;
    inset: 0;
    background: rgb(255 255 255 / 8%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    pointer-events: all;
}

/* Left sidebar panel */
.sidebar-panel {
    height: 600px;
    display: flex;
    flex-direction: column;
    border: 1px solid #e3e3e3;
    border-radius: 12px;
}

/* Right detail panel (scrollable) */
.detail-panel {
    height: 600px;
    display: flex;
    flex-direction: column;
    border: 1px solid #e3e3e3;
    border-radius: 12px;
    overflow-y: auto;
}

/* Right detail panel — empty/placeholder state */
.detail-panel-empty {
    height: 600px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #e3e3e3;
    border-radius: 12px;
}

/* Right detail panel — card style (AddressBook) */
.detail-panel-card {
    height: 600px;
    background: #ffffff;
    box-shadow: 0 4px 20px rgba(38, 36, 93, 0.1);
    border-radius: 12px;
    border: 1px solid #e3e3e3;
    overflow-y: auto;
    position: relative;
}

/* Scrollable list container */
.list-scroll {
    flex: 1;
    overflow-y: auto;
    padding-right: 8px;
}

/* Toolbar row above a list (search + sort controls) */
.list-toolbar {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
}

/* Create-button bar at top of sidebar */
.list-create-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

/* Wrapper around each list item (adds bottom margin) */
.list-item-wrapper {
    margin-bottom: 8px;
}

/* =============================================
   SECTION LABEL (caption above fields/groups)
   ============================================= */
.section-label {
    display: block;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    font-weight: 700;
    color: #494DA1;
    margin-bottom: 8px;
}

/* =============================================
   DETAIL PANEL HEADER ROW
   ============================================= */
.detail-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 32px;
    padding-bottom: 5px;
    border-bottom: 2px solid #E3E3E3;
}

.detail-header-actions {
    display: flex;
    gap: 8px;
}

/* =============================================
   AVATAR — contact / group initials
   ============================================= */
.contact-avatar {
    height: 72px;
    width: 72px;
    font-size: 28px;
    background: linear-gradient(135deg, #232c65 0%, #494DA1 100%);
    box-shadow: 0 4px 12px rgba(73, 77, 161, 0.3);
}

.contact-avatar-small {
    height: 80px;
    width: 80px;
    font-size: 12px;
    font-weight: 600;
    background: white;
    color: #232c65;
    border: 1px solid #e3e3e3;
    box-shadow: 0 2px 8px rgba(73, 77, 161, 0.2);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 8px;
    word-break: break-word;
    line-height: 1.2;
}

.contact-remove-btn {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #ff6b6b;
    color: white;
    padding: 2px;
}

/* =============================================
   CONTACT / GROUP AVATAR GRID
   ============================================= */
.contacts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 12px;
    margin-top: 12px;
}

.contacts-grid-item {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.contacts-grid-item-readonly {
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* =============================================
   PARTICIPANT CHIPS (Meetings detail panel)
   ============================================= */
.participants-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.participant-chip {
    padding: 6px 12px;
    border-radius: 10px;
    border: 1px solid #c5cae9;
    white-space: nowrap;
}

/* =============================================
   FORM ACTION BUTTONS (Save / Cancel row)
   ============================================= */
.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

.btn-primary-brand {
    background-color: #232c65 !important;
    color: white !important;
    text-transform: none !important;
    font-weight: 600 !important;
}

.btn-cancel {
    border-color: #AC8158 !important;
    color: #AC8158 !important;
    text-transform: none !important;
    font-weight: 600 !important;
}

.btn-outlined-brand {
    border-color: #232c65 !important;
    color: #232c65 !important;
    text-transform: none !important;
    font-weight: 600 !important;
}

    .btn-outlined-brand:hover {
        background-color: rgba(35, 44, 101, 0.08) !important;
    }

/* =============================================
   EMPTY STATE (no items in list)
   ============================================= */
.empty-state {
    text-align: center;
    border-radius: 12px;
    border: 1px solid #e3e3e3;
    padding: 48px;
}

.empty-state-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
}

/* =============================================
   DASHBOARD LAYOUT
   ============================================= */
.dashboard-layout {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: flex-start;
    margin-bottom: 32px;
}

.dashboard-calendar {
    border: 1px solid #e3e3e3;
    border-radius: 12px;
    flex-shrink: 0;
    max-width: 100%;
}

.dashboard-meetings-panel {
    /* min-width 320px (instead of 0) means this panel wraps onto its own
       full-width row once the window is too narrow to fit it next to the
       calendar, rather than getting flex-shrunk down to nothing and having
       its content clipped by the page's overflow-x: hidden. */
    flex: 1 1 320px;
    min-width: 320px;
    max-width: 100%;
    height: 600px;
    display: flex;
    flex-direction: column;
    border: 1px solid #e3e3e3;
    border-radius: 12px;
    margin-left: 15px;
}

@media (max-width: 768px) {
    .dashboard-layout {
        flex-direction: column;
        gap: 16px;
    }

    .dashboard-calendar {
        width: 100%;
    }

        .dashboard-calendar .mud-picker,
        .dashboard-calendar .mud-picker-container {
            max-width: 100%;
        }

        /* Hide the big date toolbar on mobile - the date is already shown
           in the app bar greeting - so the calendar grid is compact and
           full-width instead of squeezed next to a tall side panel. */
        .dashboard-calendar .mud-picker-toolbar,
        .dashboard-calendar .mud-picker-datepicker-toolbar {
            display: none;
        }

        .dashboard-calendar .mud-picker-content {
            width: 100%;
        }

    .dashboard-meetings-panel {
        margin-left: 0;
        width: 100%;
        min-width: 0;
        height: 500px;
    }
}

.dashboard-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.dashboard-meetings-scroll {
    flex: 1;
    overflow-y: auto;
    padding-right: 8px;
}

.meeting-list-item {
    margin-bottom: 8px;
}

.meeting-list-item-card {
    padding: 12px;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    cursor: pointer;
    transition: all 0.2s ease;
}

.meeting-list-empty {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
}

/* =============================================
   INDEX PAGE — SETUP PROFILE OVERLAY
   ============================================= */
.setup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 16px;
    box-sizing: border-box;
    overflow-y: auto;
}

.setup-paper {
    max-width: 500px;
    width: 100%;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    z-index: 10000;
    box-sizing: border-box;
}

@media (max-width: 600px) {
    .setup-paper.pa-8 {
        padding: 24px !important;
    }
}

.setup-header {
    text-align: center;
    margin-bottom: 2rem;
}

.setup-title {
    font-weight: 600;
    color: #232c65;
    font-size: 1.5rem;
}

.setup-subtitle {
    font-size: 0.95rem;
    margin-top: 0.5rem;
}

.setup-button {
    background-color: #232c65 !important;
    color: white;
    font-weight: 600;
    font-size: 1rem;
    padding: 12px 24px !important;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
}

    .setup-button:hover {
        background-color: #1a2047 !important;
        box-shadow: 0 8px 20px rgba(35, 44, 101, 0.3);
    }

    .setup-button:disabled {
        cursor: not-allowed;
    }

/* =============================================
   DIALOG — SUMMARY CARD (participants/groups)
   ============================================= */
.summary-card {
    margin-bottom: 16px;
    padding: 12px;
    background-color: #f0f0f0;
    border-radius: 4px;
    border-left: 4px solid #232c65;
}

.summary-card-items {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.summary-group-tag {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    padding: 8px 12px;
    background-color: #fff;
    border: 1px solid #232c65;
    border-radius: 8px;
}

.summary-group-tag-inner {
    display: flex;
    align-items: center;
    gap: 6px;
}

.summary-participant-tag {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background-color: #fff;
    border: 1px solid #232c65;
    border-radius: 20px;
}

.dialog-remove-btn {
    margin: 0 !important;
    padding: 0 !important;
    width: 20px !important;
    height: 20px !important;
    min-width: 20px !important;
    min-height: 20px !important;
}

/* =============================================
   DIALOG — CONTACT/GROUP SCROLLABLE LIST
   ============================================= */
.dialog-list-scroll {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 8px;
}

.dialog-contact-row {
    display: flex;
    align-items: center;
    padding: 6px 0;
    border-bottom: 1px solid #eee;
}

.dialog-contact-info {
    margin-left: 8px;
}

.dialog-list-search-scroll {
    max-height: 250px;
    overflow-y: auto;
}

/* =============================================
   DIALOG — GROUP EXPANDED MEMBERS
   ============================================= */
.group-members-indent {
    margin-left: 32px;
    max-width: 85%;
}

/* =============================================
   DIALOG — REVIEW CARD DETAIL GRID
   ============================================= */
.review-detail-grid {
    display: grid;
    gap: 20px;
}

.review-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

/* =============================================
   INSTANT MEETING DIALOG — RESULT VIEW
   ============================================= */
.instant-meeting-result {
    padding: 16px 0;
}

.instant-meeting-result-header {
    text-align: center;
    margin-bottom: 24px;
}

.instant-meeting-warning {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
}

.instant-meeting-host-btn {
    background-color: #232c65 !important;
    color: white !important;
    text-transform: none !important;
    font-weight: 600 !important;
}

.instant-meeting-copy-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
}

.instant-meeting-join-link {
    word-break: break-all;
    flex: 1 1 auto;
    min-width: 0;
}

.instant-meeting-info-row {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-top: 8px;
}

.instant-meeting-manual-row {
    display: flex;
    gap: 8px;
}

/* =============================================
   INSTANT MEETING DIALOG — MOBILE RESPONSIVENESS
   ============================================= */
.instant-meeting-dialog .mud-dialog {
    margin: 8px;
    max-width: calc(100vw - 16px);
}

@media (min-width: 601px) {
    .instant-meeting-dialog-wide .mud-dialog {
        min-width: 680px;
    }
}

@media (max-width: 600px) {
    .instant-meeting-dialog .mud-dialog {
        width: calc(100vw - 16px);
        max-width: calc(100vw - 16px);
    }

    .instant-meeting-result {
        padding: 12px 0;
    }

    .instant-meeting-result-header {
        margin-bottom: 16px;
    }

    .instant-meeting-warning {
        flex-direction: column;
        text-align: center;
        gap: 4px;
    }

    .instant-meeting-copy-row {
        flex-wrap: wrap;
    }

    .instant-meeting-host-btn {
        white-space: normal !important;
        line-height: 1.3 !important;
        padding: 10px 12px !important;
    }
}

/* =============================================
   ANIMATIONS
   ============================================= */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes scaleIn {
    from {
        transform: scale(0);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}
