/* ============================================
   Codebasics Webinar Manager — Official Theme
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&display=swap');

:root {
    --cb-blue: #3B82F6;
    --cb-blue-hover: #2563EB;
    --cb-blue-light: rgba(59, 130, 246, 0.08);
    --cb-border: #E4E8EB;
    --cb-border-hover: #D1D7DC;
    --cb-text: #1C1D1F;
    --cb-text-secondary: #6B7280;
    --cb-text-muted: #9CA3AF;
    --cb-surface: #F5F9FF;
    --cb-bg: #FFFFFF;
    --cb-danger: #EF4444;
    --cb-success: #22C55E;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Manrope', sans-serif;
    background: var(--cb-bg);
    color: var(--cb-text);
    min-height: 100vh;
    font-size: 14px;
    line-height: 1.5;
}

h1, h2, h3, h4, h5, h6 { font-family: 'Manrope', sans-serif; }

a { color: var(--cb-blue); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ============================================
   CARDS
   ============================================ */
.card {
    background: var(--cb-bg);
    border: 1px solid var(--cb-border);
    border-radius: 16px;
}

.card-glow { /* intentionally no shadow in new theme */ border: 1px solid var(--cb-border); }

/* ============================================
   INPUTS
   ============================================ */
.cb-input {
    background: var(--cb-bg);
    border: 1px solid var(--cb-border);
    border-radius: 8px;
    color: var(--cb-text);
    padding: 10px 14px;
    font-family: 'Manrope', sans-serif;
    font-weight: 400;
    font-size: 14px;
    width: 100%;
    transition: border-color 150ms ease-out;
}

.cb-input:focus {
    outline: none;
    border-color: var(--cb-blue);
}

.cb-input::placeholder { color: var(--cb-text-muted); }

/* ============================================
   SELECTS
   ============================================ */
.cb-select {
    background: var(--cb-bg);
    border: 1px solid var(--cb-border);
    border-radius: 8px;
    color: var(--cb-text);
    padding: 10px 14px;
    font-family: 'Manrope', sans-serif;
    font-weight: 400;
    font-size: 14px;
    width: 100%;
    transition: border-color 150ms ease-out;
    cursor: pointer;
}

.cb-select:focus { outline: none; border-color: var(--cb-blue); }
.cb-select option { background: var(--cb-bg); color: var(--cb-text); }

/* ============================================
   LABELS
   ============================================ */
.cb-label {
    font-family: 'Manrope', sans-serif;
    font-weight: 600;
    font-size: 13px;
    color: var(--cb-text-secondary);
    margin-bottom: 6px;
    display: block;
}

/* ============================================
   BUTTONS
   ============================================ */
.btn-primary {
    background: var(--cb-blue);
    color: #FFFFFF;
    font-family: 'Manrope', sans-serif;
    font-weight: 700;
    font-size: 16px;
    border: none;
    border-radius: 16px;
    padding: 12px 24px;
    height: 48px;
    width: 100%;
    cursor: pointer;
    transition: background 150ms ease-out;
}

.btn-primary:hover { background: var(--cb-blue-hover); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-success {
    background: var(--cb-blue);
    color: #FFFFFF;
    font-family: 'Manrope', sans-serif;
    font-weight: 700;
    font-size: 16px;
    border: none;
    border-radius: 16px;
    padding: 12px 24px;
    height: 48px;
    width: 100%;
    cursor: pointer;
    transition: background 150ms ease-out;
}

.btn-success:hover { background: var(--cb-blue-hover); }
.btn-success:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-purple {
    background: var(--cb-blue);
    color: #FFFFFF;
    font-family: 'Manrope', sans-serif;
    font-weight: 700;
    font-size: 16px;
    border: none;
    border-radius: 16px;
    padding: 12px 24px;
    height: 48px;
    width: 100%;
    cursor: pointer;
    transition: background 150ms ease-out;
}

.btn-purple:hover { background: var(--cb-blue-hover); }

.btn-outline {
    background: var(--cb-bg);
    color: var(--cb-text-secondary);
    border: 1px solid var(--cb-border);
    border-radius: 8px;
    padding: 10px 20px;
    font-family: 'Manrope', sans-serif;
    font-weight: 500;
    font-size: 14px;
    cursor: pointer;
    transition: border-color 150ms ease-out, color 150ms ease-out;
}

.btn-outline:hover { border-color: var(--cb-blue); color: var(--cb-blue); }

.btn-sm {
    padding: 6px 14px;
    font-size: 13px;
    height: auto;
    width: auto;
    border-radius: 8px;
}

.btn-icon {
    background: none;
    border: none;
    color: var(--cb-text-muted);
    cursor: pointer;
    font-size: 14px;
    padding: 4px 8px;
    border-radius: 4px;
    transition: color 150ms ease-out;
}

.btn-icon:hover { color: var(--cb-text); }
.btn-icon.danger:hover { color: var(--cb-danger); }

/* ============================================
   GRID & LAYOUT
   ============================================ */
.datetime-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

/* ============================================
   UTILITY
   ============================================ */
.hidden { display: none !important; }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.gap-5 { gap: 20px; }
.text-center { text-align: center; }
.w-full { width: 100%; }
.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.p-4 { padding: 16px; }
.p-5 { padding: 20px; }

/* ============================================
   TOP NAV
   ============================================ */
.top-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    border-bottom: 1px solid var(--cb-border);
    background: var(--cb-bg);
    position: sticky;
    top: 0;
    z-index: 50;
}

.top-nav-logo { height: 36px; }

.top-nav-user { display: flex; align-items: center; gap: 16px; }
.top-nav-name { font-size: 13px; color: var(--cb-text); font-weight: 500; }
.top-nav-role {
    font-size: 11px;
    color: var(--cb-blue);
    background: var(--cb-blue-light);
    padding: 2px 10px;
    border-radius: 4px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.logout-btn {
    background: none;
    border: 1px solid var(--cb-border);
    color: var(--cb-text-muted);
    padding: 6px 14px;
    border-radius: 8px;
    font-family: 'Manrope', sans-serif;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: border-color 150ms ease-out, color 150ms ease-out;
}

.logout-btn:hover { color: var(--cb-danger); border-color: var(--cb-danger); }

/* ============================================
   EVENT CARDS
   ============================================ */
.event-card {
    background: var(--cb-bg);
    border: 1px solid var(--cb-border);
    border-radius: 12px;
    padding: 16px 20px;
    margin-bottom: 12px;
    transition: border-color 150ms ease-out;
    cursor: pointer;
}

.event-card:hover { border-color: var(--cb-border-hover); }

.event-card-title {
    font-family: 'Manrope', sans-serif;
    font-size: 16px;
    font-weight: 700;
    color: var(--cb-text);
}

.event-card-meta { font-size: 12px; color: var(--cb-text-muted); margin-top: 4px; }

.event-card-status {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-draft { background: #F3F4F6; color: var(--cb-text-muted); }
.status-pending { background: #FEF3C7; color: #D97706; }
.status-active { background: #D1FAE5; color: #059669; }
.status-completed { background: #DBEAFE; color: var(--cb-blue); }

/* ============================================
   PAGE CONTAINER
   ============================================ */
.page-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 32px 24px;
}

.page-title {
    font-size: 24px;
    font-weight: 800;
    margin-bottom: 24px;
    color: var(--cb-text);
}

/* ============================================
   TABS
   ============================================ */
.tabs {
    display: flex;
    gap: 4px;
    border-bottom: 1px solid var(--cb-border);
    margin-bottom: 24px;
}

.tab {
    padding: 10px 20px;
    font-family: 'Manrope', sans-serif;
    font-weight: 600;
    font-size: 14px;
    color: var(--cb-text-muted);
    background: none;
    border: none;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: color 150ms ease-out, border-color 150ms ease-out;
}

.tab:hover { color: var(--cb-text-secondary); }
.tab.active { color: var(--cb-blue); border-bottom-color: var(--cb-blue); }

/* ============================================
   MULTI-SELECT & RADIO
   ============================================ */
.multi-select { display: flex; flex-wrap: wrap; gap: 8px; }

.multi-option {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border: 1px solid var(--cb-border);
    border-radius: 8px;
    cursor: pointer;
    transition: border-color 150ms ease-out;
    font-size: 13px;
    color: var(--cb-text);
    user-select: none;
}

.multi-option:hover { border-color: var(--cb-border-hover); }
.multi-option.selected { border-color: var(--cb-blue); background: var(--cb-blue-light); color: var(--cb-blue); font-weight: 600; }
.multi-option input[type="checkbox"] { display: none; }

.radio-group { display: flex; gap: 12px; }

.radio-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border: 1px solid var(--cb-border);
    border-radius: 8px;
    cursor: pointer;
    transition: border-color 150ms ease-out;
    font-size: 14px;
    color: var(--cb-text);
    flex: 1;
    justify-content: center;
}

.radio-option:hover { border-color: var(--cb-border-hover); }
.radio-option.selected { border-color: var(--cb-blue); background: var(--cb-blue-light); color: var(--cb-blue); font-weight: 600; }
.radio-option input[type="radio"] { display: none; }

/* ============================================
   PROGRESS
   ============================================ */
.progress-bar-bg {
    height: 6px;
    background: #F3F4F6;
    border-radius: 3px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: var(--cb-blue);
    border-radius: 3px;
    transition: width 300ms ease-out;
    width: 0%;
}

/* ============================================
   ADD BUTTON (dashed)
   ============================================ */
.add-btn-dashed {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px;
    border: 2px dashed var(--cb-border);
    border-radius: 8px;
    background: transparent;
    color: var(--cb-text-muted);
    font-family: 'Manrope', sans-serif;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: border-color 150ms ease-out, color 150ms ease-out;
    width: 100%;
}

.add-btn-dashed:hover { border-color: var(--cb-blue); color: var(--cb-blue); }

/* ============================================
   SCROLLBAR
   ============================================ */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #E4E8EB; border-radius: 3px; }

/* ============================================
   AUTH CENTER
   ============================================ */
.auth-center {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 16px;
    background: var(--cb-surface);
}

/* ============================================
   TOAST
   ============================================ */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    z-index: 1000;
    animation: slideIn 200ms ease-out;
}

.toast-success { background: #D1FAE5; color: #059669; border: 1px solid #A7F3D0; }
.toast-error { background: #FEE2E2; color: #DC2626; border: 1px solid #FECACA; }

@keyframes slideIn {
    from { transform: translateX(100px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* ============================================
   DARK MODE
   ============================================ */
[data-theme="dark"] {
    --cb-border: #2D3148;
    --cb-border-hover: #3D4168;
    --cb-text: #F1F5F9;
    --cb-text-secondary: #94A3B8;
    --cb-text-muted: #64748B;
    --cb-surface: #1A1D27;
    --cb-bg: #0F1117;
    --cb-blue-light: rgba(59, 130, 246, 0.15);
}

[data-theme="dark"] .status-draft { background: #1E2030; color: #94A3B8; }
[data-theme="dark"] .status-pending { background: #2D2010; color: #F59E0B; }
[data-theme="dark"] .status-active { background: #0D2010; color: #34D399; }
[data-theme="dark"] .status-completed { background: #0D1A30; color: #60A5FA; }
[data-theme="dark"] .toast-success { background: #0D2010; color: #34D399; border-color: #166534; }
[data-theme="dark"] .toast-error { background: #2D0D0D; color: #F87171; border-color: #7F1D1D; }
[data-theme="dark"] .progress-bar-bg { background: #1E2030; }
[data-theme="dark"] ::-webkit-scrollbar-thumb { background: #2D3148; }

/* Dark mode toggle button */
.theme-toggle {
    background: none;
    border: 1px solid var(--cb-border);
    color: var(--cb-text-muted);
    width: 34px;
    height: 34px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: border-color 150ms ease-out, color 150ms ease-out;
    flex-shrink: 0;
}

.theme-toggle:hover { border-color: var(--cb-blue); color: var(--cb-blue); }

/* ============================================
   BOOKING SPLIT LAYOUT
   ============================================ */
.booking-split {
    display: grid;
    grid-template-columns: 420px 1fr;
    gap: 28px;
    align-items: start;
    min-width: 0;
}

.booking-left, .booking-right {
    min-width: 0;
}

.booking-right {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* ============================================
   CALENDAR
   ============================================ */
.calendar-container { max-width: 100%; }

.cal-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.cal-month-label {
    font-size: 18px;
    font-weight: 700;
    color: var(--cb-text);
}

.cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 3px;
}

.cal-day-header {
    text-align: center;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--cb-text-muted);
    padding: 8px 0;
}

.cal-cell {
    min-height: 100px;
    border: 1px solid var(--cb-border);
    border-radius: 8px;
    padding: 8px 6px 6px;
    background: var(--cb-bg);
    transition: border-color 150ms ease-out;
    overflow: hidden;
    vertical-align: top;
}

.cal-cell-empty { background: transparent; border-color: transparent; }

.cal-today { border-color: var(--cb-blue); }

.cal-cell:not(.cal-cell-empty):hover { border-color: var(--cb-border-hover); background: var(--cb-surface); }

.cal-day-num {
    font-size: 12px;
    font-weight: 600;
    color: var(--cb-text-secondary);
    margin-bottom: 5px;
    line-height: 1;
}

.cal-today .cal-day-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    background: var(--cb-blue);
    color: #fff;
    border-radius: 50%;
    font-size: 11px;
    font-weight: 800;
    margin-bottom: 5px;
}

.cal-event-chip {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: var(--cb-blue);
    background: var(--cb-blue-light);
    border-left: 2px solid var(--cb-blue);
    border-radius: 3px;
    padding: 2px 5px;
    margin-bottom: 2px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    cursor: pointer;
    transition: background 100ms ease-out;
}

.cal-event-chip:hover { background: rgba(59, 130, 246, 0.18); }

.cal-chip-time {
    opacity: 0.7;
    font-weight: 700;
    margin-right: 3px;
}

/* Day detail panel */
.cal-detail {
    margin-top: 16px;
    border: 1px solid var(--cb-border);
    border-radius: 12px;
    overflow: hidden;
}

.cal-detail-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--cb-surface);
    border-bottom: 1px solid var(--cb-border);
    font-weight: 700;
    font-size: 14px;
    color: var(--cb-text);
}

.cal-detail-row {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--cb-border);
}

.cal-detail-row:last-child { border-bottom: none; }

.cal-detail-time {
    font-size: 13px;
    font-weight: 700;
    color: var(--cb-blue);
    white-space: nowrap;
    min-width: 120px;
}

.cal-detail-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--cb-text);
    flex: 1;
}

/* ============================================
   DASHBOARD / KPI
   ============================================ */
.kpi-row {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
    margin-bottom: 24px;
}

.kpi-card {
    background: var(--cb-bg);
    border: 1px solid var(--cb-border);
    border-radius: 12px;
    padding: 20px 16px;
    text-align: center;
}

.kpi-value {
    font-size: 36px;
    font-weight: 800;
    color: var(--cb-blue);
    line-height: 1;
    margin-bottom: 6px;
}

.kpi-label {
    font-size: 11px;
    font-weight: 700;
    color: var(--cb-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.charts-row {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 20px;
}

.chart-card { padding: 24px; }

.chart-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--cb-text);
    margin-bottom: 20px;
}

/* ============================================
   RESPONSIVE
   ============================================ */

/* Medium — tablet / half-screen window */
@media (max-width: 1080px) {
    .booking-split {
        grid-template-columns: 1fr 1fr;
        gap: 20px;
    }

    .kpi-row {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Small — narrow window / large mobile */
@media (max-width: 768px) {
    .page-container {
        padding: 20px 16px;
    }

    .booking-split {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .charts-row {
        grid-template-columns: 1fr;
    }

    .kpi-row {
        grid-template-columns: repeat(2, 1fr);
    }

    .cal-cell {
        min-height: 64px;
        padding: 4px;
    }

    .cal-day-header {
        font-size: 9px;
        padding: 6px 0;
    }

    .cal-day-num {
        font-size: 11px;
    }

    .cal-event-chip {
        font-size: 9px;
        padding: 1px 4px;
    }

    .cal-month-label {
        font-size: 15px;
    }

    .tabs {
        gap: 0;
    }

    .tab {
        padding: 10px 14px;
        font-size: 13px;
    }

    .top-nav {
        padding: 12px 16px;
    }

    .top-nav-logo {
        height: 28px;
    }

    .datetime-grid {
        grid-template-columns: 1fr;
    }
}

/* Extra small — mobile */
@media (max-width: 480px) {
    .kpi-row {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .kpi-value {
        font-size: 28px;
    }

    .kpi-card {
        padding: 16px 12px;
    }

    .cal-grid {
        gap: 2px;
    }

    .cal-cell {
        min-height: 52px;
    }

    .cal-event-chip {
        font-size: 8px;
    }
}
