:root {
    --primary: #ff3366;
    --primary-glow: rgba(255, 51, 102, 0.5);
    --secondary: #a12c8a;
    --bg-color: #0f0c29;
    --bg-grad-1: #302b63;
    --bg-grad-2: #24243e;
    --text-light: #ffffff;
    --text-muted: #b0aecd;
    --card-bg: rgba(30, 25, 60, 0.6);
    --card-border: rgba(255, 255, 255, 0.1);
    --input-bg: rgba(0, 0, 0, 0.3);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
}

body {
    background: linear-gradient(135deg, var(--bg-color), var(--bg-grad-1), var(--bg-grad-2));
    background-size: 400% 400%;
    animation: gradientBG 15s ease infinite;
    color: var(--text-light);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
    position: relative;
}

@keyframes gradientBG {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Background Bubbles for depth */
.background-bubbles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 0;
}

.bubble {
    position: absolute;
    bottom: -100px;
    background: radial-gradient(circle, var(--primary-glow) 0%, transparent 70%);
    border-radius: 50%;
    opacity: 0.3;
    animation: float 10s infinite ease-in;
}

.bubble:nth-child(1) { width: 200px; height: 200px; left: 10%; animation-duration: 12s; }
.bubble:nth-child(2) { width: 300px; height: 300px; left: 40%; animation-duration: 15s; animation-delay: 2s; }
.bubble:nth-child(3) { width: 150px; height: 150px; left: 70%; animation-duration: 9s; animation-delay: 4s; }
.bubble:nth-child(4) { width: 250px; height: 250px; left: 85%; animation-duration: 14s; animation-delay: 1s; }
.bubble:nth-child(5) { width: 180px; height: 180px; left: 25%; animation-duration: 11s; animation-delay: 5s; }

@keyframes float {
    0% { transform: translateY(0) scale(1); opacity: 0.3; }
    50% { opacity: 0.5; }
    100% { transform: translateY(-100vh) scale(1.5); opacity: 0; }
}

.container {
    width: 90%;
    max-width: 500px;
    background: var(--card-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--card-border);
    border-radius: 24px;
    padding: 2.5rem;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
    position: relative;
    z-index: 10;
    text-align: center;
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

header {
    margin-bottom: 2rem;
}

h1 {
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    background: linear-gradient(to right, #fff, #ffb6c1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 20px var(--primary-glow);
}

p {
    color: var(--text-muted);
    font-size: 1rem;
    font-weight: 300;
}

.input-group {
    margin-bottom: 1.5rem;
    text-align: left;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-muted);
    padding-left: 0.5rem;
}

input {
    width: 100%;
    padding: 1rem 1.2rem;
    background: var(--input-bg);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    color: white;
    font-size: 1.1rem;
    outline: none;
    transition: all 0.3s ease;
}

input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 15px var(--primary-glow);
}

.primary-btn {
    width: 100%;
    padding: 1rem;
    background: linear-gradient(45deg, var(--primary), var(--secondary));
    border: none;
    border-radius: 12px;
    color: white;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    box-shadow: 0 10px 20px var(--primary-glow);
}

.primary-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 25px var(--primary-glow);
}

.primary-btn:active {
    transform: translateY(1px);
}

.heart-icon {
    width: 20px;
    height: 20px;
    transition: transform 0.3s;
}

.primary-btn:hover .heart-icon {
    transform: scale(1.2);
    fill: white;
}

.hidden {
    display: none !important;
}

/* Loading Section */
.loading-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem 0;
}

.loader {
    position: relative;
    width: 80px;
    height: 80px;
    margin-bottom: 1.5rem;
}

.heart-pulse {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    background: var(--primary);
    box-shadow: 0 0 20px var(--primary);
    animation: heartbeat 1.2s infinite;
}

.heart-pulse::before,
.heart-pulse::after {
    content: '';
    position: absolute;
    width: 40px;
    height: 40px;
    background: var(--primary);
    border-radius: 50%;
}

.heart-pulse::before {
    top: -20px;
    left: 0;
}

.heart-pulse::after {
    top: 0;
    left: -20px;
}

@keyframes heartbeat {
    0% { transform: translate(-50%, -50%) scale(0.8) rotate(-45deg); opacity: 0.8; }
    14% { transform: translate(-50%, -50%) scale(1) rotate(-45deg); opacity: 1; }
    28% { transform: translate(-50%, -50%) scale(0.8) rotate(-45deg); opacity: 0.8; }
    42% { transform: translate(-50%, -50%) scale(1.1) rotate(-45deg); opacity: 1; }
    70% { transform: translate(-50%, -50%) scale(0.8) rotate(-45deg); opacity: 0.8; }
    100% { transform: translate(-50%, -50%) scale(0.8) rotate(-45deg); opacity: 0.8; }
}

/* Result Section */
.result-section {
    animation: fadeIn 0.5s ease-out forwards;
}

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

.match-card {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.match-image-container {
    width: 100%;
    height: 300px;
    position: relative;
    overflow: hidden;
}

#match-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: transform 0.5s ease;
}

.match-card:hover #match-img {
    transform: scale(1.05);
}

.match-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 50%;
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
}

.match-info {
    padding: 1.5rem;
}

#match-name {
    font-size: 1.8rem;
    margin-bottom: 1rem;
    color: white;
}

.compatibility-meter {
    margin-bottom: 1rem;
}

.meter-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    font-weight: 500;
}

.percent {
    color: var(--primary);
    font-weight: 700;
    font-size: 1.1rem;
}

.meter-bar {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
}

.meter-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--secondary), var(--primary));
    width: 0%;
    border-radius: 4px;
    transition: width 1.5s cubic-bezier(0.1, 0.8, 0.3, 1);
}

.match-message {
    font-size: 1.1rem;
    color: var(--text-muted);
    font-style: italic;
}

.secondary-btn {
    width: 100%;
    padding: 0.8rem;
    background: transparent;
    border: 1px solid var(--text-muted);
    border-radius: 12px;
    color: var(--text-light);
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.secondary-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: white;
}
