/* Modern Glassmorphism + Gradient UI */

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

:root {
    --bg: #0f172a;
    --card: rgba(255, 255, 255, 0.08);
    --border: rgba(255, 255, 255, 0.12);
    --text: #f8fafc;
    --muted: #cbd5e1;
    --primary: linear-gradient(135deg, #6366f1, #8b5cf6, #ec4899);
    --shadow: 0 10px 40px rgba(0, 0, 0, 0.35);
    --radius: 24px;
}

body {
    font-family: 'Inter', 'Segoe UI', sans-serif;
    max-width: 900px;
    margin: 0 auto;
    padding: 110px 1.5rem 3rem;
    background:
        radial-gradient(circle at top left, #1e293b, transparent 35%),
        radial-gradient(circle at bottom right, #312e81, transparent 30%),
        var(--bg);
    color: var(--text);
    min-height: 100vh;
}

/* Floating Header */
header {
    position: fixed;
    top: 18px;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 40px);
    max-width: 920px;
    padding: 1rem 1.5rem;
    border-radius: 20px;
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(14px);
    border: 1px solid rgba(255,255,255,0.08);
    box-shadow: var(--shadow);
    z-index: 1000;
}

a {
    position: absolute;
    right: 28px;
    color:#f5f5f5;
    text-decoration: none;
    font-weight: 500;
    transition: 0.25s ease;
}

header a:hover {
    color: white;
}

header h1 {
    text-align: center;
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    background: var(--primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

header a {
    position: absolute;
    top: 50%;
    right: 24px;
    transform: translateY(-50%);
    text-decoration: none;
    color: white;
    font-size: 0.95rem;
    font-weight: 600;
    padding: 0.6rem 1rem;
    border-radius: 999px;
    background: rgba(255,255,255,0.08);
    transition: all 0.3s ease;
}

header a:hover {
    background: rgba(255,255,255,0.16);
    transform: translateY(-50%) scale(1.05);
}

/* Main Card */
.container {
    background: var(--card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    padding: 2.5rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    animation: fadeIn 0.6s ease;
}

h2 {
    font-size: 2.4rem;
    text-align: center;
    margin-bottom: 2rem;
    font-weight: 800;
    line-height: 1.2;
    background: var(--primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Inputs */
.input-group {
    margin-bottom: 1.5rem;
}

label {
    display: block;
    margin-bottom: 0.65rem;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--muted);
}

input {
    width: 100%;
    padding: 1rem 1.2rem;
    border-radius: 16px;
    border: 1px solid rgba(255,255,255,0.08);
    background: rgba(255,255,255,0.05);
    color: white;
    font-size: 1rem;
    outline: none;
    transition: all 0.25s ease;
    backdrop-filter: blur(8px);
}

input::placeholder {
    color: rgba(255,255,255,0.45);
}

input:focus {
    border-color: #8b5cf6;
    box-shadow: 0 0 0 4px rgba(139,92,246,0.2);
    background: rgba(255,255,255,0.08);
}

/* Fancy Color Preview */
.color-display {
    width: 130px;
    height: 130px;
    margin: 2rem auto;
    border-radius: 28px;
    background: linear-gradient(135deg, #8b5cf6, #ec4899);
    border: 4px solid rgba(255,255,255,0.1);
    box-shadow:
        0 10px 30px rgba(236,72,153,0.35),
        inset 0 0 20px rgba(255,255,255,0.2);
    transition: transform 0.3s ease;
}

.color-display:hover {
    transform: scale(1.06) rotate(2deg);
}

/* Results Grid */
.results {
    margin-top: 2.5rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.25rem;
}

.result-box {
    padding: 1.4rem;
    border-radius: 20px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.08);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.result-box::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(
        135deg,
        rgba(99,102,241,0.15),
        rgba(236,72,153,0.12)
    );
    opacity: 0;
    transition: opacity 0.3s ease;
}

.result-box:hover::before {
    opacity: 1;
}

.result-box:hover {
    transform: translateY(-6px);
    border-color: rgba(255,255,255,0.16);
}

.result-title {
    position: relative;
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 0.6rem;
    color: white;
}

.result-box p,
.result-box span {
    position: relative;
    color: var(--muted);
    line-height: 1.5;
}

/* Smooth Appearance */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(18px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Mobile */
@media (max-width: 640px) {
    body {
        padding: 100px 1rem 2rem;
    }

    .container {
        padding: 1.5rem;
        border-radius: 20px;
    }

    h2 {
        font-size: 2rem;
    }

    header {
        width: calc(100% - 20px);
    }

    header a {
        display: none;
    }
}