:root {
    --bg-color: #050505;
    --text-primary: #ffffff;
    --text-secondary: #a0a0a0;
    --accent-glow: rgba(147, 51, 234, 0.4);
    --accent-blue: rgba(59, 130, 246, 0.4);
    --primary-color: #9333ea;
    --secondary-color: #3b82f6;
    --heart-color: #ff477e;
    --glass-bg: rgba(20, 20, 20, 0.6);
    --glass-border: rgba(255, 255, 255, 0.1);
}

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

body, html {
    width: 100%;
    height: 100%;
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: 'Poppins', sans-serif;
    overflow: hidden;
    touch-action: pan-y;
}

#particles-js {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

.app-container {
    position: relative;
    width: 100%;
    height: 100%;
    z-index: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-y: auto;
}

.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease;
    padding: 20px;
}

.screen.active {
    opacity: 1;
    pointer-events: all;
}

.screen.scrollable {
    align-items: center;
    justify-content: flex-start;
    overflow-y: auto;
    padding-bottom: 100px;
}

.hidden {
    display: none !important;
}

/* Glassmorphism Card */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 40px 30px;
    text-align: center;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.5), 
                0 0 20px var(--accent-glow), 
                0 0 40px var(--accent-blue);
    max-width: 400px;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

h1.logo-title {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: 2px;
    background: linear-gradient(90deg, #d8b4fe, #93c5fd);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 5px;
}

.subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    letter-spacing: 1px;
}

.badge {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 10px 0;
}

.version {
    font-size: 10px;
    color: var(--text-secondary);
    margin-top: auto;
}

/* Loading Area */
.loading-area {
    margin-top: 30px;
    width: 100%;
}

.progress-bar {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    margin: 15px 0;
    overflow: hidden;
    position: relative;
}

.progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    border-radius: 10px;
    box-shadow: 0 0 10px var(--primary-color);
}

.progress-text {
    font-size: 14px;
    font-family: monospace;
}

/* Buttons */
.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 30px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 20px;
    width: 100%;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 15px rgba(147, 51, 234, 0.4);
}

.btn-primary:active {
    transform: scale(0.95);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 12px 24px;
    border-radius: 30px;
    font-size: 14px;
    font-weight: 400;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    backdrop-filter: blur(10px);
    transition: background 0.2s;
}

.btn-secondary:active {
    background: rgba(255, 255, 255, 0.2);
}

/* Permission */
.icon-camera {
    color: #fff;
    margin-bottom: 10px;
    filter: drop-shadow(0 0 10px var(--accent-blue));
}

.privacy-note {
    font-size: 11px;
    color: var(--text-secondary);
    margin: 20px 0;
    line-height: 1.5;
}

/* Live Camera */
.camera-wrapper {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    padding-top: 40px;
}

.camera-header {
    background: rgba(0, 0, 0, 0.6);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 12px;
    letter-spacing: 2px;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.live-dot {
    width: 8px;
    height: 8px;
    background: #ef4444;
    border-radius: 50%;
    box-shadow: 0 0 8px #ef4444;
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.2); }
    100% { opacity: 1; transform: scale(1); }
}

.video-container {
    position: relative;
    width: 90vw;
    height: 90vw;
    max-width: 400px;
    max-height: 400px;
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid var(--glass-border);
    box-shadow: 0 0 30px rgba(59, 130, 246, 0.3);
}

#webcam {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scaleX(-1);
}

#overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2;
}

.scanner-laser {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: #3b82f6;
    box-shadow: 0 0 10px #3b82f6, 0 0 20px #93c5fd;
    z-index: 3;
    animation: scan 2s linear infinite;
}

@keyframes scan {
    0% { top: 0; opacity: 0; }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% { top: 100%; opacity: 0; }
}

.bounding-box {
    position: absolute;
    border-radius: 8px;
    z-index: 3;
    transition: all 0.1s;
}

.bounding-box.box-green {
    border: 2px solid #00ff88;
    box-shadow: 0 0 10px #00ff88 inset, 0 0 10px #00ff88;
}

.bounding-box.box-green::after {
    content: "FACE DETECTED";
    position: absolute;
    top: -20px;
    left: 0;
    background: rgba(0, 255, 136, 0.2);
    color: #00ff88;
    font-size: 10px;
    padding: 2px 5px;
    border-radius: 4px;
}

.bounding-box.box-red {
    border: 2px solid #ef4444;
    box-shadow: 0 0 10px #ef4444 inset, 0 0 10px #ef4444;
    animation: boxglitch 0.2s infinite;
}

.bounding-box.box-red::after {
    content: "ANALYZING...";
    position: absolute;
    top: -20px;
    left: 0;
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
    font-size: 10px;
    padding: 2px 5px;
    border-radius: 4px;
}

@keyframes boxglitch {
    0% { transform: translate(0) scale(1); opacity: 1; }
    20% { transform: translate(-2px, 2px) scale(1.02); opacity: 0.8; }
    40% { transform: translate(-2px, -2px) scale(0.98); opacity: 0.9; }
    60% { transform: translate(2px, 2px) scale(1.01); opacity: 1; }
    80% { transform: translate(2px, -2px) scale(0.99); opacity: 0.8; }
    100% { transform: translate(0) scale(1); opacity: 1; }
}

.analysis-status {
    margin-top: 20px;
    font-size: 14px;
    font-family: monospace;
    color: #93c5fd;
}

.fake-metrics {
    width: 90vw;
    max-width: 400px;
    margin-top: 20px;
    background: var(--glass-bg);
    padding: 20px;
    border-radius: 16px;
    backdrop-filter: blur(10px);
}

.metric {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
    font-size: 11px;
}

.metric .label {
    width: 100px;
    font-family: monospace;
}

.metric .bar {
    flex: 1;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
}

.metric .fill {
    height: 100%;
    background: linear-gradient(90deg, #9333ea, #3b82f6);
}

/* Result Screen */
.processing-content {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top: 3px solid #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

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

.match-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.match-card h2 {
    font-size: 18px;
    letter-spacing: 2px;
    color: var(--text-secondary);
}

.match-percentage {
    font-size: 64px;
    font-weight: 700;
    background: linear-gradient(135deg, #00ff88, #3b82f6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin: 10px 0 30px 0;
    text-shadow: 0 0 30px rgba(0, 255, 136, 0.3);
}

.identity-reveal {
    background: var(--glass-bg);
    padding: 20px 40px;
    border-radius: 16px;
    border: 1px solid var(--glass-border);
    margin-bottom: 30px;
}

.identity-reveal .label {
    font-size: 10px;
    color: var(--text-secondary);
    text-transform: uppercase;
    margin-bottom: 5px;
}

.identity-reveal .name-text {
    font-size: 24px;
    margin-bottom: 15px;
}

.identity-reveal .status-text {
    color: #00ff88;
    font-size: 16px;
}

.typing-container {
    font-family: monospace;
    font-size: 14px;
    line-height: 1.6;
    min-height: 60px;
}

.typing-container .highlight {
    font-size: 20px;
    color: var(--heart-color);
    margin-top: 10px;
}

/* Glitch */
.glitch-overlay {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: white;
    opacity: 0;
    pointer-events: none;
    z-index: 10;
}

/* Scroll Experience */
.section-block {
    width: 100%;
    max-width: 500px;
    padding: 40px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    min-height: 50vh;
    justify-content: center;
    opacity: 0;
    transform: translateY(30px);
}

.memory-img {
    width: 80vw;
    max-width: 400px;
    height: 80vw;
    max-height: 400px;
    object-fit: cover;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    border: 1px solid var(--glass-border);
}

.poetic {
    font-family: 'Cormorant Garamond', serif;
    font-size: 28px;
    line-height: 1.4;
    margin-bottom: 10px;
    opacity: 0;
}

.poetic.highlight {
    font-weight: 600;
    font-size: 36px;
    color: var(--heart-color);
    text-shadow: 0 0 20px rgba(255, 71, 126, 0.4);
}

#scan-sequence-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.memory-img-small {
    width: 200px;
    height: 200px;
    object-fit: cover;
    border-radius: 20px;
    border: 2px solid var(--heart-color);
    box-shadow: 0 0 30px rgba(255, 71, 126, 0.5);
    margin-top: 20px;
}

/* Journey Timeline */
.journey-container {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    padding: 20px 0;
}

.journey-path {
    position: relative;
    width: 100%;
    min-height: 250vh; /* Long enough to scroll through */
    display: flex;
    justify-content: center;
}

.path-line {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    background: linear-gradient(180deg, transparent, var(--heart-color) 10%, var(--heart-color) 90%, transparent);
    border-radius: 4px;
    opacity: 0.5;
    box-shadow: 0 0 10px rgba(255, 71, 126, 0.5);
}

.couple-icon {
    position: sticky;
    top: 50vh;
    font-size: 40px;
    z-index: 20;
    filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.5));
    margin-top: -20px;
    height: 40px;
    pointer-events: none;
}

#journey-images-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.journey-img-wrapper {
    position: absolute;
    width: 140px;
    height: 140px;
    opacity: 0;
    transform: translate(var(--start-x, 0), 50px) scale(0.5) rotate(calc(var(--rot, 0deg) * 2));
    transition: all 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 10;
}

.journey-img-wrapper.visible {
    opacity: 1;
    transform: translate(0, 0) scale(var(--scale, 1)) rotate(var(--rot, 0deg));
}

.journey-img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 12px;
    border: 2px solid var(--glass-border);
    box-shadow: 0 5px 15px rgba(0,0,0,0.5);
}

.journey-img-wrapper.left-side {
    left: calc(50% - 160px);
}

.journey-img-wrapper.right-side {
    left: calc(50% + 20px);
}

.mono-title {
    font-family: monospace;
    font-size: 16px;
    color: #93c5fd;
    margin-bottom: 10px;
}

.mono-sub {
    font-family: monospace;
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.memory-list {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    padding: 20px;
    border-radius: 12px;
    text-align: left;
    width: 100%;
}

.mem-item {
    font-size: 14px;
    margin-bottom: 10px;
    color: #a78bfa;
}

/* SQL Block */
.sql-code {
    background: #0d1117;
    padding: 20px;
    border-radius: 10px 10px 0 0;
    font-family: monospace;
    text-align: left;
    width: 100%;
    font-size: 14px;
    border: 1px solid #30363d;
}

.sql-code .keyword { color: #ff7b72; }
.sql-code .bool { color: #79c0ff; }

.sql-output {
    background: #010409;
    padding: 20px;
    border-radius: 0 0 10px 10px;
    font-family: monospace;
    text-align: left;
    width: 100%;
    font-size: 14px;
    border: 1px solid #30363d;
    border-top: none;
}

.sql-output .highlight { color: #00ff88; font-weight: bold; }

.prediction-card {
    background: var(--glass-bg);
    padding: 30px;
    border-radius: 20px;
    border: 1px solid var(--glass-border);
    width: 100%;
}

.prediction-card h2 {
    font-size: 36px;
    background: linear-gradient(90deg, #f472b6, #fb7185);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin: 10px 0;
}

.small-text {
    font-size: 10px;
    color: var(--text-secondary);
}

/* Final */
.final-content {
    text-align: center;
    position: relative;
    z-index: 5;
    width: 100%;
    max-width: 400px;
    padding: 20px;
}

.final-typing p {
    margin-bottom: 5px;
}

.huge-text {
    font-family: 'Cormorant Garamond', serif;
    font-size: 48px;
    line-height: 1.2;
    margin-top: 20px;
}

#true-final {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    width: 100%;
    max-width: 400px;
    z-index: 10;
}

.heart-icon {
    font-size: 48px;
    animation: heartbeat 1.5s infinite;
    margin: 30px 0;
}

@keyframes heartbeat {
    0% { transform: scale(1); }
    15% { transform: scale(1.3); }
    30% { transform: scale(1); }
    45% { transform: scale(1.3); }
    60% { transform: scale(1); }
}

.fingerprint-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 50px;
    cursor: pointer;
}

.fingerprint-icon {
    background: rgba(255, 71, 126, 0.1);
    padding: 20px;
    border-radius: 50%;
    border: 1px solid rgba(255, 71, 126, 0.3);
    box-shadow: 0 0 20px rgba(255, 71, 126, 0.2);
    transition: all 0.3s;
}

.fingerprint-icon:active {
    background: rgba(255, 71, 126, 0.3);
    box-shadow: 0 0 40px rgba(255, 71, 126, 0.5);
    transform: scale(0.95);
}

.touch-text {
    font-family: monospace;
    font-size: 12px;
    color: var(--heart-color);
    margin-top: 15px;
    letter-spacing: 2px;
    text-transform: uppercase;
}

#locked-status {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
}
