:root {
    --bg-dark: #0a0a0f;
    --bg-card: #12121a;
    --bg-input: #1a1a24;
    --accent-male: #3b82f6;
    --accent-male-light: #60a5fa;
    --accent-female: #ec4899;
    --accent-female-light: #f472b6;
    --accent-neutral: #8b5cf6;
    --text-light: #f8fafc;
    --text-muted: #94a3b8;
    --border-color: #1e293b;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Outfit', sans-serif;
    background: var(--bg-dark);
    min-height: 100vh;
    color: var(--text-light);
    background-image: 
        radial-gradient(ellipse at 20% 0%, rgba(59, 130, 246, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 0%, rgba(236, 72, 153, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 100%, rgba(139, 92, 246, 0.1) 0%, transparent 50%);
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    padding: 60px 20px 40px;
}

h1 {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 15px;
    background: linear-gradient(135deg, var(--accent-male) 0%, var(--accent-neutral) 50%, var(--accent-female) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    color: var(--text-muted);
    font-size: 1.1rem;
    font-weight: 400;
}

.search-section {
    margin-bottom: 40px;
}

.search-form {
    display: flex;
    gap: 12px;
    max-width: 500px;
    margin: 0 auto;
}

.search-input {
    flex: 1;
    padding: 18px 24px;
    background: var(--bg-input);
    border: 2px solid var(--border-color);
    border-radius: 16px;
    color: var(--text-light);
    font-family: 'Outfit', sans-serif;
    font-size: 1.1rem;
    transition: all 0.3s ease;
}

.search-input:focus {
    outline: none;
    border-color: var(--accent-neutral);
    box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.2);
}

.search-input::placeholder {
    color: var(--text-muted);
}

.search-btn {
    padding: 18px 32px;
    background: linear-gradient(135deg, var(--accent-male) 0%, var(--accent-female) 100%);
    border: none;
    border-radius: 16px;
    color: white;
    font-family: 'Outfit', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.search-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(139, 92, 246, 0.4);
}

.search-btn:active {
    transform: translateY(0);
}

.search-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.hint {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: 15px;
}

.result-section {
    margin-bottom: 60px;
}

.result-card {
    background: var(--bg-card);
    border-radius: 24px;
    padding: 40px;
    text-align: center;
    border: 1px solid var(--border-color);
    animation: slideUp 0.5s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.result-card.male {
    border-color: var(--accent-male);
    box-shadow: 0 20px 60px rgba(59, 130, 246, 0.2);
}

.result-card.female {
    border-color: var(--accent-female);
    box-shadow: 0 20px 60px rgba(236, 72, 153, 0.2);
}

.result-icon {
    font-size: 5rem;
    margin-bottom: 20px;
}

.result-name {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 10px;
    text-transform: capitalize;
}

.result-gender {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 25px;
}

.result-card.male .result-gender {
    color: var(--accent-male-light);
}

.result-card.female .result-gender {
    color: var(--accent-female-light);
}

.probability-bar {
    background: var(--bg-input);
    border-radius: 100px;
    height: 12px;
    overflow: hidden;
    margin-bottom: 15px;
}

.probability-fill {
    height: 100%;
    border-radius: 100px;
    transition: width 0.8s ease;
}

.result-card.male .probability-fill {
    background: linear-gradient(90deg, var(--accent-male), var(--accent-male-light));
}

.result-card.female .probability-fill {
    background: linear-gradient(90deg, var(--accent-female), var(--accent-female-light));
}

.probability-text {
    color: var(--text-muted);
    font-size: 1rem;
}

.probability-text span {
    font-weight: 700;
    color: var(--text-light);
}

.result-stats {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin-top: 25px;
    padding-top: 25px;
    border-top: 1px solid var(--border-color);
}

.stat-item {
    text-align: center;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent-neutral);
}

.stat-label {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-top: 5px;
}

.loading-card {
    background: var(--bg-card);
    border-radius: 24px;
    padding: 60px;
    text-align: center;
    border: 1px solid var(--border-color);
}

.loader {
    width: 60px;
    height: 60px;
    border: 4px solid var(--border-color);
    border-top-color: var(--accent-neutral);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-text {
    color: var(--text-muted);
    font-size: 1.1rem;
}

.error-card {
    background: var(--bg-card);
    border-radius: 24px;
    padding: 40px;
    text-align: center;
    border: 1px solid #ef4444;
}

.error-icon {
    font-size: 4rem;
    margin-bottom: 15px;
}

.error-text {
    color: #f87171;
    font-size: 1.1rem;
}

.history-section {
    padding-top: 40px;
    border-top: 1px solid var(--border-color);
}

.history-section h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 25px;
    color: var(--text-muted);
}

.history-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
}

.history-item {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 20px;
    text-align: center;
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: all 0.3s ease;
}

.history-item:hover {
    transform: translateY(-3px);
}

.history-item.male {
    border-color: rgba(59, 130, 246, 0.3);
}

.history-item.male:hover {
    box-shadow: 0 10px 30px rgba(59, 130, 246, 0.2);
}

.history-item.female {
    border-color: rgba(236, 72, 153, 0.3);
}

.history-item.female:hover {
    box-shadow: 0 10px 30px rgba(236, 72, 153, 0.2);
}

.history-icon {
    font-size: 2rem;
    margin-bottom: 10px;
}

.history-name {
    font-weight: 600;
    font-size: 1rem;
    text-transform: capitalize;
    margin-bottom: 5px;
}

.history-prob {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.empty-history {
    text-align: center;
    color: var(--text-muted);
    padding: 40px;
    grid-column: 1 / -1;
}

@media (max-width: 600px) {
    h1 {
        font-size: 2.5rem;
    }

    .search-form {
        flex-direction: column;
    }

    .search-btn {
        width: 100%;
    }

    .result-card {
        padding: 30px 20px;
    }

    .result-name {
        font-size: 2rem;
    }

    .result-stats {
        gap: 20px;
    }

    .history-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
