/* Zen Voter Registration System - Custom Styles */

:root {
    --primary-color: #44459a;
    --primary-dark: #2f3075;
    --primary-light: #6366b8;
    --secondary-color: #A8BA28;
    --secondary-dark: #8a9a1f;
    --secondary-light: #c4d456;
    --error-color: #d32f2f;
    --warning-color: #f57c00;
    --success-color: #388e3c;
    --info-color: #1976d2;
    --text-primary: #212121;
    --text-secondary: #757575;
    --background: #fafafa;
    --surface: #ffffff;
    --border-color: #e0e0e0;
}

body {
    font-family: 'Lato', sans-serif;
    margin: 0;
    padding: 0;
    background-color: var(--background);
    color: var(--text-primary);
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
}

.loading-splash {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-content {
    text-align: center;
}

.loading-content p {
    margin-top: 20px;
    font-family: 'Montserrat', sans-serif;
    color: var(--primary-color);
    font-size: 16px;
    font-weight: 500;
}

.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100vh;
}

#blazor-error-ui {
    background: #d32f2f;
    color: white;
    padding: 1rem;
    position: fixed;
    bottom: 0;
    width: 100%;
    z-index: 1000;
    display: none;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

.page-header {
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--primary-color);
}

.page-header h1 {
    color: var(--primary-color);
    margin: 0 0 8px 0;
    font-size: 28px;
}

.action-bar {
    margin-bottom: 16px;
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.mud-chip-text {
    color: white !important;
}

/* Responsive adjustments */
@media (max-width: 960px) {
    .page-header h1 {
        font-size: 24px;
    }

    .action-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .metric-card .metric-value {
        font-size: 24px;
    }
}

/* MudBlazor overrides for theme */
.mud-appbar {
    background-color: var(--primary-color) !important;
    color: white !important;
}

/* Global tab bar background color for all MudBlazor tabs */
.mud-tabs-tabbar {
    /* Soft INEXL green tint behind generic tab bars */
    background-color: #a8bc2812 !important;
}

.mud-drawer {
    background-color: #f5f5f5 !important;
}

.mud-nav-link-active {
    background-color: var(--primary-color) !important;
    color: white !important;
}

.mud-nav-link:hover {
    background-color: rgba(68, 69, 154, 0.1) !important;
}

.mud-button-filled.mud-button-filled-primary {
    background-color: var(--primary-color) !important;
}

.mud-button-filled.mud-button-filled-secondary {
    background-color: var(--secondary-color) !important;
}

.mud-button-outlined.mud-button-outlined-primary {
    border-color: var(--primary-color) !important;
    color: var(--primary-color) !important;
}

/* Voter tabs container background to match INEXL green scheme */
.voter-tabs-paper {
    /* very light green background */
    background-color: #f5f9e6 !important;
    display: flex;
    align-items: stretch;
    padding-top: 0;
    padding-bottom: 0;
}

/* Ensure the MudTabs toolbar inside the voter tabs uses the same background */
.voter-tabs-paper .mud-tabs-toolbar {
    background-color: #f5f9e6 !important;
    display: flex;
    align-items: center; /* vertically center tabs within the toolbar */
}

/* Match scroll buttons background and height to the tabs bar so ends are not white and not taller than tabs */
.voter-tabs-paper .mud-tabs-scroll-button {
    background-color: #f5f9e6 !important;
    height: 44px !important; /* same as .voter-step-tab height */
    display: flex !important;
    align-items: center !important; /* vertically center arrow icons */
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}

/* Ensure all tab bar containers share the same light green background */
.voter-tabs-paper .mud-tabs,
.voter-tabs-paper .mud-tabs-tabbar,
.voter-tabs-paper .mud-tabs-tabbar-inner,
.voter-tabs-paper .mud-tabs-tabbar-content,
.voter-tabs-paper .mud-tabs-tabbar-wrapper {
    background-color: #f5f9e6 !important;
    width: 100% !important;
}

/* Remove the default MudTabs active indicator line under the tabs */
.voter-tabs-paper .mud-tab-slider {
    background-color: transparent !important;
    height: 0 !important;
}

/* Voter detail step tabs - chevron flow styling using background shape */
.voter-step-tab {
    position: relative;
    padding: 0 !important;
    margin: 0 !important;
    border-radius: 0 !important;
    text-transform: none !important;
    font-weight: 500 !important;
    font-size: 0.8rem !important;
    min-width: 205px !important; /* ensure all tabs are at least as wide as the longest label */
    height: 44px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center;
    /* Tab content itself is centered; width is controlled by its wrapper */
    overflow: visible !important;
    /* Chevron-shaped background: flat left edge, pointed right edge */
    clip-path: polygon(0 0, calc(100% - 18px) 0, 100% 50%, calc(100% - 18px) 100%, 0 100%);
}

/* Tighten spacing between chevrons */
.mud-tabs .mud-tab.voter-step-tab {
    margin-right: 0 !important;
}

/* Make the tab wrappers share available width so there is no blank space */
.voter-tabs-paper .mud-tabs-tabbar-wrapper {
    display: flex !important;
    width: 100% !important;
}

.voter-tabs-paper .mud-tabs-tabbar-wrapper > .mud-tooltip-root {
    flex: 1 1 0;
}

/* Ensure the tab bar itself does not clip chevron shapes */
.mud-tabs-toolbar {
    overflow: visible !important;
}

/* Make the voter step tab bar fill its container and center tabs vertically */
.voter-tabs-paper .mud-tabs-tabbar {
    display: flex !important;
    align-items: center !important;
}

/* Collapse the panels area for the voter step tabs - content is handled by expansion panels below */
.voter-step-tabs .mud-tabs-panels {
    height: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    overflow: hidden !important;
}

/* Popover that lists validation errors for a voter step tab */
.step-error-popover {
    background-color: #f44336; /* match MudBlazor error/badge red */
    color: #ffffff;
    border-radius: 4px;
}

.step-error-popover .step-error-list {
    margin: 0;
    padding-left: 1.25rem;
}

.step-error-popover .step-error-list li {
    list-style-type: disc;
    font-size: 0.75rem;
}

/* Completed step - medium-light green background (between bar bg and active) */
.mud-tab.voter-step-tab-completed {
    background-color: #d9e7a8 !important; /* light/medium green */
    color: #3a3a1a !important;
}

/* Active tab background stands out but remains soft (keep INEXL green scheme) */
.mud-tab.voter-step-tab-active {
    background-color: #a8bc28 !important; /* INEXL primary green */
    color: #ffffff !important;
}

/* Incomplete step - same medium-light green as completed */
.mud-tab.voter-step-tab-incomplete {
    background-color: #e4f0bd !important;
    color: #4a4a1f !important;
}

/* Remove chevron point from the last step so it ends cleanly */
/* .mud-tabs .mud-tab:last-child.voter-step-tab {
    clip-path: unset;
} */

/* Secondary tabs (e.g., Residential / Mailing / Seasonal) - natural tab style */
.address-tabs .mud-tabs-tabbar {
    background-color: #ffffff !important;
    border-bottom: 2px solid #a8bc28; /* INEXL green underline across tab bar */
}

.address-tabs .mud-tab {
    text-transform: none !important;
    font-weight: 500 !important;
    font-size: 0.85rem !important;
    min-width: 160px !important;
    color: #666666 !important;
}

.address-tabs .mud-tab.mud-tab-active {
    color: #3a3a1a !important;
    background-color: #f5f9e6 !important; /* light green */
    border-top: 3px solid #a8bc28;
    border-left: 1px solid #e0e0e0;
    border-right: 1px solid #e0e0e0;
    border-bottom: 0;
    box-shadow: 0 -1px 0 #f5f9e6; /* visually connect to content card */
}

.address-tabs .mud-tab-slider {
    background-color: #a8bc28 !important; /* INEXL green underline */
    height: 3px !important;
}

.address-tabs .mud-tabs-tabbar-wrapper {
    align-items: flex-end;
}

/* Security grouping within Registration Detail */
.registration-security-frame {
    border: 2px solid #9e9e9e;
    border-radius: 4px;
    padding-top: 0;
    padding-bottom: 0;
}

/* Citizenship grouping within Eligibility section */
.eligibility-citizenship-frame {
    border: 2px solid #9e9e9e;
    border-radius: 4px;
    padding-top: 0;
    padding-bottom: 0;
    background-color: #f5f5f5;
}

.eligibility-citizenship-frame .eligibility-dpoc-select {
    margin-top: -6px;
}

/* Tighten vertical spacing for all rows in the Eligibility section */
.eligibility-grid .mud-grid-item {
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}

/* Voter Detail two-column layout: left form + right image viewer */
.voter-detail-layout {
    min-height: 0;
}

.voter-detail-main {
    min-width: 0;
}

.voter-detail-image-panel {
    width: 100%;
    min-width: 605px;
    max-width: 1330px;
    border-left: 1px solid var(--border-color);
    background-color: #f5f5f5;
    position: sticky;
    top: 80px; /* align just below the sticky tabs bar */
    align-self: flex-start;
}

.voter-detail-image-content {
    overflow: auto;
}

@media (max-width: 1200px) {
    .voter-detail-image-panel {
        display: none;
    }
}

.voter-detail-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    display: block;
}
