/* ========================
   CSS Variables & Reset
   ======================== */
:root {
    --pink: #ff2d7b;
    --pink-light: #ff6ba6;
    --pink-glow: rgba(255, 45, 123, 0.3);
    --rose: #e91e63;
    --purple: #9c27b0;
    --purple-deep: #7b1fa2;
    --gold: #ffd700;
    --bg-dark: #0a0012;
    --bg-card: rgba(255, 255, 255, 0.04);
    --bg-card-hover: rgba(255, 255, 255, 0.08);
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.7);
    --text-muted: rgba(255, 255, 255, 0.4);
    --border: rgba(255, 255, 255, 0.08);
    --gradient-main: linear-gradient(135deg, #ff2d7b, #9c27b0, #651fff);
    --gradient-warm: linear-gradient(135deg, #ff2d7b, #ff6d00);
    --gradient-cool: linear-gradient(135deg, #9c27b0, #2196f3);
    --radius: 16px;
    --radius-sm: 10px;
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    --shadow-glow: 0 0 40px rgba(255, 45, 123, 0.2);
}

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

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

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(ellipse at 20% 20%, rgba(255, 45, 123, 0.12) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 80%, rgba(156, 39, 176, 0.1) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(101, 31, 255, 0.06) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

/* ========================
   Floating Hearts Background
   ======================== */
.hearts-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.floating-heart {
    position: absolute;
    bottom: -60px;
    opacity: 0;
    animation: floatUp linear forwards;
    font-size: 20px;
}

@keyframes floatUp {
    0% {
        opacity: 0;
        transform: translateY(0) rotate(0deg) scale(0.5);
    }
    10% {
        opacity: 0.6;
    }
    90% {
        opacity: 0.3;
    }
    100% {
        opacity: 0;
        transform: translateY(-110vh) rotate(360deg) scale(1.2);
    }
}

/* ========================
   Container
   ======================== */
.container {
    position: relative;
    z-index: 1;
    max-width: 480px;
    margin: 0 auto;
    padding: 40px 20px;
    min-height: 100vh;
}

/* ========================
   Hero
   ======================== */
.hero {
    text-align: center;
    margin-bottom: 32px;
}

.hero-badge {
    display: inline-block;
    padding: 6px 16px;
    background: rgba(255, 45, 123, 0.15);
    border: 1px solid rgba(255, 45, 123, 0.3);
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--pink-light);
    margin-bottom: 20px;
}

.hero-title {
    font-family: 'Playfair Display', serif;
    font-size: clamp(3rem, 10vw, 4.5rem);
    font-weight: 900;
    line-height: 1;
    letter-spacing: -0.02em;
    margin-bottom: 12px;
}

.hero-title .accent {
    background: var(--gradient-main);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
    font-weight: 300;
}

/* ========================
   Cards
   ======================== */
.card {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px;
    margin-bottom: 24px;
    box-shadow: var(--shadow);
}

/* ========================
   Input Card
   ======================== */
.names-container {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
}

.name-field {
    flex: 1;
}

.name-field label {
    display: block;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.name-field input {
    width: 100%;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.3s ease;
    outline: none;
}

.name-field input:focus {
    border-color: var(--pink);
    background: rgba(255, 45, 123, 0.06);
    box-shadow: 0 0 0 3px rgba(255, 45, 123, 0.1);
}

.name-field input::placeholder {
    color: var(--text-muted);
    font-weight: 300;
}

.heart-divider {
    flex-shrink: 0;
    padding-top: 20px;
}

.heart-icon {
    width: 28px;
    height: 28px;
    fill: var(--pink);
    filter: drop-shadow(0 0 8px rgba(255, 45, 123, 0.5));
}

.heart-icon.pulse {
    animation: heartPulse 1.5s ease-in-out infinite;
}

@keyframes heartPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.15); }
}

.btn-calculate {
    width: 100%;
    padding: 16px 24px;
    background: var(--gradient-main);
    border: none;
    border-radius: var(--radius-sm);
    color: white;
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    position: relative;
    overflow: hidden;
}

.btn-calculate:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(255, 45, 123, 0.4);
}

.btn-calculate:active {
    transform: translateY(0);
}

.btn-calculate.loading .btn-text {
    opacity: 0;
}

.btn-calculate.loading .btn-icon {
    animation: spin 1s linear infinite;
}

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

/* ========================
   Results Card
   ======================== */
.results-card {
    text-align: center;
    animation: slideUp 0.6s ease;
}

.results-card.hidden {
    display: none;
}

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

.results-names {
    font-family: 'Playfair Display', serif;
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 24px;
    color: var(--text-secondary);
}

.results-names .name-highlight {
    color: var(--pink-light);
}

/* ========================
   Chemistry Meter Ring
   ======================== */
.meter-container {
    display: flex;
    justify-content: center;
    margin-bottom: 16px;
}

.meter-ring {
    position: relative;
    width: 180px;
    height: 180px;
}

.meter-svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.meter-bg {
    fill: none;
    stroke: rgba(255, 255, 255, 0.06);
    stroke-width: 8;
}

.meter-fill {
    fill: none;
    stroke: url(#meterGradient);
    stroke-width: 8;
    stroke-linecap: round;
    stroke-dasharray: 534;
    stroke-dashoffset: 534;
    transition: stroke-dashoffset 1.5s ease;
    filter: drop-shadow(0 0 12px rgba(255, 45, 123, 0.4));
}

.meter-value {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    align-items: baseline;
    gap: 2px;
}

.meter-number {
    font-family: 'Playfair Display', serif;
    font-size: 3.2rem;
    font-weight: 900;
    background: var(--gradient-main);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.meter-percent {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-muted);
}

/* ========================
   Chemistry Label
   ======================== */
.chemistry-label {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 28px;
    padding: 8px 20px;
    display: inline-block;
    border-radius: 50px;
    background: rgba(255, 45, 123, 0.1);
    border: 1px solid rgba(255, 45, 123, 0.2);
}

/* ========================
   Breakdown Bars
   ======================== */
.breakdown {
    text-align: left;
    margin-bottom: 24px;
}

.breakdown-item {
    margin-bottom: 16px;
}

.breakdown-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
    font-size: 0.85rem;
}

.breakdown-emoji {
    font-size: 1rem;
}

.breakdown-label {
    flex: 1;
    font-weight: 500;
    color: var(--text-secondary);
}

.breakdown-value {
    font-weight: 600;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
}

.breakdown-bar {
    height: 6px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 3px;
    overflow: hidden;
}

.breakdown-fill {
    height: 100%;
    border-radius: 3px;
    width: 0%;
    transition: width 1.2s ease;
}

.breakdown-fill.passion { background: var(--gradient-warm); }
.breakdown-fill.trust { background: linear-gradient(135deg, #4caf50, #00e676); }
.breakdown-fill.comm { background: linear-gradient(135deg, #2196f3, #00bcd4); }
.breakdown-fill.adventure { background: linear-gradient(135deg, #ff9800, #ffd740); }
.breakdown-fill.intimacy { background: var(--gradient-cool); }

/* ========================
   Reading Card
   ======================== */
.reading-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 20px;
    margin-bottom: 24px;
}

.reading-text {
    font-size: 0.95rem;
    line-height: 1.7;
    color: var(--text-secondary);
    font-style: italic;
}

/* ========================
   Share Buttons
   ======================== */
.share-section {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-share {
    padding: 10px 20px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-share:hover {
    background: var(--bg-card-hover);
    transform: translateY(-1px);
}

.btn-share.twitter:hover {
    border-color: #1da1f2;
    color: #1da1f2;
}

.btn-share.copy:hover {
    border-color: var(--gold);
    color: var(--gold);
}

.btn-share.retry:hover {
    border-color: var(--pink);
    color: var(--pink);
}

/* ========================
   Promo Footer
   ======================== */
.promo-footer {
    text-align: center;
    padding: 32px 20px;
    border-top: 1px solid var(--border);
    margin-top: 16px;
}

.promo-text {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.promo-link {
    display: inline-block;
    color: var(--pink-light);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    padding: 8px 20px;
    border: 1px solid rgba(255, 107, 166, 0.3);
    border-radius: 50px;
    transition: all 0.3s ease;
    margin-bottom: 10px;
}

.promo-link:hover {
    background: rgba(255, 45, 123, 0.1);
    border-color: var(--pink);
    transform: translateY(-1px);
}

.promo-subtitle {
    font-size: 0.75rem;
    color: var(--text-muted);
    line-height: 1.5;
}

/* ========================
   Celebration Effects
   ======================== */
.confetti {
    position: fixed;
    top: -10px;
    z-index: 100;
    pointer-events: none;
    font-size: 24px;
    animation: confettiFall linear forwards;
}

@keyframes confettiFall {
    0% {
        opacity: 1;
        transform: translateY(0) rotate(0deg);
    }
    100% {
        opacity: 0;
        transform: translateY(100vh) rotate(720deg);
    }
}

/* Toast notification */
.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px 24px;
    color: var(--text-primary);
    font-size: 0.9rem;
    font-weight: 500;
    z-index: 200;
    transition: transform 0.4s ease;
    box-shadow: var(--shadow);
}

.toast.show {
    transform: translateX(-50%) translateY(0);
}

/* ========================
   Responsive
   ======================== */
@media (max-width: 480px) {
    .container {
        padding: 24px 16px;
    }
    
    .card {
        padding: 22px 18px;
    }
    
    .names-container {
        flex-direction: column;
        gap: 8px;
    }
    
    .heart-divider {
        padding-top: 0;
        transform: rotate(90deg);
    }
    
    .meter-ring {
        width: 150px;
        height: 150px;
    }
    
    .meter-number {
        font-size: 2.6rem;
    }
    
    .share-section {
        flex-direction: column;
    }
    
    .btn-share {
        justify-content: center;
    }
}
