/* Freeish Custom Styles */

/* Custom Font */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Brand Colors and Layout Variables */
:root {
    /* Core palette */
    --color-bg: #ffffff;
    --color-surface: #f8f9fa;
    --color-primary: #42464D;
    --color-secondary: #32BEC0;
    --color-accent: #64A6E3;
    --color-danger: #D95C4B;
    --color-success: #5FAF5E;
    --color-primary-light: #d1d3d4;
    --color-secondary-light: #c5eaea;
    --color-primary-hover: #343a40;
    --color-secondary-hover: #20a39e;

      /* Text */
    --text-high: #121212;
    --text-med: #343a40;
    --text-low: #6c757d;
    --text-on-primary: #ffffff;


    /* Sidebar Layout Variables */
    --sidebar-width: 250px;
    --sidebar-collapsed-width: 64px;
    --topbar-height: 56px;
}

/* Themes */
/* Teal theme */
html[data-theme="default"] {
  --color-primary: #42464D;
  --color-secondary: #32BEC0;
  --color-accent:  #64A6E3;
  --color-danger: #D95C4B;
  --color-success: #5FAF5E;
  --color-bg:      #ffffff;
  --color-surface: #f1f5f9;
  --text-high:     #0f172a;
  --text-on-primary: #ffffff;
  --bs-btn-disabled-color: #0f172a;
  --bs-btn-disabled-bg: #32BEC0;
  --bs-btn-disabled-border-color: #32BEC0;
  --bs-btn-disabled-opacity: 0.4;
}

/* Coral theme */
html[data-theme="coral"] {
  --color-primary: #F46B78;
  --color-secondary: #63D2C6;
  --color-accent:  #62B6F0;
  --color-danger: #E05A66;
  --color-success: #3CBF8C;
  --color-bg:      #ffffff;
  --color-surface: #fff5f2;
  --text-high:     #1f2937;
  --text-on-primary: #ffffff;
  --color-primary-light: #e0f5f2;
    --color-secondary-light: #c5eaea;
    --color-primary-hover: #9c484f;
    --color-secondary-hover: #3a6f69;
}

/* Slate/dark-ish theme */
html[data-theme="slate"] {
  --color-primary: #1F3558;
  --color-secondary: #4C5A73;
  --color-accent:  #4A86C7;
  --color-success: #2F6F45;
  --color-danger: #B33535;
  --color-bg:      #0b1220;
  --color-surface: #111827;
  --text-high:     #f3f4f6;
  --text-on-primary: #ffffff;
  --border-color:  #1f2937;
    --color-primary-light: #caced8;
    --color-secondary-light: #d5d8de;
    --color-primary-hover: #0d1118;
    --color-secondary-hover: #16181d;
}

/* Text Colors */
.text-theme-primary{
    color: var(--color-primary) !important;
}

.text-theme-secondary{
    color: var(--color-secondary) !important;
}

.text-theme-dark {
    color: var(--text-high) !important;
}


/* Background Colors */
.bg-theme-primary {
    background-color: var(--color-primary) !important;
}

.bg-theme-info {
    background-color: var(--color-accent) !important;
}

.bg-theme-success{
    background-color: var(--color-success) !important;
}

.bg-theme-secondary {
    background-color: var(--color-secondary) !important;
}

.bg-theme-secondary-light {
    background-color: var(--color-secondary-light) !important;
}

/* Gradient Background for Auth Pages */
.bg-auth-gradient {
    background: linear-gradient(135deg, var(--color-secondary-light) 0%, #ffffff 50%, var(--color-secondary-light) 100%);
    min-height: calc(100vh - 120px);
}

/* Custom Coral Button */
.btn-theme-primary {
    background-color: var(--color-primary);
    border-color: var(--color-primary);
    color: #fff;
}

.btn-theme-primary:hover,
.btn-theme-primary:focus {
    background-color: var(--color-primary-hover);
    border-color: var(--color-primary-hover);
    color: #fff;
}

.btn-theme-primary:disabled{
    background-color: var(--color-primary-light) !important;
    border-color: var(--color-primary-light) !important;
    color: #fff !important;
    opacity: 0.6;
}

.btn-theme-primary:active {
    background-color: var(--color-primary-hover);
    border-color: var(--color-primary-hover);
    color: #fff;
}

.btn-outline-theme-primary {
    color: var(--color-primary);
    border-color: var(--color-primary);
    background-color: transparent;
}

.btn-outline-theme-primary:hover,
.btn-outline-theme-primary:focus {
    background-color: var(--color-primary);
    border-color: var(--color-primary);
    color: #fff;
}

/* Custom Teal Button */
.btn-theme-secondary {
    background-color: var(--color-secondary);
    border-color: var(--color-secondary);
    color: #fff;
}

.btn-theme-secondary:hover,
.btn-theme-secondary:focus {
    background-color: var(--color-secondary-hover);
    border-color: var(--color-secondary-hover);
    color: #fff;
}

.btn-outline-theme-secondary {
    color: var(--color-secondary);
    border-color: var(--color-secondary);
    background-color: transparent;
}

.btn-outline-theme-secondary:hover,
.btn-outline-theme-secondary:focus {
    background-color: var(--color-secondary);
    border-color: var(--color-secondary);
    color: #fff;
}

.form-control {
    border-color: var(--border-color);
    background-color: var(--color-surface);
    color: var(--text-high);
}

/* Form Styling */
.form-control:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 0.2rem rgba(66, 70, 77, 0.25);
}

.form-select {
    border-color: var(--border-color);
    background-color: var(--color-surface);
    color: var(--text-high);
}

/* Form Styling */
.form-select:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 0.2rem rgba(66, 70, 77, 0.25);
}

.form-check-input:checked {
    background-color: var(--color-primary);
    border-color: var(--color-primary);
}

.form-check-input:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 0.2rem rgba(66, 70, 77, 0.25);
}

/* Input with Icon */
.input-icon-wrapper {
    position: relative;
}

.input-icon-wrapper .input-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #6c757d;
    pointer-events: none;
}

.input-icon-wrapper .form-control {
    padding-left: 40px;
}


/* Auth Card */
.auth-card {
    border: none;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
}

/* ========================================
   Dashboard Card Styles
   ======================================== */

/* Dashboard Card Hover Effects */
.dashboard-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.dashboard-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.12);
}

/* Dashboard Card Header */
.dashboard-card .card-header-section {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.75rem;
}

/* Dashboard Card Body */
.dashboard-card .card-body {
    display: flex;
    flex-direction: column;
}

/* Dashboard Card Footer */
.dashboard-card .card-footer {
    background-color: transparent;
    border-top: none;
    padding-top: 0;
}

/* Status Badge Enhancements */
.badge.bg-theme-primary {
    color: #fff;
}

.badge.bg-theme-secondary {
    color: #fff;
}

/* Dashboard Section Headers */
.dashboard-section-header {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
}

.dashboard-section-header h2 {
    margin-bottom: 0;
}

/* Dashboard Tab Navigation Styling */
.nav-tabs .nav-link {
    color: #475569;
    border: none;
    border-bottom: 2px solid transparent;
    padding: 0.75rem 1rem;
    transition: all 0.2s ease;
}

.nav-tabs .nav-link:hover {
    color: var(--color-primary);
    border-bottom-color: var(--color-primary-light);
}

.nav-tabs .nav-link.active {
    color: var(--color-primary);
    border-bottom-color: var(--color-primary);
    background-color: transparent;
}

/* Dashboard Empty State */
.dashboard-empty-state {
    padding: 3rem 2rem;
}

.dashboard-empty-state .empty-icon {
    font-size: 4rem;
    color: #94a3b8;
    margin-bottom: 1.5rem;
}

/* Reduce motion for dashboard cards */
@media (prefers-reduced-motion: reduce) {
    .dashboard-card {
        transition: none;
    }

    .dashboard-card:hover {
        transform: none;
    }
}

/* Avatar Styles */
.avatar-lg {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid #fff;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.avatar-sm {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* Avatar Placeholder */
.avatar-placeholder {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: var(--color-primary-light);
    color: var(--color-primary);
}

.avatar-lg.avatar-placeholder {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 4px solid #fff;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.avatar-sm.avatar-placeholder {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* Success/Error Icons */
.status-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
}

.status-icon.success {
    background-color: #d1fae5;
    color: #10b981;
}

.status-icon.error {
    background-color: #fee2e2;
    color: var(--color-danger);
}

.status-icon.info {
    background-color: var(--color-secondary-light);
    color: var(--color-secondary);
}

/* Links */
a.text-coral {
    text-decoration: none;
}

a.text-theme-primary:hover {
    color: var(--color-primary-hover) !important;
    text-decoration: underline;
}

a.text-theme-secondary {
    text-decoration: none;
}

a.text-theme-secondary:hover {
    color: var(--color-secondary-hover) !important;
    text-decoration: underline;
}

/* Smooth transitions */
.btn, .form-control, .nav-link {
    transition: all 0.2s ease;
}

/* Navbar Profile Dropdown */
.navbar .dropdown-toggle::after {
    margin-left: 0.5rem;
    vertical-align: middle;
}

.navbar .dropdown-menu {
    border: none;
    border-radius: 0.5rem;
    min-width: 200px;
}

.navbar .dropdown-item {
    padding: 0.625rem 1rem;
    font-size: 0.9375rem;
}

.navbar .dropdown-item:hover {
    background-color: var(--color-primary-light);
}

.navbar .dropdown-item:active {
    color: #fff;
}

.navbar .dropdown-item i {
    width: 1.25rem;
    text-align: center;
}

/* Profile dropdown toggle - remove default caret styling for custom appearance */
#navbarProfileDropdown {
    text-decoration: none;
}

#navbarProfileDropdown:hover {
    opacity: 0.85;
}

/* Touch-friendly dropdown on mobile devices */
@media (max-width: 991.98px) {
    .navbar .dropdown-menu {
        position: static;
        float: none;
        box-shadow: none;
        border-top: 1px solid rgba(0, 0, 0, 0.1);
        border-radius: 0;
        margin-top: 0.5rem;
    }
}

/* ========================================
   Desktop Voting UI - Drag and Drop Cards
   ======================================== */

/* Voting Cards Container */
.voting-cards-container {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* Individual Voting Card */
.voting-card {
    background-color: #fff;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 1rem 1.25rem;
    transition: all 0.2s ease;
    cursor: default;
}

.voting-card:hover {
    border-color: var(--color-secondary);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

/* Drag Handle */
.voting-card .drag-handle {
    cursor: grab;
    padding: 0.25rem;
    opacity: 0.6;
    transition: opacity 0.2s ease;
}

.voting-card .drag-handle:hover {
    opacity: 1;
}

.voting-card .drag-handle.disabled {
    cursor: not-allowed;
    opacity: 0.3;
}

/* Rank Badge */
.voting-card .rank-badge .badge {
    font-size: 0.875rem;
    min-width: 2rem;
    padding: 0.5rem 0.75rem;
}

/* Absolute No State */
.voting-card.absolute-no {
    border-color: var(--color-danger);
    background-color: #fef2f2;
}

.voting-card.absolute-no:hover {
    border-color: var(--color-danger);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.15);
}

.voting-card.absolute-no h6 {
    color: var(--color-danger);
}

.voting-card.absolute-no small {
    color: var(--color-danger);
}

/* Absolute No Toggle Button */
.voting-card .absolute-no-toggle {
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.voting-card .absolute-no-toggle:hover {
    transform: scale(1.05);
}

.voting-card .absolute-no-toggle.btn-danger {
    background-color: var(--color-danger);
    border-color: var(--color-danger);
}

.voting-card .absolute-no-toggle.btn-danger:hover {
    background-color: var(--color-danger-hover);
    border-color: var(--color-danger-hover);
}

/* SortableJS Ghost Element (during drag) */
.voting-card-ghost {
    opacity: 0.4;
    border: 2px dashed var(--color-secondary);
    background-color: var(--color-secondary-light);
}

/* SortableJS Chosen Element (being dragged) */
.voting-card-chosen {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    transform: rotate(2deg);
    z-index: 10;
}

/* SortableJS Drag Element */
.voting-card-drag {
    opacity: 0.9;
}

/* Prevent text selection during drag */
.voting-cards-container * {
    user-select: none;
}

/* Focus styles for accessibility */
.voting-card .absolute-no-toggle:focus {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

.voting-card .drag-handle:focus-visible {
    outline: 2px solid var(--color-secondary);
    outline-offset: 2px;
}

/* Responsive adjustments */
@media (max-width: 767.98px) {
    .voting-card {
        padding: 0.875rem 1rem;
    }

    .voting-card .drag-handle {
        display: none;
    }
}

/* ========================================
   Mobile Voting UI - Tap-to-Rank Cards
   ======================================== */

/* Mobile Voting Cards Container */
.mobile-voting-cards-container {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* Individual Mobile Voting Card */
.mobile-voting-card {
    background-color: #fff;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 1rem;
    position: relative;
    overflow: hidden;
    transition: all 0.2s ease;
    cursor: pointer;
    /* Minimum touch target height for accessibility (44px) */
    min-height: 72px;
    /* Prevent text selection on tap */
    user-select: none;
    -webkit-user-select: none;
    /* Improve touch responsiveness */
    -webkit-tap-highlight-color: transparent;
}

.mobile-voting-card:hover {
    border-color: var(--color-secondary);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

/* Active/pressed state for touch feedback */
.mobile-voting-card:active {
    transform: scale(0.98);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Ranked state */
.mobile-voting-card.ranked {
    border-color: var(--color-secondary);
    background-color: var(--color-secondary-light);
}

.mobile-voting-card.ranked h6 {
    color: #0f766e;
    font-weight: 600;
}

/* Absolute No State for mobile */
.mobile-voting-card.absolute-no {
    border-color: #ef4444;
    background-color: #fef2f2;
    cursor: not-allowed;
}

.mobile-voting-card.absolute-no:hover {
    border-color: #dc2626;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.15);
}

.mobile-voting-card.absolute-no h6 {
    color: #991b1b;
}

.mobile-voting-card.absolute-no small {
    color: #b91c1c;
}

/* Mobile Rank Badge */
.mobile-rank-badge {
    flex-shrink: 0;
}

.mobile-rank-badge .mobile-rank-display {
    font-size: 1rem;
    font-weight: 700;
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    transition: all 0.2s ease;
}

/* Ranked badge styling */
.mobile-rank-badge .mobile-rank-display.bg-teal {
    color: #fff;
    box-shadow: 0 2px 8px rgba(78, 205, 196, 0.4);
}

/* Unranked badge styling */
.mobile-rank-badge .mobile-rank-display.bg-light {
    background-color: #f1f5f9 !important;
    border: 2px dashed #cbd5e1;
}

/* Absolute No badge styling */
.mobile-rank-badge .mobile-rank-display.bg-danger {
    color: #fff;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.4);
}

/* Mobile Tap Area */
.mobile-tap-area {
    cursor: pointer;
    padding: 0.25rem 0;
}

.mobile-voting-card.absolute-no .mobile-tap-area {
    cursor: not-allowed;
}

/* Mobile Absolute No Button */
.mobile-absolute-no-btn {
    /* Minimum touch target size for accessibility (44px) */
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    transition: all 0.2s ease;
    flex-shrink: 0;
    font-size: 1.125rem;
}

.mobile-absolute-no-btn:active {
    transform: scale(0.95);
}

.mobile-absolute-no-btn.btn-danger {
    background-color: #ef4444;
    border-color: #ef4444;
    color: #fff;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.4);
}

.mobile-absolute-no-btn.btn-danger:hover,
.mobile-absolute-no-btn.btn-danger:focus {
    background-color: #dc2626;
    border-color: #dc2626;
}

.mobile-absolute-no-btn.btn-outline-secondary {
    border-color: #cbd5e1;
    color: #64748b;
}

.mobile-absolute-no-btn.btn-outline-secondary:hover,
.mobile-absolute-no-btn.btn-outline-secondary:focus {
    background-color: #fef2f2;
    border-color: #ef4444;
    color: #ef4444;
}

/* Mobile Submit Button */
.mobile-submit-btn {
    /* Ensure minimum touch-friendly height (44px) */
    min-height: 52px;
    font-size: 1.125rem;
    font-weight: 600;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.3);
}

.mobile-submit-btn:active {
    transform: scale(0.98);
}

/* Focus styles for accessibility */
.mobile-voting-card:focus {
    outline: 3px solid var(--color-secondary);
    outline-offset: 2px;
}

.mobile-voting-card:focus:not(:focus-visible) {
    outline: none;
}

.mobile-voting-card:focus-visible {
    outline: 3px solid var(--color-secondary);
    outline-offset: 2px;
}

.mobile-absolute-no-btn:focus {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

/* Ensure proper spacing in card content */
.mobile-voting-card h6 {
    font-size: 0.9375rem;
    line-height: 1.4;
    margin-bottom: 0.25rem;
}

.mobile-voting-card small {
    font-size: 0.8125rem;
    line-height: 1.3;
}

/* Animation for rank assignment */
@keyframes rankPulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
    }
}

.mobile-rank-badge .mobile-rank-display.bg-teal {
    animation: rankPulse 0.3s ease-out;
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    .mobile-voting-card,
    .mobile-absolute-no-btn,
    .mobile-submit-btn,
    .mobile-rank-badge .mobile-rank-display {
        transition: none;
        animation: none;
    }

    .mobile-voting-card:active,
    .mobile-absolute-no-btn:active,
    .mobile-submit-btn:active {
        transform: none;
    }
}

/* ========================================
   Mobile Voting UI - Swipe-to-Veto Gesture
   ======================================== */

/* Swipe veto indicator - revealed behind the card during left swipe */
.mobile-voting-card .swipe-veto-indicator {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 80px;
    background-color: #ef4444;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0 10px 10px 0;
    opacity: 0;
    pointer-events: none;
    z-index: 0;
}

.mobile-voting-card .swipe-veto-indicator i {
    color: #fff;
    font-size: 1.5rem;
}

/* During active swipe: disable transitions so card follows finger exactly */
.mobile-voting-card.swiping {
    transition: none;
    z-index: 5;
}

/* Snap-back animation when swipe does not pass threshold */
.mobile-voting-card.snap-back {
    transition: transform 200ms ease;
}

/* Reduce motion for swipe gesture animations */
@media (prefers-reduced-motion: reduce) {
    .mobile-voting-card.swiping,
    .mobile-voting-card.snap-back {
        transition: none;
    }
}

/* ========================================
   Mobile Voting UI - Long-Press Drag Reorder
   ======================================== */

/* SortableJS Ghost Element for mobile (placeholder in original position during drag) */
.mobile-voting-card-ghost {
    opacity: 0.4;
    border: 2px dashed var(--color-secondary);
    background-color: var(--color-secondary-light);
}

/* SortableJS Chosen Element for mobile (card being dragged - elevated shadow and rotation) */
.mobile-voting-card-chosen {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    transform: rotate(2deg);
    z-index: 10;
}

/* SortableJS Drag Element for mobile (floating drag clone) */
.mobile-voting-card-drag {
    opacity: 0.9;
}

/* Reduce motion for drag gesture animations */
@media (prefers-reduced-motion: reduce) {
    .mobile-voting-card-chosen {
        transform: none;
        border: 2px solid var(--color-secondary);
    }

    .mobile-voting-card-ghost {
        border: 2px solid var(--color-secondary);
    }
}

/* ========================================
   Real-Time Connection Status Indicator
   ======================================== */

/* Connection Status Indicator */
.connection-status-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0.625rem;
    background-color: rgba(255, 255, 255, 0.9);
    border-radius: 1rem;
    font-size: 0.75rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.connection-status-indicator .status-dot {
    font-size: 0.5rem;
    transition: color 0.3s ease;
}

.connection-status-indicator .status-text {
    display: none;
}

/* Show status text on larger screens */
@media (min-width: 576px) {
    .connection-status-indicator .status-text {
        display: inline;
    }
}

/* Retry button styling */
.connection-status-indicator .retry-btn {
    padding: 0.125rem 0.375rem;
    font-size: 0.6875rem;
    line-height: 1;
    border-radius: 0.25rem;
    margin-left: 0.25rem;
}

/* Pulse animation for connecting state */
@keyframes connectionPulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.connection-status-indicator.connecting .status-dot {
    animation: connectionPulse 1.5s ease-in-out infinite;
}

/* ========================================
   Real-Time Participant Vote Highlight
   ======================================== */

/* Highlight animation for newly voted participants */
@keyframes voteHighlight {
    0% {
        background-color: var(--color-secondary);
    }
    100% {
        background-color: var(--color-secondary-light);
    }
}

.participant-status.vote-highlight {
    animation: voteHighlight 1.5s ease-out forwards;
}

/* Ensure smooth transition for participant status items */
.participant-status {
    transition: background-color 0.3s ease;
}

/* ========================================
   Real-Time New Card Animation
   ======================================== */

/* Animation for newly added voting cards */
@keyframes newCardSlideIn {
    0% {
        opacity: 0;
        transform: translateY(-10px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.voting-card.new-card,
.mobile-voting-card.new-card {
    animation: newCardSlideIn 0.4s ease-out forwards;
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    .connection-status-indicator.connecting .status-dot,
    .participant-status.vote-highlight,
    .voting-card.new-card,
    .mobile-voting-card.new-card {
        animation: none;
    }
}

/* ========================================
   Voting Forms Disabled State
   ======================================== */

/* Styles for disabled voting forms when round is not open */
.voting-cards-container.voting-disabled .voting-card,
.mobile-voting-cards-container.voting-disabled .mobile-voting-card {
    opacity: 0.7;
    pointer-events: none;
}

.voting-cards-container.voting-disabled .drag-handle,
.mobile-voting-cards-container.voting-disabled .mobile-tap-area {
    cursor: not-allowed;
}

.voting-cards-container.voting-disabled .absolute-no-toggle,
.mobile-voting-cards-container.voting-disabled .mobile-absolute-no-btn {
    pointer-events: none;
    opacity: 0.5;
}

/* ========================================
   Voting Results Display
   ======================================== */

/* Results Section Container */
.voting-results-section {
    margin-bottom: 1.5rem;
}

/* Winner Highlight Card */
.winner-highlight {
    border: 3px solid var(--color-secondary) !important;
    background-color: var(--color-secondary-light) !important;
    border-radius: 12px;
}

.winner-highlight .status-icon.success {
    background-color: var(--color-secondary);
    color: #fff;
}

/* Vetoed Option Styling */
.vetoed-option {
    border-color: #e2e8f0;
    background-color: #f8fafc;
    opacity: 0.8;
}

.vetoed-option h6 {
    color: #64748b;
    text-decoration: line-through;
}

.vetoed-option small {
    color: #94a3b8;
}

/* Vote Breakdown Cards */
.voting-results-section .card {
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    transition: all 0.2s ease;
}

.voting-results-section .card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.voting-results-section .card.winner-highlight:hover {
    box-shadow: 0 4px 12px rgba(78, 205, 196, 0.25);
}

/* Elimination Rounds Timeline */
.elimination-rounds-timeline {
    border-left: 2px solid #e2e8f0;
    padding-left: 1rem;
    margin-left: 0.5rem;
}

.elimination-round-item {
    position: relative;
}

.elimination-round-item::before {
    content: '';
    position: absolute;
    left: -1.35rem;
    top: 0.5rem;
    width: 10px;
    height: 10px;
    background-color: #e2e8f0;
    border-radius: 50%;
}

/* Collapse Indicator Rotation */
.collapse-indicator {
    transition: transform 0.2s ease;
}

[aria-expanded="true"] .collapse-indicator {
    transform: rotate(180deg);
}

/* Badge Styles for Results */
.badge.bg-coral-light {
    background-color: var(--color-primary-light) !important;
}

.text-coral {
    color: var(--color-primary) !important;
}

/* Border Utilities for Results */
.border-teal {
    border-color: var(--color-secondary) !important;
}

/* Responsive adjustments for results */
@media (max-width: 767.98px) {
    .voting-results-section .row .col-md-6 {
        margin-bottom: 0.75rem;
    }

    .winner-highlight {
        padding: 1rem !important;
    }

    .winner-highlight .status-icon {
        width: 40px;
        height: 40px;
    }

    .winner-highlight h4 {
        font-size: 1.125rem;
    }
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    .collapse-indicator {
        transition: none;
    }
}

/* ========================================
   Permission Controls UI
   ======================================== */

/* Permission Selector Styles */
.permission-selector {
    margin-bottom: 1.5rem;
}

.permission-selector .permission-option {
    cursor: pointer;
    transition: all 0.2s ease;
}

.permission-selector .permission-option:hover {
    border-color: var(--color-primary) !important;
}

.permission-selector .permission-option.border-coral {
    border-color: var(--color-primary) !important;
    border-width: 2px !important;
}

.permission-selector .form-check-input:checked + .form-check-label {
    font-weight: 600;
}

/* Permission Indicator Badge */
.permission-indicator {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.permission-indicator i {
    font-size: 0.875rem;
}

/* Designated Suggester Picker Styles */
.designated-suggester-picker {
    margin-top: 0.75rem;
}

.designated-suggester-picker .invitee-option {
    cursor: pointer;
    transition: all 0.2s ease;
}

.designated-suggester-picker .invitee-option:hover {
    border-color: var(--color-secondary) !important;
}

.designated-suggester-picker .invitee-option.bg-teal-light {
    background-color: var(--color-secondary-light) !important;
}

.designated-suggester-picker .invitee-option.border-teal {
    border-color: var(--color-secondary) !important;
}

.designated-suggester-picker .invitee-list {
    max-height: 300px;
    overflow-y: auto;
}

/* Disabled Suggestion Form Styles */
.disabled-suggestion-form {
    margin-bottom: 1rem;
}

.disabled-suggestion-form .alert {
    background-color: #f8fafc;
    border-color: #e2e8f0;
}

.disabled-suggestion-form .bi-lock {
    font-size: 1.5rem;
}

/* Responsive adjustments for permission controls */
@media (max-width: 767.98px) {
    .permission-indicator .permission-label {
        display: none;
    }

    .designated-suggester-picker .invitee-list {
        max-height: 200px;
    }
}

/* Reduce motion for permission controls */
@media (prefers-reduced-motion: reduce) {
    .permission-selector .permission-option,
    .designated-suggester-picker .invitee-option {
        transition: none;
    }
}

/* ========================================
   Gathering Summary View Styles
   ======================================== */

/* Summary action buttons responsive */
@media (max-width: 575.98px) {
    .btn-lg {
        width: 100%;
    }
}

/* ========================================
   App Sidebar Navigation
   ======================================== */

/* App Sidebar - Base Styles */
.app-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background-color: #fff;
    border-right: 1px solid #e2e8f0;
    z-index: 1040;
    display: flex;
    flex-direction: column;
    transition: width 0.2s ease, transform 0.2s ease;
}

/* Sidebar focus style for accessibility - when sidebar receives focus */
.app-sidebar:focus {
    outline: none;
}

/* Sidebar Collapsed State */
.app-sidebar.app-sidebar-collapsed {
    width: var(--sidebar-collapsed-width);
}

/* Hide text labels when collapsed */
.app-sidebar.app-sidebar-collapsed .sidebar-link-text,
.app-sidebar.app-sidebar-collapsed .sidebar-brand-text {
    display: none;
}

/* Sidebar Brand */
.app-sidebar .sidebar-brand {
    display: flex;
    align-items: center;
    padding: 1rem;
    height: var(--topbar-height);
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    z-index: 1;
}

.app-sidebar .sidebar-brand:hover {
    background-color: #f8fafc;
}

.app-sidebar .sidebar-brand:focus {
    outline: 2px solid var(--color-primary);
    outline-offset: -2px;
}

.app-sidebar .sidebar-brand:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: -2px;
}

/* Sidebar Navigation */
.app-sidebar .sidebar-nav {
    flex: 1;
    overflow-y: auto;
}

.app-sidebar .sidebar-nav-item {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    color: #475569;
    text-decoration: none;
    transition: all 0.2s ease;
    min-height: 44px;
}

.app-sidebar .sidebar-nav-item:hover {
    background-color: var(--color-primary-light);
    color: #0f172a;
}

.app-sidebar .sidebar-nav-item:focus {
    outline: 2px solid var(--color-primary);
    outline-offset: -2px;
    background-color: var(--color-primary-light);
}

.app-sidebar .sidebar-nav-item:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: -2px;
    background-color: var(--color-primary-light);
}

.app-sidebar .sidebar-nav-item.active {
    background-color: var(--color-primary);
    color: var(--text-on-primary);
}

.app-sidebar .sidebar-nav-item.active:focus {
    outline: 2px solid var(--color-primary-hover);
    outline-offset: -2px;
}

.app-sidebar .sidebar-nav-item i {
    font-size: 1.25rem;
    width: 2rem;
    text-align: center;
    flex-shrink: 0;
}

.app-sidebar .sidebar-link-text {
    margin-left: 0.75rem;
    white-space: nowrap;
}

/* Sidebar Footer */
.app-sidebar .sidebar-footer {
    padding: 1rem;
    border-top: 1px solid #e2e8f0;
}

/* Sidebar Footer Buttons - Touch-friendly */
.app-sidebar .sidebar-footer .btn {
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.app-sidebar .sidebar-footer .btn:focus {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

/* App Top Bar */
.app-topbar {
    position: fixed;
    top: 0;
    left: var(--sidebar-width);
    right: 0;
    height: var(--topbar-height);
    background-color: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    z-index: 1030;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 0 1rem;
    transition: left 0.2s ease;
}

/* Adjust topbar when sidebar is collapsed */
.app-sidebar.app-sidebar-collapsed ~ .app-topbar {
    left: var(--sidebar-collapsed-width);
}

/* Mobile toggle button in topbar */
.app-topbar .sidebar-toggle {
    display: none;
    min-width: 44px;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #475569;
    cursor: pointer;
    margin-right: auto;
}

.app-topbar .sidebar-toggle:hover {
    color: #0f172a;
}

.app-topbar .sidebar-toggle:focus {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

.app-topbar .sidebar-toggle:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

/* App Main Content Area */
.app-content {
    margin-left: var(--sidebar-width);
    margin-top: var(--topbar-height);
    min-height: calc(100vh - var(--topbar-height));
    transition: margin-left 0.2s ease;
}

/* Adjust content when sidebar is collapsed */
.app-sidebar.app-sidebar-collapsed ~ .app-content {
    margin-left: var(--sidebar-collapsed-width);
}

/* Sidebar Backdrop */
.sidebar-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1035;
    display: none;
    opacity: 0;
    transition: opacity 0.2s ease;
}

/* Backdrop visible state (used by JavaScript) */
.sidebar-backdrop.sidebar-backdrop-visible {
    display: block;
    opacity: 1;
}

/* Mobile Responsive - Sidebar hidden by default below lg breakpoint */
@media (max-width: 991.98px) {
    .app-sidebar {
        transform: translateX(-100%);
        width: var(--sidebar-width);
    }

    /* Mobile sidebar open state (used by JavaScript) */
    .app-sidebar.sidebar-mobile-open {
        transform: translateX(0);
    }

    /* Always show full sidebar on mobile (not collapsed) */
    .app-sidebar.app-sidebar-collapsed {
        width: var(--sidebar-width);
    }

    .app-sidebar.app-sidebar-collapsed .sidebar-link-text,
    .app-sidebar.app-sidebar-collapsed .sidebar-brand-text {
        display: inline;
    }

    .app-topbar {
        left: 0;
    }

    .app-topbar .sidebar-toggle {
        display: flex;
    }

    .app-content {
        margin-left: 0;
    }

    /* Collapsed state does not affect layout on mobile */
    .app-sidebar.app-sidebar-collapsed ~ .app-topbar {
        left: 0;
    }

    .app-sidebar.app-sidebar-collapsed ~ .app-content {
        margin-left: 0;
    }
}

/* Reduce motion for sidebar animations */
@media (prefers-reduced-motion: reduce) {
    .app-sidebar,
    .app-topbar,
    .app-content,
    .sidebar-backdrop,
    .app-sidebar .sidebar-nav-item {
        transition: none;
    }
}

/* ========================================
   Gathering Details Page - Responsive Layout
   ======================================== */

/* Header actions (Edit/Delete buttons) - full-width on mobile */
@media (max-width: 767.98px) {
    .details-header-actions {
        width: 100%;
    }
}

@media (min-width: 768px) {
    .details-header-actions {
        width: auto;
    }
}

/* Delivery method toggle btn-group - stack vertically on xs screens */
@media (max-width: 575.98px) {
    .delivery-method-toggle {
        flex-direction: column;
        width: 100%;
    }

    .delivery-method-toggle .btn {
        border-radius: 0.375rem;
    }
}

/* ========================================
   Voting Round Views - Responsive Layout
   ======================================== */

/* Owner controls buttons - full-width on mobile */
@media (max-width: 767.98px) {
    #ownerControlsSection .btn {
        width: 100%;
    }
}

/* ========================================
   Support Form - Honeypot Field
   ======================================== */

/* Hides the honeypot field from real users while remaining visible to bots */
.support-hp {
    position: absolute;
    left: -9999px;
}
