/* Name Compatibility Test - Styles */
:root {
    --primary: #ff4d6d;
    --primary-light: #ff8fa3;
    --primary-dark: #c9184a;
    --bg: #0a0a1a;
    --bg-card: rgba(255,255,255,0.06);
    --bg-card-hover: rgba(255,255,255,0.1);
    --text: #f0f0f0;
    --text-secondary: rgba(255,255,255,0.6);
    --border: rgba(255,255,255,0.1);
    --shadow: 0 8px 32px rgba(0,0,0,0.3);
}

[data-theme="light"] {
    --bg: #fef1f3;
    --bg-card: rgba(255,77,109,0.06);
    --bg-card-hover: rgba(255,77,109,0.1);
    --text: #1a1a2e;
    --text-secondary: rgba(26,26,46,0.6);
    --border: rgba(255,77,109,0.15);
    --shadow: 0 8px 32px rgba(255,77,109,0.1);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    overflow-x: hidden;
}

/* Skip Link */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--primary);
    color: #fff;
    padding: 8px 16px;
    z-index: 10001;
    transition: top 0.3s;
}
.skip-link:focus { top: 0; }

/* App Loader */
.app-loader {
    position: fixed;
    inset: 0;
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    transition: opacity 0.3s;
}
.app-loader.hidden { opacity: 0; pointer-events: none; }
.loader-content { text-align: center; }
.loader-emoji { font-size: 48px; animation: pulse 1.5s infinite; }
.loader-spinner {
    width: 40px; height: 40px; margin: 16px auto;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
.loader-text { color: var(--text-secondary); font-size: 14px; }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.15); } }

/* Theme Toggle */
.theme-toggle {
    position: fixed;
    top: 12px;
    right: 12px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--bg-card);
    font-size: 20px;
    cursor: pointer;
    z-index: 100;
    backdrop-filter: blur(10px);
}

/* Language Selector */
.language-selector {
    position: fixed;
    top: 12px;
    right: 64px;
    z-index: 100;
}
.lang-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--bg-card);
    font-size: 20px;
    cursor: pointer;
    backdrop-filter: blur(10px);
}
.lang-menu {
    position: absolute;
    top: 52px;
    right: 0;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 160px;
    backdrop-filter: blur(20px);
    box-shadow: var(--shadow);
}
.lang-menu.hidden { display: none; }
.lang-option {
    padding: 8px 12px;
    border: none;
    background: transparent;
    color: var(--text);
    font-size: 14px;
    border-radius: 8px;
    cursor: pointer;
    text-align: left;
}
.lang-option:hover, .lang-option.active { background: var(--bg-card-hover); }

/* Screens */
.screen { display: none; min-height: 100vh; padding: 80px 16px 100px; }
.screen.active { display: flex; flex-direction: column; align-items: center; justify-content: center; }

/* Input Screen */
.input-card {
    max-width: 420px;
    width: 100%;
    text-align: center;
}

.app-icon { font-size: 64px; margin-bottom: 8px; animation: pulse 2s infinite; }

.app-title {
    font-size: 28px;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 8px;
}

.app-subtitle {
    color: var(--text-secondary);
    font-size: 16px;
    margin-bottom: 24px;
}

.trust-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 6px 16px;
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 32px;
}
.badge-icon { font-size: 16px; }
.badge-count { font-weight: 700; color: var(--primary); }

.name-inputs {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 24px;
}

.input-group {
    text-align: left;
}
.input-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
}
.input-group input {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid var(--border);
    border-radius: 12px;
    background: var(--bg-card);
    color: var(--text);
    font-size: 18px;
    font-weight: 600;
    outline: none;
    transition: border-color 0.3s;
}
.input-group input:focus {
    border-color: var(--primary);
}
.input-group input::placeholder {
    color: var(--text-secondary);
    font-weight: 400;
}

.heart-divider {
    font-size: 28px;
    text-align: center;
    animation: heartbeat 1.2s infinite;
}

@keyframes heartbeat {
    0%,100% { transform: scale(1); }
    15% { transform: scale(1.25); }
    30% { transform: scale(1); }
    45% { transform: scale(1.15); }
}

.btn-calculate {
    width: 100%;
    padding: 16px;
    border: none;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    opacity: 0.5;
    pointer-events: none;
}
.btn-calculate.enabled {
    opacity: 1;
    pointer-events: auto;
}
.btn-calculate.enabled:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255,77,109,0.4);
}

/* Loading Screen */
.loading-card { text-align: center; }

.loading-hearts {
    position: relative;
    height: 80px;
    margin-bottom: 24px;
}
.heart {
    position: absolute;
    font-size: 36px;
    animation: float 2s infinite;
}
.h1 { left: 50%; transform: translateX(-50%); animation-delay: 0s; }
.h2 { left: 30%; animation-delay: 0.3s; }
.h3 { left: 65%; animation-delay: 0.6s; }

@keyframes float {
    0%,100% { transform: translateY(0); opacity: 0.6; }
    50% { transform: translateY(-20px); opacity: 1; }
}

.loading-bar {
    width: 240px;
    height: 6px;
    background: var(--border);
    border-radius: 3px;
    overflow: hidden;
    margin: 0 auto 16px;
}
.loading-fill {
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, var(--primary), var(--primary-light));
    border-radius: 3px;
    transition: width 0.4s ease;
}

.loading-text {
    color: var(--text-secondary);
    font-size: 15px;
}

/* Result Screen */
.result-card {
    max-width: 420px;
    width: 100%;
    text-align: center;
}

.result-names {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}
.result-names .name {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 8px 20px;
}
.result-names .heart { font-size: 24px; animation: heartbeat 1.2s infinite; }

.score-circle {
    position: relative;
    width: 200px;
    height: 200px;
    margin: 0 auto 16px;
}
.score-svg { width: 100%; height: 100%; }
.score-inner {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}
.score-number {
    font-size: 56px;
    font-weight: 900;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.score-percent {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary-light);
    margin-top: 8px;
}

.score-label {
    font-size: 22px;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 8px;
}
.score-desc {
    color: var(--text-secondary);
    font-size: 15px;
    line-height: 1.6;
    margin-bottom: 28px;
    padding: 0 8px;
}

/* Categories */
.categories {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 24px;
}
.cat-item {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 14px 16px;
    text-align: left;
}
.cat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.cat-name {
    font-size: 14px;
    font-weight: 600;
}
.cat-score {
    font-size: 16px;
    font-weight: 800;
    color: var(--primary);
}
.cat-bar {
    height: 6px;
    background: var(--border);
    border-radius: 3px;
    overflow: hidden;
}
.cat-bar-fill {
    height: 100%;
    border-radius: 3px;
    background: linear-gradient(90deg, var(--primary), var(--primary-light));
    width: 0;
    transition: width 1s cubic-bezier(0.4,0,0.2,1);
}

/* Advice Box */
.advice-box {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 20px;
    margin-bottom: 24px;
    text-align: left;
}
.advice-box h3 {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--primary);
}
.advice-box p {
    font-size: 14px;
    line-height: 1.7;
    color: var(--text-secondary);
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 12px;
}
.btn-action {
    flex: 1;
    padding: 14px;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
}
.btn-share {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
}
.btn-retry {
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text);
}
.btn-action:hover { transform: translateY(-2px); }

/* Footer */
.app-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 12px;
    text-align: center;
    background: linear-gradient(transparent, var(--bg));
    z-index: 50;
}
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 13px;
}
.back-link:hover { color: var(--primary); }

/* Responsive */
@media (max-width: 480px) {
    .app-title { font-size: 24px; }
    .score-number { font-size: 48px; }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}
