/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    background: #030508;
}

:root {
    --black: #0a0506;
    --dark-red: #0d0708;
    --gray-50: #fafafa;
    --gray-100: #f5f5f5;
    --gray-200: #e5e5e5;
    --gray-300: #d4d4d4;
    --gray-400: #a3a3a3;
    --gray-500: #737373;
    --gray-600: #525252;
    --gray-700: #404040;
    --gray-800: #1a1214;
    --gray-900: #120a0c;
    --white: #ffffff;
    --blue: #3b82f6;
    --red: #ef4444;
    --green: #22c55e;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: #030508;
    background-image: 
        radial-gradient(ellipse at 50% 0%, rgba(20, 40, 80, 0.12) 0%, transparent 60%),
        radial-gradient(ellipse at 100% 50%, rgba(30, 50, 100, 0.06) 0%, transparent 50%);
    background-attachment: fixed;
    color: var(--white);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding-top: 4rem;
}

/* Header - Premium Dark Blue Glass */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 100;
    padding: 0.875rem 2.5rem;
    background: linear-gradient(180deg, rgba(8, 12, 24, 0.95) 0%, rgba(6, 10, 20, 0.9) 100%);
    backdrop-filter: saturate(200%) blur(30px);
    -webkit-backdrop-filter: saturate(200%) blur(30px);
    border-bottom: 1px solid rgba(100, 140, 255, 0.08);
    box-shadow: 0 1px 30px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

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

.logo {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.site-logo {
    height: 2.5rem;
    width: auto;
    object-fit: contain;
}

.nav-desktop {
    display: none;
    align-items: center;
    gap: 0.25rem;
}

@media (min-width: 1024px) {
    .nav-desktop {
        display: flex;
    }
}

.nav-link {
    font-size: 0.8125rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.55);
    text-decoration: none;
    background: none;
    border: none;
    cursor: pointer;
    transition: all 0.25s ease;
    font-family: inherit;
    padding: 0.5rem 1.125rem;
    border-radius: 6px;
    letter-spacing: 0.02em;
}

.nav-link:hover {
    color: rgba(255, 255, 255, 0.95);
    background: rgba(100, 140, 255, 0.08);
}

.nav-dropdown {
    position: relative;
}

.dropdown-btn {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.dropdown-icon {
    width: 0.625rem;
    height: 0.625rem;
    transition: transform 0.2s;
    opacity: 0.5;
}

.search-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4375rem 0.75rem;
    font-size: 0.8125rem;
    color: rgba(255, 255, 255, 0.5);
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.search-btn:hover {
    color: rgba(255, 255, 255, 0.8);
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.12);
}

.search-icon {
    width: 1rem;
    height: 1rem;
}

.search-text {
    display: none;
}

@media (min-width: 1280px) {
    .search-text {
        display: inline;
    }
}

.search-kbd {
    display: none;
    padding: 0.125rem 0.375rem;
    font-size: 0.6875rem;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 0.25rem;
    color: rgba(255, 255, 255, 0.4);
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', sans-serif;
    font-weight: 500;
}

@media (min-width: 1280px) {
    .search-kbd {
        display: inline;
    }
}

.mobile-menu-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 0.5rem;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    transition: all 0.2s ease;
}

.mobile-menu-btn:hover {
    color: var(--white);
    background: rgba(255, 255, 255, 0.1);
}

@media (min-width: 1024px) {
    .mobile-menu-btn {
        display: none;
    }
}

.mobile-menu-btn svg {
    width: 1.25rem;
    height: 1.25rem;
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 0 1.5rem 5rem;
}

@media (min-width: 768px) {
    .main-content {
        padding-bottom: 3rem;
    }
}

.container {
    max-width: 1152px;
    margin: 0 auto;
}

/* Hero Stats */
.hero-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 4rem 4rem;
    margin-bottom: 2rem;
}

.stat-group {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem 4rem;
}

.stat-item {
    min-width: 0;
}

.stat-number {
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Fira Code', monospace;
    font-size: 2.25rem;
    font-weight: 700;
    line-height: 1.2;
    color: var(--white);
}

.stat-highlight {
    color: var(--red);
}

.stat-label {
    margin-top: 0.25rem;
    font-size: 0.875rem;
    color: var(--gray-500);
}

/* Updates Section */
.updates-section {
    margin-left: auto;
}

.updates-label {
    font-family: monospace;
    font-size: 0.875rem;
    color: var(--gray-500);
    margin-bottom: 0.5rem;
}

.updates-content {
    font-family: monospace;
    font-size: 0.875rem;
    color: var(--gray-400);
}

.updates-text {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.tree-line {
    color: var(--gray-600);
}

.form-line {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.email-input {
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--gray-700);
    padding: 0.25rem 0.5rem;
    color: var(--white);
    font-family: monospace;
    font-size: 0.875rem;
    width: 12rem;
    outline: none;
    transition: border-color 0.2s;
}

.email-input::placeholder {
    color: var(--gray-600);
}

.email-input:focus {
    border-color: var(--gray-500);
}

.email-input:disabled {
    opacity: 0.5;
}

.subscribe-btn {
    background: none;
    border: none;
    color: var(--gray-500);
    font-family: monospace;
    font-size: 0.875rem;
    cursor: pointer;
    transition: color 0.2s;
}

.subscribe-btn:hover:not(:disabled) {
    color: var(--white);
}

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

/* Category Tabs */
.category-tabs {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
}

.category-tabs::-webkit-scrollbar {
    height: 2px;
}

.category-tabs::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.02);
}

.category-tabs::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.tab-btn {
    font-size: 0.8125rem;
    padding: 0.5rem 1rem;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    font-family: inherit;
    border-radius: 0.375rem;
}

.tab-btn:hover {
    color: rgba(255, 255, 255, 0.8);
    background: rgba(255, 255, 255, 0.04);
}

.tab-btn.active {
    color: #ff6b6b;
    background: rgba(255, 107, 107, 0.1);
}

/* Content Area */
.content-area {
    min-height: 600px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 0 1rem 0;
}

.map-wrapper {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    position: relative;
    padding: 0.5rem 0;
}

.usa-map {
    width: 100%;
    height: auto;
    min-height: 500px;
    display: block;
    border-radius: 12px;
    overflow: visible;
    background: transparent;
    cursor: pointer;
    transition: filter 0.3s;
    border-radius: 0.5rem;
}

/* State hover effects handled in SVG */

/* CA Coming Soon Section */
.ca-coming-soon-section {
    width: 100%;
    padding: 1.5rem 0;
    background: #050505;
    margin-top: -2rem;
}

.ca-coming-soon {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI', Roboto, sans-serif;
    font-size: 0.875rem;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.4);
    text-align: center;
    letter-spacing: 0.01em;
}

.ca-label {
    color: rgba(255, 107, 107, 0.7);
    font-weight: 500;
}

@media (max-width: 768px) {
    .ca-coming-soon-section {
        margin-top: -2rem;
    }
    
    .ca-coming-soon {
        font-size: 0.8rem;
    }
}

/* Database Grid */
.database-grid {
    display: none;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
    margin-top: 2rem;
}

.database-grid.active {
    display: grid;
}

.entity-card {
    background: var(--gray-900);
    border: 1px solid var(--gray-800);
    border-radius: 0.5rem;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.2s;
}

.entity-card:hover {
    border-color: var(--gray-700);
    background: var(--gray-800);
}

.entity-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.entity-avatar {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    background: var(--gray-800);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--gray-400);
    flex-shrink: 0;
}

.entity-info {
    flex: 1;
    min-width: 0;
}

.entity-name {
    font-weight: 600;
    font-size: 0.9375rem;
    color: var(--white);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.entity-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    color: var(--gray-500);
    margin-top: 0.125rem;
}

.party-badge {
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
    font-size: 0.625rem;
    font-weight: 700;
}

.party-badge.democrat {
    background: var(--blue);
    color: var(--white);
}

.party-badge.republican {
    background: var(--red);
    color: var(--white);
}

.party-badge.independent {
    background: var(--gray-700);
    color: var(--white);
}

.entity-amount {
    font-family: monospace;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--red);
    margin-bottom: 0.5rem;
}

.entity-years {
    font-size: 0.75rem;
    color: var(--gray-600);
}

/* Footer */
.footer {
    padding: 2.5rem 1.5rem;
    text-align: center;
    font-size: 0.875rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    margin-top: auto;
    background: rgba(5, 5, 5, 0.95);
}

.footer-content {
    max-width: 896px;
    margin: 0 auto;
}

.footer-disclaimer-small {
    color: rgba(255, 255, 255, 0.35);
    font-size: 0.75rem;
    line-height: 1.6;
    margin-bottom: 1.25rem;
}

.footer-links {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.3);
    margin-bottom: 1rem;
}

.footer-link {
    color: rgba(255, 255, 255, 0.4);
    text-decoration: none;
    transition: color 0.2s;
}

.footer-link:hover {
    color: rgba(255, 255, 255, 0.7);
}

.footer-dot {
    color: rgba(255, 255, 255, 0.15);
}

.footer-text {
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 1rem;
}

.footer-link-highlight {
    color: #ff6b6b;
    text-decoration: none;
}

.footer-link-highlight:hover {
    text-decoration: underline;
}

.footer-subscribe {
    margin-bottom: 1rem;
}

.footer-form {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.footer-form-label {
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.8125rem;
}

.footer-email-input {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 0.375rem;
    padding: 0.375rem 0.75rem;
    font-size: 0.8125rem;
    color: var(--white);
    width: 12rem;
    outline: none;
    transition: all 0.2s ease;
}

.footer-email-input::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

.footer-email-input:focus {
    border-color: rgba(255, 107, 107, 0.4);
    background: rgba(255, 255, 255, 0.06);
}

.footer-email-input:disabled {
    opacity: 0.5;
}

.footer-submit-btn {
    font-size: 0.8125rem;
    color: rgba(255, 255, 255, 0.5);
    background: none;
    border: none;
    cursor: pointer;
    transition: color 0.2s;
    font-family: inherit;
}

.footer-submit-btn:hover:not(:disabled) {
    color: #ff6b6b;
}

.footer-submit-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Mobile Bottom Nav - Clean Design */
.mobile-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: linear-gradient(180deg, rgba(8, 12, 24, 0.95) 0%, rgba(6, 10, 20, 0.98) 100%);
    backdrop-filter: saturate(200%) blur(30px);
    -webkit-backdrop-filter: saturate(200%) blur(30px);
    border-top: 1px solid rgba(100, 140, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-evenly;
    padding: 0.75rem 0.5rem;
    padding-bottom: calc(0.75rem + env(safe-area-inset-bottom));
}

@media (min-width: 768px) {
    .mobile-nav {
        display: none;
    }
}

.mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 0.5rem 0.75rem;
    min-width: 60px;
    text-decoration: none;
    color: rgba(255, 255, 255, 0.5);
    transition: color 0.15s ease;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.mobile-nav-item:active {
    color: rgba(255, 255, 255, 0.9);
}

.mobile-nav-item.active {
    color: #6b8cff;
}

.mobile-nav-icon {
    width: 1.1rem;
    height: 1.1rem;
    object-fit: contain;
}

.mobile-nav-label {
    font-size: 0.625rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

/* Modal */
.modal {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal.active {
    display: flex;
}

.modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(8, 4, 5, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.modal-content {
    position: relative;
    background: rgba(18, 12, 14, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 0.75rem;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    padding: 2rem;
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: var(--gray-500);
    font-size: 1.5rem;
    cursor: pointer;
    transition: color 0.2s;
}

.modal-close:hover {
    color: var(--white);
}

.modal-body {
    color: var(--white);
}

.modal-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.modal-info {
    display: grid;
    gap: 1rem;
}

.modal-info-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.modal-info-label {
    font-size: 0.75rem;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.modal-info-value {
    font-size: 1rem;
    color: var(--white);
}

.modal-amount {
    font-size: 2rem;
    font-weight: 700;
    color: var(--red);
    font-family: monospace;
}

/* Responsive */
@media (max-width: 768px) {
    .hero-stats {
        flex-direction: column;
        gap: 2rem;
    }
    
    .updates-section {
        margin-left: 0;
    }
    
    .stat-number {
        font-size: 1.875rem;
    }
}

/* State Side Panel - Glass UI */
.state-panel {
    position: fixed;
    top: 0;
    right: -480px;
    width: 100%;
    max-width: 460px;
    height: 100vh;
    background: rgba(12, 8, 9, 0.85);
    backdrop-filter: saturate(180%) blur(30px);
    -webkit-backdrop-filter: saturate(180%) blur(30px);
    border-left: 1px solid rgba(255, 255, 255, 0.08);
    z-index: 200;
    display: flex;
    flex-direction: column;
    transition: right 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: -10px 0 40px rgba(0, 0, 0, 0.5);
}

.state-panel.active {
    right: 0;
}

.panel-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 199;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.panel-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.panel-header {
    padding: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    flex-shrink: 0;
}

.panel-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.panel-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--white);
    margin: 0;
}

.panel-close {
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 0.5rem;
    color: rgba(255, 255, 255, 0.6);
    font-size: 1.25rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.panel-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--white);
}

.panel-stats {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 1rem;
    font-size: 0.8125rem;
    color: rgba(255, 255, 255, 0.6);
}

.panel-stats span {
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.panel-stats .amount {
    color: #ff6b6b;
    font-weight: 600;
}

.panel-search {
    position: relative;
}

.panel-search-icon {
    position: absolute;
    left: 0.875rem;
    top: 50%;
    transform: translateY(-50%);
    width: 1rem;
    height: 1rem;
    color: rgba(255, 255, 255, 0.4);
}

.panel-search-input {
    width: 100%;
    padding: 0.625rem 0.875rem 0.625rem 2.5rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 0.5rem;
    color: var(--white);
    font-size: 0.875rem;
    outline: none;
    transition: all 0.2s ease;
}

.panel-search-input::placeholder {
    color: rgba(255, 255, 255, 0.35);
}

.panel-search-input:focus {
    border-color: rgba(255, 107, 107, 0.4);
    background: rgba(255, 255, 255, 0.06);
}

.panel-list {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem;
}

.panel-list::-webkit-scrollbar {
    width: 6px;
}

.panel-list::-webkit-scrollbar-track {
    background: transparent;
}

.panel-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.politician-item {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    padding: 0.875rem 1rem;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.politician-item:hover {
    background: rgba(255, 255, 255, 0.06);
}

.politician-avatar {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
    flex-shrink: 0;
}

.politician-avatar.dem {
    background: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
}

.politician-avatar.rep {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
}

.politician-avatar.ind {
    background: rgba(168, 85, 247, 0.2);
    color: #a78bfa;
}

.politician-info {
    flex: 1;
    min-width: 0;
}

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

.politician-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
    margin-top: 0.125rem;
}

.politician-party {
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
    font-size: 0.625rem;
    font-weight: 600;
}

.politician-party.dem {
    background: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
}

.politician-party.rep {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
}

.politician-party.ind {
    background: rgba(168, 85, 247, 0.2);
    color: #a78bfa;
}

.politician-amount {
    font-family: 'SF Mono', Monaco, monospace;
    font-size: 0.875rem;
    font-weight: 600;
    color: #ff6b6b;
    flex-shrink: 0;
}

.panel-empty {
    padding: 2rem;
    text-align: center;
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.875rem;
}

@media (max-width: 480px) {
    .state-panel {
        max-width: 100%;
        right: -100%;
    }
}

/* Scan Nav Link */
.scan-link {
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.jewscan-nav-logo {
    width: auto;
    height: 1.1rem;
    object-fit: contain;
    vertical-align: middle;
}

.scan-nav-icon {
    width: 1rem;
    height: 1rem;
}

/* Scan Modal */
.scan-modal {
    position: fixed;
    inset: 0;
    z-index: 300;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.5s;
}

.scan-modal.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.scan-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: saturate(180%) blur(30px);
    -webkit-backdrop-filter: saturate(180%) blur(30px);
    opacity: 0;
    transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.scan-modal.active .scan-overlay {
    opacity: 1;
}

.scan-container {
    position: relative;
    width: 100%;
    max-width: 520px;
    background: linear-gradient(
        165deg,
        rgba(40, 32, 35, 0.75) 0%,
        rgba(22, 18, 20, 0.85) 50%,
        rgba(18, 14, 16, 0.9) 100%
    );
    backdrop-filter: saturate(200%) blur(60px);
    -webkit-backdrop-filter: saturate(200%) blur(60px);
    border: 0.5px solid rgba(255, 255, 255, 0.15);
    border-radius: 2rem;
    overflow: hidden;
    box-shadow: 
        0 0 0 0.5px rgba(255, 255, 255, 0.1) inset,
        0 2px 4px rgba(255, 255, 255, 0.05) inset,
        0 -2px 20px rgba(0, 0, 0, 0.1) inset,
        0 30px 70px rgba(0, 0, 0, 0.55),
        0 15px 35px rgba(0, 0, 0, 0.3);
    transform: scale(0.92) translateY(20px);
    opacity: 0;
    filter: blur(10px);
    transition: 
        transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1),
        opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1),
        filter 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.scan-modal.active .scan-container {
    transform: scale(1) translateY(0);
    opacity: 1;
    filter: blur(0);
}

.scan-close {
    position: absolute;
    top: 1.125rem;
    right: 1.125rem;
    width: 1.875rem;
    height: 1.875rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: saturate(150%) blur(20px);
    -webkit-backdrop-filter: saturate(150%) blur(20px);
    border: 0.5px solid rgba(255, 255, 255, 0.18);
    border-radius: 50%;
    color: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 10;
    box-shadow: 
        0 1px 3px rgba(0, 0, 0, 0.2),
        0 0 0 0.5px rgba(255, 255, 255, 0.05) inset;
}

.scan-close:hover {
    background: rgba(255, 255, 255, 0.18);
    border-color: rgba(255, 255, 255, 0.25);
    color: var(--white);
    transform: scale(1.08);
    box-shadow: 
        0 2px 8px rgba(0, 0, 0, 0.25),
        0 0 0 0.5px rgba(255, 255, 255, 0.1) inset;
}

.scan-close:active {
    transform: scale(0.95);
}

.scan-close svg {
    width: 0.875rem;
    height: 0.875rem;
}

.scan-content {
    padding: 2.75rem 2.25rem 2.25rem;
}

.scan-header {
    text-align: center;
    margin-bottom: 2.25rem;
}

.scan-icon-wrapper {
    display: none;
}

.scan-header-icon {
    display: none;
}

.scan-title {
    font-size: 1.625rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.97);
    margin: 0 0 0.5rem;
    letter-spacing: -0.025em;
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', sans-serif;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.scan-subtitle {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.5);
    margin: 0;
    font-weight: 400;
    letter-spacing: 0.01em;
}

/* Upload Area */
.scan-upload-area {
    margin-bottom: 1rem;
}

.upload-zone {
    border: 1px dashed rgba(255, 255, 255, 0.18);
    border-radius: 1.5rem;
    padding: 3.5rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    background: linear-gradient(
        180deg,
        rgba(255, 255, 255, 0.06) 0%,
        rgba(255, 255, 255, 0.02) 100%
    );
    backdrop-filter: saturate(150%) blur(20px);
    -webkit-backdrop-filter: saturate(150%) blur(20px);
    box-shadow: 
        0 0 0 0.5px rgba(255, 255, 255, 0.05) inset,
        0 2px 8px rgba(0, 0, 0, 0.1);
}

.upload-zone:hover {
    border-color: rgba(255, 107, 107, 0.45);
    border-style: solid;
    background: linear-gradient(
        180deg,
        rgba(255, 107, 107, 0.08) 0%,
        rgba(255, 107, 107, 0.03) 100%
    );
    transform: translateY(-3px);
    box-shadow: 
        0 0 0 0.5px rgba(255, 107, 107, 0.15) inset,
        0 8px 25px rgba(0, 0, 0, 0.15),
        0 4px 12px rgba(255, 107, 107, 0.08);
}

.upload-zone.dragover {
    border-color: rgba(255, 107, 107, 0.7);
    border-style: solid;
    background: linear-gradient(
        180deg,
        rgba(255, 107, 107, 0.12) 0%,
        rgba(255, 107, 107, 0.05) 100%
    );
    transform: translateY(-4px) scale(1.01);
}

.upload-icon-ring {
    width: 4.5rem;
    height: 4.5rem;
    margin: 0 auto 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(
        165deg,
        rgba(255, 255, 255, 0.12) 0%,
        rgba(255, 255, 255, 0.05) 100%
    );
    backdrop-filter: saturate(150%) blur(20px);
    -webkit-backdrop-filter: saturate(150%) blur(20px);
    border: 0.5px solid rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    box-shadow: 
        0 1px 3px rgba(255, 255, 255, 0.05) inset,
        0 4px 12px rgba(0, 0, 0, 0.15);
}

.upload-icon {
    width: 2rem;
    height: 2rem;
    color: rgba(255, 255, 255, 0.7);
}

.upload-text {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.92);
    margin: 0 0 0.375rem;
    font-weight: 500;
    letter-spacing: -0.01em;
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', sans-serif;
}

.upload-hint {
    font-size: 0.8125rem;
    color: rgba(255, 255, 255, 0.4);
    margin: 0;
    font-weight: 400;
}

/* Preview Area */
.scan-preview-area {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.preview-image-container {
    position: relative;
    border-radius: 1.25rem;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.5);
    aspect-ratio: 4/3;
    border: 0.5px solid rgba(255, 255, 255, 0.12);
    box-shadow: 
        0 0 0 0.5px rgba(255, 255, 255, 0.05) inset,
        0 10px 35px rgba(0, 0, 0, 0.35),
        0 4px 15px rgba(0, 0, 0, 0.2);
}

.preview-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.scan-line {
    position: absolute;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent 0%, rgba(255, 120, 120, 0.9) 50%, transparent 100%);
    box-shadow: 
        0 0 15px rgba(255, 107, 107, 0.6),
        0 0 30px rgba(255, 107, 107, 0.3);
    opacity: 0;
    top: 0;
}

.scan-line.active {
    opacity: 1;
    animation: scanLine 2.5s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes scanLine {
    0% { top: 0; opacity: 0.6; }
    25% { opacity: 1; }
    50% { top: calc(100% - 2px); opacity: 1; }
    75% { opacity: 1; }
    100% { top: 0; opacity: 0.6; }
}

.face-grid {
    position: absolute;
    inset: 0;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease;
}

.face-grid.active {
    opacity: 1;
}

.face-grid::before {
    content: '';
    position: absolute;
    inset: 22%;
    border: 1.5px solid rgba(255, 120, 120, 0.4);
    border-radius: 50%;
    animation: faceGridPulse 2s ease-in-out infinite;
    box-shadow: 
        0 0 20px rgba(255, 107, 107, 0.15),
        0 0 0 3px rgba(255, 107, 107, 0.05);
}

@keyframes faceGridPulse {
    0%, 100% { 
        opacity: 0.4; 
        transform: scale(1); 
    }
    50% { 
        opacity: 0.8; 
        transform: scale(1.03);
        box-shadow: 
            0 0 25px rgba(255, 107, 107, 0.2),
            0 0 0 5px rgba(255, 107, 107, 0.08);
    }
}

.scan-actions {
    display: flex;
    gap: 0.75rem;
}

.scan-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 1.25rem;
    border-radius: 0.875rem;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', sans-serif;
    letter-spacing: -0.01em;
}

.scan-btn svg {
    width: 1rem;
    height: 1rem;
    opacity: 0.85;
}

.scan-btn.secondary {
    background: linear-gradient(
        180deg,
        rgba(255, 255, 255, 0.12) 0%,
        rgba(255, 255, 255, 0.06) 100%
    );
    backdrop-filter: saturate(150%) blur(20px);
    -webkit-backdrop-filter: saturate(150%) blur(20px);
    border: 0.5px solid rgba(255, 255, 255, 0.18);
    color: rgba(255, 255, 255, 0.9);
    box-shadow: 
        0 1px 2px rgba(255, 255, 255, 0.05) inset,
        0 2px 8px rgba(0, 0, 0, 0.1);
}

.scan-btn.secondary:hover {
    background: linear-gradient(
        180deg,
        rgba(255, 255, 255, 0.18) 0%,
        rgba(255, 255, 255, 0.1) 100%
    );
    border-color: rgba(255, 255, 255, 0.25);
    color: var(--white);
    transform: translateY(-2px);
    box-shadow: 
        0 1px 2px rgba(255, 255, 255, 0.08) inset,
        0 6px 16px rgba(0, 0, 0, 0.15);
}

.scan-btn.secondary:active {
    transform: translateY(0) scale(0.98);
}

.scan-btn.primary {
    background: linear-gradient(
        180deg,
        rgba(255, 120, 120, 0.95) 0%,
        rgba(220, 80, 80, 0.95) 100%
    );
    backdrop-filter: saturate(150%) blur(20px);
    -webkit-backdrop-filter: saturate(150%) blur(20px);
    border: 0.5px solid rgba(255, 255, 255, 0.2);
    color: white;
    box-shadow: 
        0 1px 2px rgba(255, 255, 255, 0.15) inset,
        0 4px 16px rgba(255, 100, 100, 0.3),
        0 2px 6px rgba(0, 0, 0, 0.1);
}

.scan-btn.primary:hover {
    background: linear-gradient(
        180deg,
        rgba(255, 130, 130, 1) 0%,
        rgba(230, 90, 90, 1) 100%
    );
    border-color: rgba(255, 255, 255, 0.28);
    transform: translateY(-2px);
    box-shadow: 
        0 1px 3px rgba(255, 255, 255, 0.2) inset,
        0 8px 25px rgba(255, 100, 100, 0.4),
        0 4px 10px rgba(0, 0, 0, 0.15);
}

.scan-btn.primary:active {
    transform: translateY(0) scale(0.98);
}

/* Results Area */
.scan-results-area {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.results-image-container {
    position: relative;
    border-radius: 1.25rem;
    overflow: hidden;
    aspect-ratio: 4/3;
    border: 0.5px solid rgba(255, 255, 255, 0.12);
    box-shadow: 
        0 0 0 0.5px rgba(255, 255, 255, 0.05) inset,
        0 10px 35px rgba(0, 0, 0, 0.35),
        0 4px 15px rgba(0, 0, 0, 0.2);
}

.results-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.face-marker {
    position: absolute;
    inset: 18%;
    border: 1.5px solid rgba(255, 120, 120, 0.8);
    border-radius: 50%;
    box-shadow: 
        0 0 20px rgba(255, 107, 107, 0.25),
        0 0 0 4px rgba(255, 107, 107, 0.08);
    animation: markerPulse 2.5s ease-in-out infinite;
}

@keyframes markerPulse {
    0%, 100% { 
        opacity: 0.7; 
        transform: scale(1);
    }
    50% { 
        opacity: 1; 
        transform: scale(1.02);
        box-shadow: 
            0 0 30px rgba(255, 107, 107, 0.35),
            0 0 0 6px rgba(255, 107, 107, 0.1);
    }
}

.results-panel {
    background: linear-gradient(
        165deg,
        rgba(255, 255, 255, 0.08) 0%,
        rgba(255, 255, 255, 0.03) 100%
    );
    backdrop-filter: saturate(150%) blur(25px);
    -webkit-backdrop-filter: saturate(150%) blur(25px);
    border: 0.5px solid rgba(255, 255, 255, 0.14);
    border-radius: 1.25rem;
    padding: 1.375rem;
    box-shadow: 
        0 1px 3px rgba(255, 255, 255, 0.05) inset,
        0 4px 15px rgba(0, 0, 0, 0.1);
}

.results-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
    padding-bottom: 1.25rem;
    border-bottom: 0.5px solid rgba(255, 255, 255, 0.08);
}

.results-title {
    font-size: 1.0625rem;
    font-weight: 600;
    color: var(--white);
    margin: 0;
    letter-spacing: -0.01em;
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', sans-serif;
}

.results-confidence {
    font-size: 0.75rem;
    color: #4ade80;
    background: rgba(74, 222, 128, 0.12);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 0.3125rem 0.75rem;
    border-radius: 1rem;
    font-weight: 600;
    border: 0.5px solid rgba(74, 222, 128, 0.2);
}

.ethnicity-results {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.primary-result {
    text-align: center;
    padding: 0.375rem 0 0.625rem;
}

.result-badge {
    display: inline-block;
    padding: 0.625rem 1.5rem;
    border-radius: 2rem;
    font-size: 0.9375rem;
    font-weight: 600;
    border: 0.5px solid;
    backdrop-filter: saturate(150%) blur(15px);
    -webkit-backdrop-filter: saturate(150%) blur(15px);
    letter-spacing: -0.01em;
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', sans-serif;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.ethnicity-breakdown {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.breakdown-title {
    font-size: 0.8125rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.65);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin: 0 0 0.375rem;
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', sans-serif;
}

.ethnicity-item {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.ethnicity-label {
    width: 140px;
    font-size: 0.8125rem;
    color: rgba(255, 255, 255, 0.7);
    flex-shrink: 0;
}

.ethnicity-bar-container {
    flex: 1;
    height: 8px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2) inset;
}

.ethnicity-bar {
    height: 100%;
    border-radius: 4px;
    transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
}

.ethnicity-bar.jewish {
    background: linear-gradient(90deg, rgba(255, 120, 120, 0.95), rgba(220, 60, 60, 0.95));
    box-shadow: 0 0 10px rgba(255, 100, 100, 0.3);
}

.ethnicity-bar.other {
    background: linear-gradient(90deg, rgba(120, 130, 140, 0.8), rgba(90, 100, 110, 0.8));
}

.ethnicity-percent {
    width: 50px;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--white);
    text-align: right;
}

.results-actions {
    margin-top: 1.25rem;
}

/* Loading State */
.scan-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 4rem 2rem;
}

.loading-spinner {
    width: 2.75rem;
    height: 2.75rem;
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-top-color: rgba(255, 120, 120, 0.9);
    border-radius: 50%;
    animation: spin 0.75s linear infinite;
    margin-bottom: 1.5rem;
    box-shadow: 
        0 0 15px rgba(255, 107, 107, 0.15),
        0 0 0 4px rgba(255, 107, 107, 0.03);
}

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

.loading-text {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.6);
    margin: 0;
    font-weight: 500;
    letter-spacing: -0.01em;
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', sans-serif;
}

.scan-disclaimer {
    padding: 1rem 2rem 1.25rem;
    font-size: 0.6875rem;
    color: rgba(255, 255, 255, 0.35);
    text-align: center;
    line-height: 1.6;
    border-top: 0.5px solid rgba(255, 255, 255, 0.08);
    background: linear-gradient(
        180deg,
        rgba(0, 0, 0, 0.1) 0%,
        rgba(0, 0, 0, 0.2) 100%
    );
}

@media (max-width: 600px) {
    .scan-container {
        max-width: 100%;
        border-radius: 1rem;
    }
    
    .scan-content {
        padding: 2rem 1.5rem;
    }
    
    .scan-title {
        font-size: 1.5rem;
    }
}
