/* LeMur - Styles */

:root {
    --color-primary: #8B5CF6;
    --color-primary-light: #A78BFA;
    --color-primary-dark: #7C3AED;
    --color-secondary: #EC4899;
    --color-secondary-light: #F472B6;
    --color-accent: #F59E0B;
    --color-background: #FDF8F6;
    --color-surface: #FFFFFF;
    --color-surface-hover: #FEF3F0;
    --color-text: #1F2937;
    --color-text-light: #6B7280;
    --color-text-lighter: #9CA3AF;
    --color-border: #E5E7EB;
    --color-border-light: #F3F4F6;
    --color-success: #10B981;
    --color-error: #EF4444;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.03);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.05), 0 2px 4px -2px rgb(0 0 0 / 0.05);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.05), 0 4px 6px -4px rgb(0 0 0 / 0.05);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.05), 0 8px 10px -6px rgb(0 0 0 / 0.05);
}

/* Dark mode */
[data-theme="dark"] {
    --color-primary: #A78BFA;
    --color-primary-light: #C4B5FD;
    --color-primary-dark: #8B5CF6;
    --color-secondary: #F472B6;
    --color-secondary-light: #F9A8D4;
    --color-accent: #FBBF24;
    --color-background: #0F0F1A;
    --color-surface: #1A1A2E;
    --color-surface-hover: #252540;
    --color-text: #E5E5E5;
    --color-text-light: #A0A0B0;
    --color-text-lighter: #6B6B80;
    --color-border: #2D2D45;
    --color-border-light: #22223A;
    --color-success: #34D399;
    --color-error: #F87171;
    --shadow-sm: 0 1px 2px rgb(0 0 0 / 0.2);
    --shadow-md: 0 4px 6px rgb(0 0 0 / 0.3);
    --shadow-lg: 0 10px 15px rgb(0 0 0 / 0.3);
    --shadow-xl: 0 20px 25px rgb(0 0 0 / 0.3);
}
[data-theme="dark"] .icon-box-violet { background: #2D1B69; }
[data-theme="dark"] .icon-box-pink { background: #4A1942; }
[data-theme="dark"] .icon-box-gray { background: #2D2D45; }
[data-theme="dark"] .option-btn.selected { background: #2D1B69; }
[data-theme="dark"] .flag-btn.selected { background: #2D1B69; }
[data-theme="dark"] .header { background: rgba(15, 15, 26, 0.85); }
[data-theme="dark"] .header-badge { background: #2D1B69; }
[data-theme="dark"] .alert-error { background: #371520; border-color: #5C1D2E; }
[data-theme="dark"] .alert-success { background: #14332A; border-color: #1E5440; }
[data-theme="dark"] .code-char { background: var(--color-border); }
[data-theme="dark"] .toggle::after { background: #E5E5E5; }

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

html {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background-color 0.3s, color 0.3s;
}

body {
    background-color: var(--color-background);
    color: var(--color-text);
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
}

a {
    color: inherit;
    text-decoration: none;
}

/* Layout */
.container {
    width: 100%;
    max-width: 32rem;
    margin: 0 auto;
    padding: 1.5rem;
}

.page {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.page-center {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* Typography */
h1, h2, h3 {
    font-weight: 700;
    line-height: 1.2;
}

.text-gradient {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.text-center { text-align: center; }
.text-sm { font-size: 0.875rem; }
.text-xs { font-size: 0.75rem; }
.text-lg { font-size: 1.125rem; }
.text-xl { font-size: 1.25rem; }
.text-2xl { font-size: 1.5rem; }
.text-4xl { font-size: 2.25rem; }
.text-gray { color: var(--color-text-light); }
.text-light { color: var(--color-text-lighter); }

/* Spacing */
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }
.mb-12 { margin-bottom: 3rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.mt-8 { margin-top: 2rem; }
.mt-auto { margin-top: auto; }
.py-6 { padding-top: 1.5rem; padding-bottom: 1.5rem; }
.py-12 { padding-top: 3rem; padding-bottom: 3rem; }
.gap-2 { gap: 0.5rem; }
.gap-4 { gap: 1rem; }

/* Flexbox */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }

/* Grid */
.grid { display: grid; }
.grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid-cols-3 { grid-template-columns: repeat(3, 1fr); }

@media (min-width: 640px) {
    .sm-grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 1.5rem;
    font-size: 1rem;
    font-weight: 500;
    border-radius: 1rem;
    transition: all 0.2s ease;
    cursor: pointer;
    border: none;
    text-decoration: none;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-primary {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
    color: white;
    box-shadow: var(--shadow-md), 0 4px 14px -3px rgb(139 92 246 / 0.4);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg), 0 6px 20px -3px rgb(139 92 246 / 0.5);
}

.btn-primary:active:not(:disabled) {
    transform: translateY(0);
}

.btn-secondary {
    background: var(--color-surface);
    color: var(--color-text);
    border: 2px solid var(--color-border);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--color-surface-hover);
    border-color: var(--color-primary-light);
    color: var(--color-primary);
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1.125rem;
    border-radius: 1.25rem;
}

.btn-block {
    width: 100%;
}

/* Cards */
.card {
    background: var(--color-surface);
    border-radius: 1.5rem;
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--color-border-light);
}

.card-hover {
    transition: all 0.2s ease;
    cursor: pointer;
}

.card-hover:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-text);
    margin-bottom: 0.5rem;
}

.form-label .optional {
    color: var(--color-text-lighter);
    font-weight: 400;
}

.input {
    width: 100%;
    padding: 0.875rem 1rem;
    font-size: 1rem;
    border: 2px solid var(--color-border);
    border-radius: 0.75rem;
    background: var(--color-surface);
    transition: all 0.2s ease;
}

.input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgb(139 92 246 / 0.1);
}

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

/* Code input */
.code-inputs {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
}

.code-input {
    width: 3rem;
    height: 3.5rem;
    text-align: center;
    font-size: 1.25rem;
    font-weight: 700;
    border: 2px solid var(--color-border);
    border-radius: 0.75rem;
    background: var(--color-surface);
    transition: all 0.2s ease;
}

.code-input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgb(139 92 246 / 0.1);
}

/* Toggle */
.toggle-wrapper {
    display: flex;
    align-items: flex-start;
    cursor: pointer;
}

.toggle {
    position: relative;
    width: 2.75rem;
    height: 1.5rem;
    background: var(--color-border);
    border-radius: 1rem;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.toggle::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 1.25rem;
    height: 1.25rem;
    background: white;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.toggle-input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-input:checked + .toggle {
    background: var(--color-primary);
}

.toggle-input:checked + .toggle::after {
    transform: translateX(1.25rem);
}

.toggle-content {
    margin-left: 1rem;
}

/* Alerts */
.alert {
    padding: 1rem;
    border-radius: 0.75rem;
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.alert-error {
    background: #FEF2F2;
    border: 1px solid #FECACA;
    color: var(--color-error);
}

.alert-success {
    background: #F0FDF4;
    border: 1px solid #BBF7D0;
    color: var(--color-success);
}

/* Icon box */
.icon-box {
    width: 4rem;
    height: 4rem;
    border-radius: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.icon-box-lg {
    width: 6rem;
    height: 6rem;
    border-radius: 1.5rem;
}

.icon-box-violet {
    background: #EDE9FE;
}

.icon-box-pink {
    background: #FCE7F3;
}

.icon-box-gray {
    background: #F3F4F6;
}

/* Logo */
.logo-box {
    width: 6rem;
    height: 6rem;
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
    border-radius: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-lg);
}

/* QR Code */
.qr-wrapper {
    background: white;
    padding: 1rem;
    border-radius: 1rem;
    display: inline-block;
    box-shadow: var(--shadow-sm);
}

.qr-wrapper img {
    display: block;
}

/* Code display */
.code-display {
    display: flex;
    gap: 0.25rem;
    justify-content: center;
}

.code-char {
    width: 2.5rem;
    height: 3rem;
    background: var(--color-border-light);
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--color-text);
}

/* Photo upload */
.photo-upload {
    aspect-ratio: 1;
    max-width: 200px;
    margin: 0 auto;
    border: 2px dashed var(--color-border);
    border-radius: 1rem;
    cursor: pointer;
    overflow: hidden;
    transition: all 0.2s ease;
    position: relative;
}

.photo-upload:hover {
    border-color: var(--color-primary-light);
}

.photo-upload.has-photo {
    border-style: solid;
    border-color: var(--color-primary-light);
}

.photo-upload img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.photo-upload-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--color-text-lighter);
}

/* Options grid */
.options-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
}

.option-btn {
    padding: 0.75rem;
    border: 2px solid var(--color-border);
    border-radius: 0.75rem;
    background: var(--color-surface);
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
}

.option-btn:hover {
    border-color: var(--color-border);
    background: var(--color-surface-hover);
}

.option-btn.selected {
    border-color: var(--color-primary);
    background: #F5F3FF;
}

/* Flags - Grouped */
.flags-grouped {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.flag-group-label {
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-text-lighter);
    padding-left: 0.25rem;
    margin-bottom: 0.125rem;
}

.flags-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
}

.flag-btn {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.625rem;
    border: 1.5px solid var(--color-border);
    border-radius: 2rem;
    background: var(--color-surface);
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.75rem;
}

.flag-btn:hover {
    border-color: var(--color-border);
    background: var(--color-surface-hover);
}

.flag-btn.selected {
    border-color: var(--color-primary);
    background: #F5F3FF;
}

.flag-stripes {
    width: 1.25rem;
    height: 0.875rem;
    border-radius: 0.125rem;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.flag-stripes span {
    flex: 1;
}

.flags-counter {
    text-align: left;
}

/* Participant grid */
.participants-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

@media (min-width: 640px) {
    .participants-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.participant-card {
    background: var(--color-surface);
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--color-border-light);
    transition: all 0.2s ease;
    cursor: pointer;
}

.participant-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
}

.participant-card.current-user {
    ring: 2px solid var(--color-primary);
    ring-offset: 2px;
    box-shadow: 0 0 0 2px var(--color-primary);
}

.participant-photo {
    aspect-ratio: 1;
    background: var(--color-border-light);
    position: relative;
}

.participant-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Scrollable flags on participant cards */
.participant-flags-scroll {
    position: absolute;
    bottom: 0.375rem;
    left: 0.375rem;
    right: 0.375rem;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    -ms-overflow-style: none;
    -webkit-overflow-scrolling: touch;
}

.participant-flags-scroll::-webkit-scrollbar {
    display: none;
}

.participant-flags-scroll.has-overflow {
    mask-image: linear-gradient(to right, black 70%, transparent 100%);
    -webkit-mask-image: linear-gradient(to right, black 70%, transparent 100%);
}

.participant-flags-scroll.has-overflow.scrolled {
    mask-image: linear-gradient(to right, transparent 0%, black 15%, black 70%, transparent 100%);
    -webkit-mask-image: linear-gradient(to right, transparent 0%, black 15%, black 70%, transparent 100%);
}

.participant-flags-scroll.has-overflow.scrolled-end {
    mask-image: linear-gradient(to right, transparent 0%, black 15%);
    -webkit-mask-image: linear-gradient(to right, transparent 0%, black 15%);
}

.participant-flags-track {
    display: flex;
    gap: 0.25rem;
    width: max-content;
}

.participant-flag {
    width: 1.375rem;
    height: 0.875rem;
    border-radius: 0.125rem;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-sm);
    flex-shrink: 0;
}

.participant-info {
    padding: 0.75rem;
    text-align: center;
}

.participant-number {
    font-size: 1.125rem;
    font-weight: 700;
}

.participant-name {
    font-size: 0.875rem;
    color: var(--color-text-light);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.intention-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 1rem;
    margin-top: 0.5rem;
}

/* Header */
.header {
    padding: 1rem;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--color-border-light);
    position: sticky;
    top: 0;
    z-index: 10;
}

.header-content {
    max-width: 42rem;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.header-info h1 {
    font-size: 1.125rem;
}

.header-info p {
    font-size: 0.875rem;
    color: var(--color-text-light);
}

.header-badge {
    font-size: 0.875rem;
    background: #EDE9FE;
    color: var(--color-primary);
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-weight: 500;
}

.header-btn {
    padding: 0.5rem;
    border-radius: 0.75rem;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--color-text);
}

.header-btn:hover {
    background: var(--color-border-light);
    color: var(--color-primary);
}

/* Back link */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--color-text-light);
    font-size: 0.875rem;
    transition: color 0.2s ease;
    margin-bottom: 1.5rem;
}

.back-link:hover {
    color: var(--color-text);
}

/* Divider */
.divider {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 2rem 0;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--color-border);
}

.divider span {
    font-size: 0.875rem;
    color: var(--color-text-lighter);
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
}

.empty-state .icon-box {
    margin: 0 auto 1rem;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.animate-fade-in {
    animation: fadeIn 0.4s ease-out;
}

.animate-spin {
    animation: spin 1s linear infinite;
}

/* Loading spinner */
.spinner {
    width: 1.25rem;
    height: 1.25rem;
    border: 2px solid currentColor;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Photo Crop Modal */
.crop-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    z-index: 2000;
    display: flex;
    flex-direction: column;
}

.crop-modal.hidden {
    display: none !important;
}

.crop-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background: #1a1a1a;
    flex-shrink: 0;
}

.crop-title {
    color: #fff;
    font-size: 1rem;
    font-weight: 600;
}

.crop-cancel,
.crop-confirm {
    background: none;
    border: none;
    font-size: 0.9375rem;
    cursor: pointer;
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
}

.crop-cancel {
    color: #aaa;
}

.crop-confirm {
    color: var(--color-primary-light);
    font-weight: 600;
}

.crop-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    overflow: hidden;
}

.crop-container {
    position: relative;
    width: 100%;
    max-width: 400px;
    aspect-ratio: 1;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
}

.crop-container canvas {
    display: block;
    border-radius: 0.5rem;
}

.crop-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.crop-hint {
    color: #888;
    font-size: 0.8125rem;
    text-align: center;
    margin-top: 1rem;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.loading-overlay.hidden {
    display: none !important;
}

.loading-content {
    background: var(--color-surface);
    border-radius: 1rem;
    padding: 2rem 2.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    box-shadow: var(--shadow-xl);
    color: var(--color-primary);
}

.loading-content p {
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--color-text);
}

/* Utilities */
.hidden { display: none !important; }
.w-full { width: 100%; }
.max-w-xs { max-width: 20rem; }
.mx-auto { margin-left: auto; margin-right: auto; }
.rounded-full { border-radius: 9999px; }
.truncate {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.mt-2 { margin-top: 0.5rem; }

/* Lien donation discret */
.app-footer {
    margin-top: auto;
    padding: 1.5rem 0 1rem;
    text-align: center;
}
.app-footer-privacy {
    font-size: 0.7rem;
    color: var(--color-text-lighter);
    margin-bottom: 0.4rem;
}
.donate-link {
    display: inline-flex;
    align-items: center;
    gap: 0.3em;
    font-size: 0.7rem;
    color: var(--color-text-lighter);
    text-decoration: none;
    transition: color 0.2s;
}
.donate-link:hover {
    color: var(--color-primary);
}
.donate-link svg {
    flex-shrink: 0;
}

/* Theme toggle button */
.theme-toggle {
    background: var(--color-surface);
    border: 1.5px solid var(--color-border);
    border-radius: 0.625rem;
    width: 2.25rem;
    height: 2.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--color-text-light);
    flex-shrink: 0;
}
.theme-toggle:hover {
    border-color: var(--color-primary-light);
    color: var(--color-primary);
    background: var(--color-surface-hover);
}

/* Page top bar (back-link + theme toggle) */
.page-top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}
.page-top-bar .back-link {
    margin-bottom: 0;
}

/* Home theme toggle (absolute top-right) */
.home-theme-toggle {
    position: absolute;
    top: 1rem;
    right: 1rem;
}

/* Filter bar */
.filter-bar {
    background: var(--color-surface);
    border: 1px solid var(--color-border-light);
    border-radius: 1rem;
    margin-bottom: 1rem;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}
.filter-bar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    cursor: pointer;
    user-select: none;
    transition: background 0.2s;
}
.filter-bar-header:hover {
    background: var(--color-surface-hover);
}
.filter-bar-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-text-light);
}
.filter-bar-count {
    font-size: 0.75rem;
    color: var(--color-text-lighter);
}
.filter-bar-toggle {
    transition: transform 0.2s;
    color: var(--color-text-lighter);
}
.filter-bar.open .filter-bar-toggle {
    transform: rotate(180deg);
}
.filter-bar-body {
    display: none;
    padding: 0.5rem 1rem 1rem;
}
.filter-bar.open .filter-bar-body {
    display: block;
}
.filter-section {
    margin-bottom: 0.75rem;
}
.filter-section:last-child {
    margin-bottom: 0;
}
.filter-section-label {
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-text-lighter);
    margin-bottom: 0.375rem;
}
.filter-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
}
.filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.3rem 0.625rem;
    border: 1.5px solid var(--color-border);
    border-radius: 2rem;
    background: var(--color-surface);
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.75rem;
    color: var(--color-text-light);
    user-select: none;
}
.filter-chip:hover {
    border-color: var(--color-primary-light);
    background: var(--color-surface-hover);
}
.filter-chip.active {
    border-color: var(--color-primary);
    background: #F5F3FF;
    color: var(--color-primary-dark);
}
[data-theme="dark"] .filter-chip.active {
    background: #2D1B69;
    color: var(--color-primary-light);
}
.filter-chip .flag-stripes {
    width: 1rem;
    height: 0.6875rem;
}
.filter-reset {
    background: none;
    border: none;
    color: var(--color-primary);
    font-size: 0.75rem;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem;
    transition: background 0.2s;
}
.filter-reset:hover {
    background: var(--color-surface-hover);
}
.filtered-out {
    display: none !important;
}

/* Online indicator dot */
.online-dot {
    position: absolute;
    bottom: 0.375rem;
    right: 0.375rem;
    width: 0.75rem;
    height: 0.75rem;
    background: #22C55E;
    border: 2px solid var(--color-surface);
    border-radius: 50%;
    z-index: 2;
}

/* Anonymous toggle in message modal */
.anon-toggle-wrapper {
    margin-bottom: 0.75rem;
}
.toggle-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    padding: 0.5rem 0;
}
.toggle-row input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}
.toggle-row .toggle {
    position: relative;
    width: 2.5rem;
    height: 1.375rem;
    background: var(--color-border);
    border-radius: 1rem;
    transition: all 0.2s ease;
    flex-shrink: 0;
}
.toggle-row .toggle::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 1.125rem;
    height: 1.125rem;
    background: white;
    border-radius: 50%;
    transition: all 0.2s ease;
}
.toggle-row input:checked + .toggle {
    background: var(--color-primary);
}
.toggle-row input:checked + .toggle::after {
    transform: translateX(1.125rem);
}
.toggle-label {
    font-size: 0.875rem;
    font-weight: 500;
}
.toggle-hint {
    font-size: 0.75rem;
    color: var(--color-text-lighter);
    margin-top: 0.125rem;
}

/* Shuffle button */
.btn-icon {
    background: var(--color-surface);
    border: 1.5px solid var(--color-border);
    border-radius: 0.625rem;
    width: 2.25rem;
    height: 2.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--color-text-light);
    flex-shrink: 0;
}
.btn-icon:hover {
    border-color: var(--color-primary-light);
    color: var(--color-primary);
    background: var(--color-surface-hover);
}

/* Dark mode overrides for modals and inline hardcoded colors */
[data-theme="dark"] .modal-content {
    background: var(--color-surface);
    color: var(--color-text);
}
[data-theme="dark"] .form-textarea {
    background: var(--color-background);
    color: var(--color-text);
    border-color: var(--color-border);
}
[data-theme="dark"] .form-textarea:focus {
    border-color: var(--color-primary);
}
[data-theme="dark"] .message-item.unread {
    background: #1E1640;
}
[data-theme="dark"] .msg-feedback-moderation {
    background: linear-gradient(135deg, rgba(167, 139, 250, 0.15), rgba(244, 114, 182, 0.15));
    color: #C4B5FD;
    border-color: rgba(167, 139, 250, 0.3);
}
[data-theme="dark"] .msg-feedback-error {
    background: rgba(248, 113, 113, 0.15);
    color: #FCA5A5;
    border-color: rgba(248, 113, 113, 0.25);
}
[data-theme="dark"] .msg-feedback-warn {
    background: rgba(251, 191, 36, 0.15);
    color: #FDE68A;
    border-color: rgba(251, 191, 36, 0.25);
}
[data-theme="dark"] .input {
    background: var(--color-background);
    color: var(--color-text);
}
[data-theme="dark"] .code-input {
    background: var(--color-background);
    color: var(--color-text);
}
[data-theme="dark"] .modal-close {
    color: var(--color-text-lighter);
}
[data-theme="dark"] .participant-card.clickable:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}
[data-theme="dark"] .intention-badge {
    opacity: 0.9;
}
