/* ===== Reset & Base ===== */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: #0a0a0f;
    color: #e4e4e7;
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.6;
}

/* ===== Animated Noise Background ===== */
.bg-noise {
    position: fixed;
    top: -50%;
    left: -50%;
    right: -50%;
    bottom: -50%;
    width: 200%;
    height: 200vh;
    background: transparent url('https://assets.iceable.com/img/noise-transparent.png') repeat 0 0;
    animation: bg-animation 0.2s infinite;
    opacity: 0.4;
    pointer-events: none;
    z-index: 0;
}

@keyframes bg-animation {
    0% {
        transform: translate(0, 0)
    }

    10% {
        transform: translate(-5%, -5%)
    }

    20% {
        transform: translate(-10%, 5%)
    }

    30% {
        transform: translate(5%, -10%)
    }

    40% {
        transform: translate(-5%, 15%)
    }

    50% {
        transform: translate(-10%, 5%)
    }

    60% {
        transform: translate(15%, 0)
    }

    70% {
        transform: translate(0, 10%)
    }

    80% {
        transform: translate(-15%, 0)
    }

    90% {
        transform: translate(10%, 5%)
    }

    100% {
        transform: translate(5%, 0)
    }
}

/* ===== Layout ===== */
.container {
    position: relative;
    z-index: 1;
    max-width: 720px;
    margin: 0 auto;
    padding: 60px 24px 40px;
}

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

.logo-icon {
    font-size: 3rem;
    margin-bottom: 12px;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-8px);
    }
}

.hero h1 {
    font-size: 3rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: #ffffff;
    margin-bottom: 8px;
}

.gradient-text {
    background: linear-gradient(135deg, #6366f1, #a78bfa, #f472b6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.tagline {
    font-size: 1.1rem;
    color: #71717a;
    font-weight: 400;
}

/* ===== Glassmorphism Card ===== */
.card {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    padding: 36px 32px;
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.05),
        0 20px 60px rgba(0, 0, 0, 0.4);
}

/* ===== Form ===== */
form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.input-group {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 16px;
    color: #71717a;
    pointer-events: none;
}

input[type="url"] {
    width: 100%;
    padding: 14px 16px 14px 48px;
    font-size: 1rem;
    font-family: inherit;
    color: #e4e4e7;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    outline: none;
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

input[type="url"]::placeholder {
    color: #52525b;
}

input[type="url"]:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

button[type="submit"] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 28px;
    font-size: 1rem;
    font-weight: 600;
    font-family: inherit;
    color: #ffffff;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.25s ease, opacity 0.2s ease;
}

button[type="submit"]:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(99, 102, 241, 0.35);
}

button[type="submit"]:active {
    transform: translateY(0);
}

button[type="submit"]:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* ===== Loading ===== */
.loading {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: 24px;
    padding: 18px 20px;
    background: rgba(99, 102, 241, 0.06);
    border: 1px solid rgba(99, 102, 241, 0.12);
    border-radius: 12px;
    color: #a1a1aa;
    font-size: 0.95rem;
}

.spinner {
    width: 20px;
    height: 20px;
    border: 2.5px solid rgba(99, 102, 241, 0.2);
    border-top-color: #6366f1;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    flex-shrink: 0;
}

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

/* ===== Error Message ===== */
.error-message {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 20px;
    padding: 14px 18px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.25);
    border-radius: 12px;
    color: #fca5a5;
    font-size: 0.95rem;
    animation: slideIn 0.3s ease;
}

/* ===== Result Sections ===== */
.result-section {
    margin-top: 32px;
    animation: slideIn 0.4s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.result-section h2 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #a1a1aa;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 14px;
}

.summary-box {
    background: rgba(99, 102, 241, 0.08);
    border: 1px solid rgba(99, 102, 241, 0.15);
    border-radius: 14px;
    padding: 20px 24px;
}

.summary-box p {
    font-size: 1.05rem;
    line-height: 1.75;
    color: #d4d4d8;
}

/* ===== Image Grid ===== */
.image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 14px;
}

.image-card {
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.06);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.image-card:hover {
    transform: scale(1.03);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.image-card img {
    width: 100%;
    height: 140px;
    object-fit: cover;
    display: block;
}

/* ===== Utility ===== */
.hidden {
    display: none !important;
}

/* ===== Footer ===== */
footer {
    text-align: center;
    margin-top: 48px;
    padding-top: 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

footer p {
    font-size: 0.85rem;
    color: #52525b;
}

footer strong {
    color: #a78bfa;
}

/* ===== Responsive ===== */
@media (max-width: 600px) {
    .container {
        padding: 40px 16px 32px;
    }

    .hero h1 {
        font-size: 2.2rem;
    }

    .card {
        padding: 24px 20px;
        border-radius: 16px;
    }

    .image-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    }
}