:root {
    --bg: #050510;
    --bg2: #0a0a1a;
    --bg3: #12122a;
    --accent: #6c63ff;
    --accent2: #a855f7;
    --accent3: #ec4899;
    --glow: rgba(108, 99, 255, 0.3);
    --text: #e8e8f0;
    --text2: #8888aa;
    --border: rgba(108, 99, 255, 0.15);
    --success: #22c55e;
    --warn: #eab308;
    --radius: 16px;
    --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

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

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.6;
}

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

.container {
    position: relative;
    z-index: 1;
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

/* Hero */
.hero {
    text-align: center;
    padding: 60px 0 40px;
    position: relative;
}

.hero-glow {
    position: absolute;
    top: -100px; left: 50%;
    transform: translateX(-50%);
    width: 400px; height: 400px;
    background: radial-gradient(circle, var(--glow) 0%, transparent 70%);
    filter: blur(60px);
    opacity: 0.5;
    animation: pulse-glow 4s ease-in-out infinite;
}

@keyframes pulse-glow {
    0%, 100% { opacity: 0.3; transform: translateX(-50%) scale(1); }
    50% { opacity: 0.6; transform: translateX(-50%) scale(1.1); }
}

.hero-title {
    font-size: 3rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.title-icon {
    font-size: 2.5rem;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

.title-text {
    background: linear-gradient(135deg, var(--accent), var(--accent2), var(--accent3));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    color: var(--text2);
    font-size: 1.1rem;
    margin-top: 10px;
    font-weight: 300;
}

.hero-desc {
    color: var(--text2);
    font-size: 0.9rem;
    margin-top: 5px;
    opacity: 0.7;
}

/* Upload */
.upload-section {
    margin: 0 auto;
    max-width: 500px;
}

.drop-zone {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    background: var(--bg2);
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.drop-zone:hover {
    border-color: var(--accent);
    background: var(--bg3);
    box-shadow: 0 0 40px var(--glow);
}

.drop-zone.dragover {
    border-color: var(--accent2);
    transform: scale(1.02);
    box-shadow: 0 0 60px var(--glow);
}

.drop-zone-inner {
    position: relative;
    min-height: 350px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Canvas for face detection */
#faceCanvas {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 5;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.5s;
    object-fit: contain;
}

#faceCanvas.active {
    opacity: 1;
}

/* Scan Line */
.scan-line {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 3px;
    background: linear-gradient(90deg, transparent, var(--accent), var(--accent2), transparent);
    opacity: 0;
    z-index: 10;
    pointer-events: none;
}

.scan-line.active {
    opacity: 1;
    animation: scan 2s ease-in-out infinite;
}

@keyframes scan {
    0% { top: 0; }
    50% { top: 100%; }
    100% { top: 0; }
}

/* Drop Content */
.drop-content {
    text-align: center;
    z-index: 2;
    transition: opacity 0.3s;
}

.drop-zone.has-image .drop-content {
    opacity: 0;
    pointer-events: none;
}

.drop-icon-wrapper {
    width: 80px; height: 80px;
    margin: 0 auto 20px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    display: flex;
    align-items: center;
    justify-content: center;
    animation: float 3s ease-in-out infinite;
}

.drop-icon {
    width: 36px; height: 36px;
    color: white;
}

.drop-text {
    font-size: 1.2rem;
    font-weight: 500;
    margin-bottom: 8px;
}

.drop-hint {
    font-size: 0.85rem;
    color: var(--text2);
}

/* Face Landmark Points */
.face-overlay {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 8;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.5s;
}

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

.landmark-point {
    position: absolute;
    width: 8px; height: 8px;
    transform: translate(-50%, -50%);
    opacity: 0;
    transition: opacity 0.3s;
}

.landmark-point.visible {
    opacity: 1;
}

.landmark-point::before {
    content: '';
    position: absolute;
    width: 100%; height: 100%;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 8px var(--accent), 0 0 16px var(--accent);
    animation: point-pulse 2s ease-in-out infinite;
}

.landmark-point::after {
    content: '';
    position: absolute;
    width: 24px; height: 24px;
    top: -8px; left: -8px;
    border-radius: 50%;
    border: 1px solid var(--accent);
    opacity: 0.3;
    animation: point-ring 2s ease-out infinite;
}

@keyframes point-pulse {
    0%, 100% { transform: scale(1); opacity: 0.8; }
    50% { transform: scale(1.4); opacity: 1; }
}

@keyframes point-ring {
    0% { transform: scale(1); opacity: 0.3; }
    100% { transform: scale(2.5); opacity: 0; }
}

/* Feature labels near points */
.landmark-label {
    position: absolute;
    transform: translate(-50%, -100%) translateY(-15px);
    background: rgba(10, 10, 26, 0.9);
    color: var(--accent);
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 10px;
    white-space: nowrap;
    border: 1px solid var(--border);
    opacity: 0;
    transition: opacity 0.5s;
    pointer-events: none;
}

.landmark-label.visible {
    opacity: 1;
}

/* Analyze Button */
.btn-analyze {
    display: block;
    width: 100%;
    max-width: 500px;
    margin: 20px auto 0;
    padding: 18px 30px;
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    color: white;
    border: none;
    border-radius: var(--radius);
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    font-family: var(--font);
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}

.btn-analyze::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.btn-analyze:hover::before { left: 100%; }
.btn-analyze:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px var(--glow);
}

.btn-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.btn-icon { width: 22px; height: 22px; }

/* Progress */
.progress-section {
    max-width: 500px;
    margin: 30px auto 0;
    text-align: center;
}

.progress-bar {
    height: 4px;
    background: var(--bg3);
    border-radius: 2px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--accent), var(--accent2), var(--accent3));
    border-radius: 2px;
    transition: width 0.3s;
}

.progress-text {
    margin-top: 15px;
    color: var(--text2);
    font-size: 0.95rem;
}

.progress-dots span {
    display: inline-block;
    width: 6px; height: 6px;
    margin: 10px 3px 0;
    border-radius: 50%;
    background: var(--accent);
    animation: dot-blink 1.4s ease-in-out infinite;
}

.progress-dots span:nth-child(2) { animation-delay: 0.2s; }
.progress-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes dot-blink {
    0%, 80%, 100% { opacity: 0.2; transform: scale(0.8); }
    40% { opacity: 1; transform: scale(1.2); }
}

/* Results */
.results-section {
    margin-top: 40px;
    animation: fadeInUp 0.6s ease-out;
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

.result-photo-wrapper {
    text-align: center;
    margin-bottom: 30px;
    position: relative;
}

.result-photo-wrapper img {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    border: 3px solid var(--accent);
    object-fit: cover;
    position: relative;
    z-index: 2;
}

.result-photo-glow {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 220px; height: 220px;
    border-radius: 50%;
    background: radial-gradient(circle, var(--glow) 0%, transparent 70%);
    filter: blur(20px);
    animation: pulse-glow 3s ease-in-out infinite;
}

.result-disclaimer {
    text-align: center;
    font-size: 0.8rem;
    color: var(--text2);
    opacity: 0.6;
    margin-bottom: 20px;
    font-style: italic;
}

.result-summary-card {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 25px;
    text-align: center;
    margin-bottom: 30px;
    position: relative;
    overflow: hidden;
}

.result-summary-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 2px;
    background: linear-gradient(90deg, var(--accent), var(--accent2), var(--accent3));
}

.summary-icon {
    font-size: 2rem;
    margin-bottom: 10px;
}

.summary-text {
    font-size: 1.05rem;
    line-height: 1.7;
    color: var(--text);
}

.section-title {
    display: flex;
    align-items: center;
    gap: 15px;
    margin: 30px 0 20px;
    font-size: 1.2rem;
    color: var(--accent);
}

.title-line {
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border), transparent);
}

/* Feature Cards */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
}

.feature-card {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    transition: all 0.3s;
    opacity: 0;
    transform: translateY(20px);
    animation: card-appear 0.5s ease-out forwards;
}

.feature-card:nth-child(1) { animation-delay: 0.1s; }
.feature-card:nth-child(2) { animation-delay: 0.2s; }
.feature-card:nth-child(3) { animation-delay: 0.3s; }
.feature-card:nth-child(4) { animation-delay: 0.4s; }
.feature-card:nth-child(5) { animation-delay: 0.5s; }
.feature-card:nth-child(6) { animation-delay: 0.6s; }
.feature-card:nth-child(7) { animation-delay: 0.7s; }
.feature-card:nth-child(8) { animation-delay: 0.8s; }

@keyframes card-appear {
    to { opacity: 1; transform: translateY(0); }
}

.feature-card:hover {
    border-color: var(--accent);
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(108, 99, 255, 0.1);
}

.feature-card h4 {
    color: var(--accent2);
    font-size: 1rem;
    margin-bottom: 10px;
}

.feature-card .feature-type {
    font-weight: 500;
    margin-bottom: 8px;
    font-size: 0.95rem;
}

.feature-card .feature-meaning {
    color: var(--text2);
    font-size: 0.9rem;
    line-height: 1.5;
}

/* Strengths & Weaknesses */
.sw-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
}

.sw-card {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
}

.sw-card h3 { font-size: 1rem; margin-bottom: 12px; }
.strengths { border-left: 3px solid var(--success); }
.weaknesses { border-left: 3px solid var(--warn); }

.sw-card ul { list-style: none; }

.sw-card li {
    padding: 6px 0 6px 20px;
    position: relative;
    font-size: 0.9rem;
}

.sw-card li::before {
    content: '•';
    position: absolute;
    left: 5px;
    color: var(--text2);
}

/* Back Button */
.btn-back {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin: 30px auto;
    padding: 14px 30px;
    background: var(--bg3);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 1rem;
    cursor: pointer;
    font-family: var(--font);
    transition: all 0.3s;
}

.btn-back:hover {
    background: var(--accent);
    border-color: var(--accent);
    transform: translateY(-2px);
}

footer {
    text-align: center;
    padding: 50px 0 20px;
    color: var(--text2);
    font-size: 0.8rem;
    opacity: 0.5;
}

.typewriter {
    overflow: hidden;
    border-right: 2px solid var(--accent);
    animation: blink-caret 0.75s step-end infinite;
    white-space: normal;
    word-wrap: break-word;
}

@keyframes blink-caret {
    from, to { border-color: transparent; }
    50% { border-color: var(--accent); }
}

.error-box {
    text-align: center;
    padding: 30px;
    background: var(--bg2);
    border-radius: var(--radius);
    border: 1px solid #ef4444;
    margin: 20px auto;
    max-width: 500px;
}

.error-box p { color: #ef4444; margin-bottom: 15px; }

@media (max-width: 600px) {
    .hero-title { font-size: 2rem; }
    .sw-section { grid-template-columns: 1fr; }
    .features-grid { grid-template-columns: 1fr; }
    .drop-zone-inner { min-height: 280px; }
    .result-photo-wrapper img { width: 140px; height: 140px; }
}

/* Bigger landmark points override */
.landmark-point {
    width: 14px !important;
    height: 14px !important;
}

.landmark-point::before {
    background: #00ffaa !important;
    box-shadow: 0 0 12px #00ffaa, 0 0 24px #00ffaa, 0 0 40px rgba(0, 255, 170, 0.3) !important;
}

.landmark-point::after {
    width: 32px !important;
    height: 32px !important;
    top: -9px !important;
    left: -9px !important;
    border-color: #00ffaa !important;
}

.landmark-label {
    background: rgba(0, 255, 170, 0.15) !important;
    color: #00ffaa !important;
    border: 1px solid rgba(0, 255, 170, 0.3) !important;
    font-weight: 500 !important;
    font-size: 0.75rem !important;
    padding: 3px 10px !important;
}

/* Cursor for zoomable image */
.drop-zone.has-image .drop-zone-inner {
    cursor: grab;
}

.drop-zone.has-image .drop-zone-inner:active {
    cursor: grabbing;
}
