﻿/* ===================================================================
   DVL Phoenix Styles
   Central stylesheet for consistent styling across the application
   =================================================================== */

/* ===================================================================
   CSS Variables - Centralized theme configuration
   =================================================================== */
:root {
  /* Layout dimensions */
  --top-nav-height: 62.5px;
  --ballot-header-height: 80px;
  --footer-height: 60px;
  --left-nav-width: 240px;
  --left-nav-offset: var(--left-nav-width);
  /* Brand colors */
  --sbs-orange: #e8691d;
  --bs-link-color-rgb: 3, 102, 214;
  --bs-link-color: #0366d6;
  /* Common colors for consistency */
  --color-primary: #0d6efd;
  --color-secondary: #6c757d;
  --color-success: #198754;
  --color-danger: #dc3545;
  --color-warning: #ffc107;
  --color-info: #0dcaf0;
  --color-light: #f8f9fa;
  --color-dark: #212529;
  /* Gray scale */
  --gray-100: #f8f9fa;
  --gray-200: #e9ecef;
  --gray-300: #dee2e6;
  --gray-400: #ced4da;
  --gray-500: #adb5bd;
  --gray-600: #6c757d;
  --gray-700: #495057;
  --gray-800: #343a40;
  --gray-900: #212529;
  /* Border colors */
  --border-color: #dee2e6;
  --border-color-light: #e5e5e5;
  /* Background colors */
  --bg-light: #f5f5f5;
  --bg-white: #ffffff;
  /* Shadows */
  --box-shadow-sm: 0 .125rem .25rem rgba(0, 0, 0, .075);
  --box-shadow: 0 .25rem .75rem rgba(0, 0, 0, .05);
  --box-shadow-md: 0 2px 8px rgba(0, 0, 0, 0.1);
  --box-shadow-lg: 0 4px 12px rgba(0, 0, 0, 0.15);
  /* Spacing */
  --spacing-xs: 0.25rem;
  --spacing-sm: 0.5rem;
  --spacing-md: 1rem;
  --spacing-lg: 1.5rem;
  --spacing-xl: 2rem;
  /* Border radius */
  --border-radius-sm: 0.25rem;
  --border-radius: 0.375rem;
  --border-radius-lg: 0.5rem;
  --border-radius-xl: 8px;
  /* Transitions */
  --transition-fast: 0.15s ease-in-out;
  --transition-base: 0.3s ease;
}

@media screen and (max-width: 576px) {
  :root {
    --left-nav-offset: 1.5em;
    --left-nav-width: 100%;
  }
}

/* ===================================================================
   Base HTML Elements
   =================================================================== */
html {
    font-size: 14px;
    height: 100%;
    margin: 0;
    position: relative;
    min-height: 100%;
}

@media (min-width: 768px) {
    html {
        font-size: 16px;
    }
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    height: 100%;
    margin: 0;
}

body:has(.account-page) {
    background-color: var(--bg-light);
}

/* Links */
a {
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

td > a.whole-row {
    display: block;
}

td > a.whole-row:hover {
    text-decoration: none;
}

/* Table headers - dimmed styling */
th {
    color: var(--gray-600);
    font-weight: 400;
}

/* ===================================================================
   Layout Components
   =================================================================== */
.main-container {
    padding: 1rem 2em 4em;
    height: 100%;
    overflow-y: auto;
}

.main-wrapper {
    flex: 1 0 auto;
    padding-top: var(--top-nav-height);
    padding-bottom: var(--footer-height);
    min-height: 100vh;
    position: relative;
}

.footer {
    flex-shrink: 0;
    position: fixed;
    bottom: 0;
    width: 100%;
    white-space: nowrap;
    line-height: var(--footer-height);
    z-index: 1040; /* Reduced from 1500 to be below modal */
    background-color: var(--bg-white);
}

/* Vote page specific layout */
.main-container.vote-layout {
    max-width: calc(100% - var(--left-nav-offset));
    box-sizing: border-box;
    margin-left: var(--left-nav-offset);
    padding-left: 2em;
    padding-right: 2em;
}

main.vote-main {
    margin-top: calc(var(--top-nav-height) + 1em);
}

.vote-footer {
    position: absolute;
}

/* Center content utility */
.center-this {
    margin: auto;
    min-width: 20em;
}

/* ===================================================================
   Navigation Styles
   =================================================================== */
.navbar {
    box-sizing: border-box;
    max-width: 100%;
}

.navbar > .container,
.navbar > .container-fluid {
    box-sizing: border-box;
    max-width: 100%;
}

.navbar-brand {
    white-space: normal;
    text-align: center;
    word-break: break-all;
}

.navbar-toggler-borderless {
    border: none;
}

@media (max-width: 575px) {
    .navbar-brand {
        margin-right: 0;
    }
}

@media (max-width: 375px) {
    .navbar-brand {
        width: 50%;
    }
    .navbar-brand img {
        width: 100%;
    }
}

/* Navigation Icons */
.nav-icon {
    background: none;
    border: none;
    color: #6c757d;
    text-decoration: none;
    transition: color 0.15s ease-in-out;
}

.nav-icon:hover {
    color: var(--sbs-orange);
}

.nav-icon:focus {
    outline: none;
    color: var(--sbs-orange);
}

/* Hamburger Menu Toggle Button */
.hamburger-toggle {
    background: none;
    border: none;
    color: #6c757d;
    font-size: 1.5rem;
    padding: 0.25rem 0.5rem;
    transition: color 0.15s ease-in-out;
}

.hamburger-toggle:hover {
    color: var(--sbs-orange);
}

.hamburger-toggle:focus {
    outline: none;
    color: var(--sbs-orange);
}

/* Welcome message styling */
.navbar-text {
    color: #495057 !important;
    font-weight: 500;
}

/* Hamburger Menu Styles */
.offcanvas-body .navbar-nav {
    flex-direction: column;
    width: 100%;
}

.offcanvas-body .nav-item {
    width: 100%;
}

.offcanvas-body .nav-link {
    padding: 0.75rem 1rem;
    border-radius: 0.375rem;
    margin-bottom: 0.25rem;
    color: #495057;
    transition: all 0.15s ease-in-out;
}

.offcanvas-body .nav-link:hover {
    background-color: #f8f9fa;
    color: var(--sbs-orange);
}

.offcanvas-body .nav-link.active {
    background-color: var(--sbs-orange);
    color: white;
}

.offcanvas-body .nav-link i {
    width: 1.25rem;
}

/* ===================================================================
   Description Lists
   =================================================================== */
.main-container dl.row,
.account-page dl.row {
    margin-bottom: var(--spacing-sm);
}

.main-container dl.row dd,
.account-page dl.row dd {
    margin-bottom: 0;
}

/* ===================================================================
   Mobile Adjustments
   =================================================================== */
@media (max-width: 768px) {
    .account-page {
        padding: var(--spacing-md);
    }
    
    .account-page form,
    .account-page .external-auth {
        padding: var(--spacing-lg);
    }
    
    .main-container {
        padding: var(--spacing-md);
    }
    
    /* Hide welcome message on small screens */
    .navbar-text {
        display: none !important;
    }
}

/* ===================================================================
   Offcanvas Components
   =================================================================== */
.offcanvas-top {
    color: var(--bs-success-text-emphasis);
    background-color: var(--bs-success-bg-subtle);
    border-color: var(--bs-success-border-subtle);
    height: fit-content !important;
}

.offcanvas-body {
    height: fit-content !important;
}

/* ===================================================================
   Vote Page Components
   =================================================================== */
.option-button {
    flex: 1 1 auto !important;
    border-left: none !important;
    border-top: none !important;
    border-bottom: none !important;
    border-radius: unset;
    box-shadow: none !important;
    font-size: 1.2rem !important;
    padding: .8rem !important;
    padding-left: 1.2rem !important;
    padding-right: 1.2rem !important;
}

.option-button:focus {
    border-color: var(--bs-border-color) !important;
}

.bio-button {
    border-top: none !important;
    border-bottom: none !important;
    border-right: none !important;
    font-size: 1.1rem !important;
    padding: .8rem !important;
}

li.allow-rounded-corners {
    overflow: hidden;
}

.write-in > button {
    flex-basis: content !important;
    flex-grow: 0 !important;
    flex-wrap: nowrap;
}

.write-in > input {
    flex-grow: 1 !important;
    margin-left: unset !important;
    border: none;
    border-left-style: solid;
    border-left-width: 1px;
    border-left-color: rgb(222, 226, 230);
}

.write-in > input:focus {
    border-radius: unset !important;
    color: var(--bs-body-color);
    background-color: var(--bs-body-bg);
    border-color: #86b7fe;
    outline: 0;
    z-index: 1000;
}

@media (max-width: 767px) {
    .btn {
        font-size: 1.2rem;
        padding: .8rem;
    }
    
    .option-button {
        padding-left: .8rem !important;
    }
}

#app {
    padding-bottom: 3em;
}

/* ===================================================================
   Form Styles
   =================================================================== */
.form-group {
    margin-top: .3em;
    margin-bottom: var(--spacing-md);
}

.form-group label:not(.form-check-label) {
    margin-bottom: 0.3rem;
    display: block;
    font-weight: 500;
}

.form-group input:not([type="checkbox"]),
.form-group select,
.form-group textarea {
    margin-top: var(--spacing-xs);
}

.form-group .form-check {
    margin-top: var(--spacing-sm);
}

.form-group .form-check-label {
    font-weight: normal;
    margin-bottom: 0;
    display: inline-block;
}

.form-check-input:disabled ~ .form-check-label, .form-check-input[disabled] ~ .form-check-label {
  opacity: 1;
}

.form-group .text-danger {
    margin-top: var(--spacing-xs);
    font-size: 0.875rem;
}

/* Compact form-floating styles */
.form-floating-compact > input.form-control-plaintext,
.form-floating-compact > input.form-control {
    padding-top: 0.4rem !important;
    padding-bottom: 0.3rem !important;
    min-height: auto !important;
    line-height: 1rem !important;
    height: 3rem !important;
}

.form-floating-compact > label {
    padding-top: 0.2rem !important;
    padding-bottom: 0.2rem !important;
    z-index: -1;
}

.label-above {
  padding: .75rem;
}

  .label-above > label {
    display: block;
  }

  .label-above > .label-above-label {
    color: rgba(var(--bs-body-color-rgb), .65);
    font-weight: 400;
    font-size: .85rem;
  }

  .label-above > .label-above-data {
    line-height: 1rem;
  }

/*.label-above > input {
    width: auto !important;
    max-width: 100%;
    display: inline-block;
  }*/
/* ===================================================================
   Utility Classes
   =================================================================== */
.clickable {
  cursor: pointer;
}

.border-top {
    border-top: 1px solid var(--border-color-light);
}

.border-bottom {
    border-bottom: 1px solid var(--border-color-light);
}

.box-shadow {
    box-shadow: var(--box-shadow);
}

.box-shadow-sm {
    box-shadow: var(--box-shadow-sm);
}

.box-shadow-md {
    box-shadow: var(--box-shadow-md);
}

.box-shadow-lg {
    box-shadow: var(--box-shadow-lg);
}

.sbs-orange-font {
    color: var(--sbs-orange);
}

/* Results data container */
.results-data {
    width: 20em;
}

/* Common width utilities */
.w-2em {
    width: 2em;
}

.w-8em {
    width: 8em;
}

.w-20em {
    width: 20em;
}

.w-32rem {
    width: 32rem;
}

.w-auto {
    width: auto;
}

/* Display utilities */
.d-inline-block-vtop {
    display: inline-block;
    vertical-align: top;
}

/* Text alignment */
.text-center {
    text-align: center;
}

/* Color utilities */
.text-primary-blue {
    color: var(--color-primary);
}

.text-danger-bold {
    font-weight: bold;
    color: var(--color-danger);
}

/* Opacity utilities */
.opacity-40 {
    opacity: 0.4;
}

/* Icon handle style */
.icon-handle {
    opacity: 0.4;
    margin-right: 0.6em;
    cursor: pointer;
}

/* Font size utilities */
.fs-1-3rem {
    font-size: 1.3rem;
}

/* Z-index utilities */
.z-1000 {
    z-index: 1000;
}

/* ===================================================================
   Ballot Layout Components - Updated for Fixed Layout
   =================================================================== */

/* Fixed layout for ballot pages */
.ballot-layout-wrapper {
  position: fixed;
  top: var(--top-nav-height);
  left: 0;
  right: 0;
  bottom: var(--footer-height);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Remove main-container padding for ballot layout */
.ballot-layout-wrapper .main-container,
.main-container:has(.ballot-layout-wrapper) {
    padding: 0 !important;
}

/* Remove container-fluid gutters for ballot layout */
.ballot-layout-wrapper .container-fluid {
    padding-left: 0;
    padding-right: 0;
}

/* Remove row gutters for ballot layout */
.ballot-layout-wrapper .row {
    margin-left: 0;
    margin-right: 0;
}

  /* Prevent any ballot layout elements from interfering */
  .ballot-layout-wrapper.modal-open {
    position: relative;
    z-index: auto;
  }

.ballot-header {
  position: fixed;
  top: var(--top-nav-height);
  left: 0;
  right: 0;
  z-index: 1020; /* Reduced from 1040 to be below modal */
  background-color: var(--gray-100);
  border-bottom: 1px solid var(--border-color);
  padding: var(--spacing-sm) var(--spacing-md);
  height: var(--ballot-header-height);
  flex-shrink: 0;
}

.ballot-main-container {
  display: flex;
  flex: 1;
  margin-top: var(--ballot-header-height);
  overflow: hidden;
}

.ballot-sidebar {
  position: fixed;
  left: 0;
  top: calc(var(--top-nav-height) + var(--ballot-header-height));
  bottom: var(--footer-height);
  width: 250px;
  background-color: var(--bg-white);
  border-right: 1px solid var(--border-color);
  padding: var(--spacing-md);
  overflow-y: auto;
  z-index: 1010; /* Reduced from 1030 to be below modal */
}

.ballot-nav-container {
  height: 100%;
  overflow-y: auto;
}

.ballot-nav-container h6 {
    padding-left: 0;
    padding-right: 0;
}

.ballot-nav {
    list-style: none;
    padding: 0;
    margin: 0;
}

.ballot-nav-item {
    margin-bottom: 0; /*var(--spacing-xs);*/
}

.ballot-nav-link {
    display: block;
    padding: 0.75rem 1rem;
    color: var(--gray-700);
    text-decoration: none;
    border-radius: var(--border-radius);
    margin: 0;
    transition: all var(--transition-fast);
}

.ballot-nav-link:hover {
    background-color: var(--gray-100);
    color: var(--color-primary);
    text-decoration: none;
}

.ballot-nav-link.active {
    background-color: var(--color-primary);
    color: white;
}

.ballot-nav-link i {
    width: 20px;
    margin-right: var(--spacing-sm);
}

.ballot-content {
  flex: 1;
  margin-left: 250px;
  padding: var(--spacing-md) var(--spacing-lg);
  overflow-y: auto;
  height: calc(100vh - var(--top-nav-height) - var(--ballot-header-height) - var(--footer-height));
}

.ballot-name {
    color: var(--color-primary);
    font-weight: 600;
    margin-bottom: 0;
}

.ballot-breadcrumb {
    font-size: 0.875rem;
    color: var(--gray-600);
}

/* Mobile responsiveness for fixed layout */
@media (max-width: 768px) {
    .ballot-sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease-in-out;
    }
    
    .ballot-sidebar.show {
        transform: translateX(0);
    }
    
    .ballot-content {
        margin-left: 0;
        width: 100%;
    }
    
    .mobile-nav-toggle {
        display: block;
    }
}

@media (min-width: 769px) {
    .mobile-nav-toggle {
        display: none;
    }
}

/* Ensure modals appear above all ballot layout elements */
.modal {
  z-index: 1055 !important;
}

.modal-backdrop {
  z-index: 1050 !important;
}

/* Force modal dialog to be above backdrop */
.modal-dialog {
  z-index: 1056 !important;
}

/* Ensure modal content is interactive */
.modal-content {
  position: relative;
  z-index: 1057 !important;
  pointer-events: auto;
}

/* Ensure modal is always on top and interactive */
.modal.show {
  display: block !important;
  z-index: 1055 !important;
}

  .modal.show .modal-dialog {
    z-index: 1056 !important;
    pointer-events: auto;
  }

  .modal.show .modal-content {
    z-index: 1057 !important;
    pointer-events: auto;
    position: relative;
  }

/* Dashboard specific styles */
.dashboard-container {
    min-height: fit-content;
    position: relative;
}

.ballot-details-panel {
    background: linear-gradient(135deg, var(--gray-100) 0%, var(--gray-200) 100%);
    border-left: 1px solid var(--border-color);
    min-height: fit-content;
}

.ballot-details-panel .alert {
    word-wrap: break-word;
    word-break: break-word;
    hyphens: auto;
}

.ballot-details-panel .form-control-plaintext {
    word-wrap: break-word;
    word-break: break-word;
    white-space: normal;
}

.main-dashboard {
    padding: 2rem;
    padding-top: 0;
    padding-left: 1rem;
}

.dashboard-card {
    border: none;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: all var(--transition-base);
    height: 100%;
    min-height: 400px;
    display: flex;
    flex-direction: column;
}

.dashboard-card:hover {
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.2);
    transform: translateY(-2px);
}

.dashboard-card .card-body {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.dashboard-card .card-content {
    flex-grow: 1;
}

.dashboard-card .card-buttons {
    margin-top: auto;
    padding-top: 1rem;
}

.card-header-primary {
    background: linear-gradient(135deg, #0066cc 0%, #004499 100%);
    color: white;
    border: none;
}

.card-header-orange {
    background: linear-gradient(135deg, #ff8c00 0%, #ff6600 100%);
    color: white;
    border: none;
}

/* Enhanced Status Indicators */
.status-indicator {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 8px;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.8);
    animation: subtle-pulse 2s ease-in-out infinite;
}

@keyframes subtle-pulse {
    0%, 100% { box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.8); }
    50% { box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.4); }
}

.status-indicator.open {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.status-indicator.closed {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

.status-indicator.scheduled {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
}

/* ===================================================================
   Service Selection & Payment Flow Components
   =================================================================== */

/* Service tier cards */
.tier-card {
    transition: all var(--transition-base);
    cursor: pointer;
    border: 2px solid var(--border-color);
}

.tier-card:hover:not(.disabled) {
    transform: translateY(-2px);
    box-shadow: var(--box-shadow-lg);
    border-color: var(--color-primary);
}

.tier-card.selected,
.tier-card.active {
    border-color: var(--color-primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(13, 110, 253, 0.25);
    background-color: #f8f9fa;
}

.tier-card.current-tier {
    border-color: var(--color-success);
    background-color: #f8fff9;
}

.tier-card.disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.tier-card.recommended {
    border-color: var(--color-primary);
}

/* Tier card content */
.tier-card .price-display {
    font-size: 2rem;
    font-weight: bold;
    color: var(--color-primary);
    margin: var(--spacing-md) 0;
}

.tier-card .current-plan-badge {
    background: var(--color-success);
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: bold;
}

/* Feature lists with icons - Reusable across project */
.icon-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.icon-list-item {
    display: flex;
    align-items: start;
    margin-bottom: var(--spacing-sm);
}

.icon-list-item-icon {
    flex-shrink: 0;
    margin-right: var(--spacing-sm);
    font-size: 0.875rem;
}

.icon-list-item-text {
    font-size: 0.875rem;
    line-height: 1.4;
}

/* Icon colors for lists */
.icon-success {
    color: var(--color-success);
}

.icon-info {
    color: var(--color-info);
}

.icon-warning {
    color: var(--color-warning);
}

/* Voter/Ballot summary banner */
.summary-banner {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: var(--border-radius-xl);
    padding: var(--spacing-lg);
    margin-bottom: var(--spacing-xl);
}

.summary-banner h4,
.summary-banner p,
.summary-banner strong {
    color: white;
}

.summary-banner h4 {
    font-weight: 600;
    margin-bottom: var(--spacing-xs);
}

.summary-banner p {
    margin-bottom: 0;
}

.summary-banner strong {
    font-weight: 700;
}

.summary-banner small {
    color: rgba(255, 255, 255, 0.9);
}

.summary-banner .summary-icon {
    color: rgba(255, 255, 255, 0.3);
    font-size: 3rem;
}

/* Email selector card */
.email-selector-card {
    background: var(--gray-100);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
}

.email-selector-card .card-header {
    background: var(--color-info);
    color: white;
    border-bottom: none;
}

.email-cost-display {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-sm);
    background-color: var(--gray-100);
    border-radius: var(--border-radius);
}

.email-cost-label {
    font-size: 0.875rem;
    font-weight: 600;
}

.email-cost-value {
    font-weight: bold;
    color: var(--color-primary);
}

/* Order summary card */
.order-summary-card {
    position: sticky;
    top: var(--spacing-lg);
}

.order-summary-card .card-header {
    background: var(--color-primary);
    color: white;
    border-bottom: none;
}

.summary-line-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: var(--spacing-sm);
    font-size: 0.9375rem;
}

.summary-line-item.total {
    font-weight: bold;
    font-size: 1.0625rem;
    padding-top: var(--spacing-sm);
    border-top: 1px solid var(--border-color);
}

.summary-line-item.muted {
    color: var(--gray-600);
    font-size: 0.875rem;
}

/* Payment status alerts */
.payment-status-alert {
    margin-bottom: var(--spacing-lg);
    border-radius: var(--border-radius);
}

/* Email requirement notice */
.email-requirement-notice {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: var(--border-radius);
    padding: var(--spacing-sm) var(--spacing-md);
    font-size: 0.875rem;
    color: #856404;
    margin-top: var(--spacing-sm);
}

/* Small text utility */
.text-small {
    font-size: 0.875rem;
}

.text-tiny {
    font-size: 0.75rem;
}

/* Font weight utilities */
.fw-medium {
    font-weight: 500;
}

.fw-semibold {
    font-weight: 600;
}

/* ===================================================================
   Legacy Payment Components (Keep for backward compatibility)
   =================================================================== */
.payment-summary {
    background: var(--gray-100);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: var(--spacing-lg);
    margin-bottom: var(--spacing-xl);
}

.payment-item {
    display: flex;
    justify-content: space-between;
    padding: var(--spacing-sm) 0;
    border-bottom: 1px solid var(--gray-200);
}

.payment-item:last-child {
    border-bottom: none;
    font-weight: bold;
    font-size: 1.1rem;
}

.spinner {
    display: none;
    text-align: center;
    margin-top: var(--spacing-md);
}

.error-message {
    color: var(--color-danger);
    margin-top: var(--spacing-md);
    text-align: center;
}

/* Success page */
.success-container {
    min-height: calc(100vh - var(--top-nav-height) - var(--footer-height));
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-xl);
    width: 100%;
    margin: 0 auto;
    text-align: center;
}

.success-card {
    max-width: 800px;
    width: 100%;
    border: none;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    border-radius: 10px;
}

.success-icon {
    font-size: 4rem;
    color: var(--color-success);
    display: block;
    text-align: center;
    margin-bottom: var(--spacing-md);
}

.next-steps {
    background: var(--gray-100);
    border-radius: var(--border-radius-xl);
    padding: 20px;
    margin-top: 30px;
}

.feature-list {
    text-align: left;
    max-width: 400px;
    margin: 0 auto;
}

/* Tier cards (Legacy - keeping for backward compatibility) */
.tier-card.recommended::before {
    content: "Recommended";
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--color-success);
    color: white;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: bold;
}

.recommended-badge {
    position: absolute;
    top: -12px;
    right: 20px;
    background: var(--color-success);
    color: white;
    padding: var(--spacing-xs) var(--spacing-md);
    border-radius: var(--border-radius-lg);
    font-size: 0.875rem;
    font-weight: bold;
}

.price-display {
    font-size: 2rem;
    font-weight: bold;
    color: #007bff;
}

.summary-card {
    position: sticky;
    top: 20px;
}

.voter-summary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 30px;
}

.voter-summary h4 {
  color: white;
  font-weight: 600;
}

.voter-summary p {
  color: white;
  margin-bottom: 0;
}

.voter-summary strong {
  color: white;
  font-weight: 700;
}

.voter-summary small {
  color: rgba(255, 255, 255, 0.9);
}

.voter-summary .bi-people-fill {
  color: rgba(255, 255, 255, 0.3);
}

.email-selector {
    background: var(--gray-100);
    border-radius: var(--border-radius-xl);
    padding: 20px;
    margin: 20px 0;
}

.current-plan-badge {
    background: var(--color-success);
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: bold;
}
.email-requirement-notice {
  background: #fff3cd;
  border: 1px solid #ffeaa7;
  border-radius: 4px;
  padding: 8px 12px;
  margin-top: 10px;
  font-size: 0.875rem;
  color: #856404;
}

/* ===================================================================
   Account Pages
   =================================================================== */
.account-page {
  width: 100%;
  min-height: 100%;
  padding: var(--spacing-md) var(--spacing-xl);
  background-color: var(--bg-light);
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: var(--top-nav-height);
  padding-bottom: calc(var(--footer-height) + var(--spacing-md));
}

  .account-page section {
    width: 100%;
    max-width: 600px;
    display: flex;
    flex-direction: column;
    align-items: center;
  }

    .account-page section:not(:last-child) {
      margin-bottom: var(--spacing-md);
    }

  .account-page form,
  .account-page .external-auth {
    width: 100%;
    max-width: 600px;
    background-color: var(--bg-white);
    padding: 1.25rem;
    border-radius: var(--border-radius-xl);
    box-shadow: var(--box-shadow-md);
  }

  .account-page .external-auth {
    margin-top: var(--spacing-md);
    padding: var(--spacing-md);
  }

  .account-page .form-group {
    margin-bottom: 0.75rem;
  }

    .account-page .form-group:last-child {
      margin-bottom: 0;
    }

  .account-page form .mt-2,
  .account-page .external-auth .mt-2,
  .account-page section .mt-2 {
    margin-top: 0.75rem;
  }

  .account-page .mt-2 p {
    margin-bottom: var(--spacing-xs);
  }

    .account-page .mt-2 p:last-child {
      margin-bottom: 0;
    }

  .account-page .external-auth h4 {
    font-size: 1rem;
    margin-bottom: var(--spacing-sm);
  }

  .account-page .external-auth hr {
    margin: var(--spacing-sm) 0;
  }

  .account-page .external-auth form {
    padding: 0;
    box-shadow: none;
  }

  .account-page h1 {
    text-align: center;
    margin-bottom: var(--spacing-md);
    color: #333;
    width: 100%;
    max-width: 600px;
  }

  .account-page .btn {
    width: 100%;
  }

  .account-page dl.row {
    margin-bottom: var(--spacing-sm);
  }

    .account-page dl.row dd {
      margin-bottom: 0;
    }

/* ===================================================================
   Select2 Components
   =================================================================== */
.select2-container--bootstrap-5 .select2-selection {
  height: calc(1.5em + 0.75rem + 2px);
  padding: 0.375rem 0.75rem;
}

/* ===================================================================
   Stripe Components
   =================================================================== */
#root > div {
  background-color: var(--bg-white) !important;
}

/* ===================================================================
   Bootstrap Overrides
   =================================================================== */
/* Remove up/down arrows in Firefox for read-only number inputs */
div.form-floating > input[type="number"]:read-only {
  -moz-appearance: textfield;
}

button.accept-policy {
  font-size: 1rem;
  line-height: inherit;
}

.btn-primary {
  color: var(--bg-white);
  background-color: #1b6ec2;
  border-color: #1861ac;
}

/* ===================================================================
   Ballot Members Components
   =================================================================== */

/* Table styling for ballot members */
th,
th > a {
  font-weight: 500;
  color: var(--bs-body-color) !important;
}

/*.table tbody tr {
  cursor: pointer;
}*/

/* Search container styling */
.search-container {
  position: relative;
}

/* Selected member display styling - appears inside the input */
.selected-member-display {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  left: 8px;
  background: #e3f2fd;
  border: 1px solid #2196f3;
  border-radius: 15px;
  padding: 2px 8px;
  display: inline-flex;
  align-items: center;
  z-index: 2;
  white-space: nowrap;
  font-size: 0.875rem;
  max-width: calc(100% - 16px);
}

.selected-member-text {
  cursor: pointer;
  color: #1976d2;
  padding: 0 4px;
  border-radius: 3px;
  transition: all 0.15s ease-in-out;
  font-weight: 500;
}

  .selected-member-text:hover {
    background-color: rgba(25, 118, 210, 0.1);
  }

.clear-selection-btn {
  background: none;
  border: none;
  color: #1976d2;
  font-size: 1em;
  cursor: pointer;
  padding: 0;
  margin-left: 4px;
  line-height: 1;
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

  .clear-selection-btn:hover {
    background-color: rgba(220, 53, 69, 0.1);
    color: #dc3545;
  }

/* Modify input when member is selected */
.search-input-with-selection {
  padding-left: 8px;
  cursor: text;
}

  .search-input-with-selection::placeholder {
    color: transparent;
  }

/* Input styling for clickable area */
.search-input-clickable-area {
  position: relative;
  cursor: text;
}

/* Autocomplete dropdown styling */
#autocomplete-list {
  background-color: #f8f9fa;
  border: 1px solid #dee2e6;
  border-radius: 0.375rem;
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
  max-height: 300px;
  overflow-y: auto;
  overflow-x: hidden; /* Prevent horizontal scrolling */
}

  #autocomplete-list .list-group-item {
    background-color: #f8f9fa;
    border: none;
    border-bottom: 1px solid #e9ecef;
    transition: all 0.15s ease-in-out;
    cursor: pointer;
    user-select: none;
  }

    #autocomplete-list .list-group-item:hover {
      background-color: #e9ecef;
      color: #495057;
      cursor: pointer;
      box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    }

    #autocomplete-list .list-group-item:first-child {
      background-color: #e3f2fd;
      border-left: 3px solid #2196f3;
      font-weight: 500;
      position: relative;
    }

      #autocomplete-list .list-group-item:first-child::after {
        content: "⏎";
        position: absolute;
        right: 8px;
        top: 50%;
        transform: translateY(-50%);
        color: #2196f3;
        font-size: 0.875rem;
        font-weight: normal;
      }

      #autocomplete-list .list-group-item:first-child:hover {
        background-color: #bbdefb;
        cursor: pointer;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
      }

    #autocomplete-list .list-group-item:last-child {
      border-bottom: none;
    }

/* Style for disabled links */
.link-disabled {
  color: #6c757d !important;
  pointer-events: none;
  text-decoration: none;
  cursor: not-allowed;
}

/* Edit icon styling */
.edit-icon {
  color: #0d6efd;
  font-size: 1.1rem;
  transition: all 0.15s ease-in-out;
  text-decoration: none;
}

  .edit-icon:hover {
    color: #0a58ca;
    transform: scale(1.1);
  }

  .edit-icon.disabled {
    color: #6c757d;
    pointer-events: none;
    cursor: not-allowed;
  }

    .edit-icon.disabled:hover {
      transform: none;
    }

/* Modal CSS with smooth fade animations but no flickering */
.modal {
  transition: opacity 0.15s ease-in-out !important;
}

  .modal.fade .modal-dialog {
    /* No transform animation to prevent drop-in effect */
    transition: none !important;
    transform: none !important;
  }

  .modal.show .modal-dialog {
    transform: none !important;
  }

/* Smooth backdrop fade */
.modal-backdrop {
  transition: opacity 0.15s ease-in-out !important;
}

  .modal-backdrop.fade {
    transition: opacity 0.15s ease-in-out !important;
  }

/* Prevent flickering of page elements */
.modal-content {
  backface-visibility: hidden;
  transform: translateZ(0);
}

.modal-body {
  backface-visibility: hidden;
  transform: translateZ(0);
}

/* Stabilize gray elements that flicker */
.table thead th,
.table thead th a,
.text-muted,
.bg-light,
.pagination,
.form-select {
  backface-visibility: hidden;
  transform: translateZ(0);
}

/* Ensure proper z-index without flickering */
.modal.show {
  z-index: 1055 !important;
}

.modal-backdrop.show {
  z-index: 1050 !important;
}
/* ===================================================================
   Status Badge Styles - Reusable across application
   =================================================================== */

.status-badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.875rem;
  font-weight: 500;
}

  .status-badge.complete {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
  }

  .status-badge.incomplete {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
  }

  .status-badge.pending {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
  }

/* Status classes for consistent status coloring across app */
.status-success {
  background-color: #28a745 !important;
}

.status-warning {
  background-color: #ffc107 !important;
}

.status-danger {
  background-color: #dc3545 !important;
}

.status-info {
  background-color: #17a2b8 !important;
}
/* custom modal size for payment modals - approximately 50% wider than modal-lg */
.modal-xxl {
  --bs-modal-width: 1500px;
}

@media (max-width: 1366px) {
  .modal-xxl {
    --bs-modal-width: 1100px; /* Slightly smaller for laptop screens */
  }
}

@media (max-width: 1200px) {
  .modal-xxl {
    --bs-modal-width: 95%; /* Responsive width for tablets */
  }
}

@media (max-width: 768px) {
  .modal-xxl {
    --bs-modal-width: 100%; /* Full width on mobile */
  }
}

/* ===================================================================
   List & Scrollable Components
   =================================================================== */

/* Scrollable lists with proper overflow handling */
.scrollable-list {
  max-height: 200px;
  overflow-y: auto;
  overflow-x: hidden;
}

/* List item styling */
.list-item-clickable {
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.list-item-clickable:hover {
  background-color: var(--gray-100);
}

/* Subtle row striping for list items */
.list-item-striped:nth-child(even) {
  background-color: rgba(0, 0, 0, 0.02);
}

.list-item-striped:nth-child(even):hover {
  background-color: var(--gray-200);
}

/* Text truncation with ellipsis for long content */
.text-truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}