@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --accent-gradient: linear-gradient(to right, #ff9a9e 0%, #fecfef 99%, #fecfef 100%);
    --bg-color: #f4f6f9;
    --card-bg: #ffffff;
    --text-main: #2d3748;
    --text-muted: #718096;
    --purple-main: #6b46c1;
    --pink-accent: #d53f8c;
    --shadow-soft: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-strong: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    background-image:
        radial-gradient(at 0% 0%, hsla(253, 16%, 7%, 1) 0, transparent 50%),
        radial-gradient(at 50% 0%, hsla(225, 39%, 30%, 1) 0, transparent 50%),
        radial-gradient(at 100% 0%, hsla(339, 49%, 30%, 1) 0, transparent 50%);
    background-size: cover;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--text-main);
    padding: 20px;
}

/* Main App Container (Simulating the Laptop Screen UI) */
.app-container {
    width: 100%;
    max-width: 1000px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    box-shadow: var(--shadow-strong);
    overflow: hidden;
    min-height: 600px;
    display: flex;
    flex-direction: column;
}

/* Header */
header {
    padding: 20px 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #e2e8f0;
    background: #fff;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--purple-main);
}

.logo svg {
    width: 24px;
    height: 24px;
    fill: currentColor;
}

.nav-actions {
    display: flex;
    gap: 15px;
}

.nav-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: #cbd5e0;
}

/* Main Content Area */
main {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    /* Changed from center to allow scroll */
    padding: 60px 20px;
    text-align: center;
}

h1 {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 10px;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

p.subtitle {
    color: var(--text-muted);
    margin-bottom: 40px;
    font-size: 1.1rem;
}

/* Input Section */
.input-wrapper {
    position: relative;
    width: 100%;
    max-width: 600px;
    margin-bottom: 60px;
}

.search-bar {
    width: 100%;
    padding: 20px 30px;
    padding-right: 60px;
    font-size: 1.1rem;
    border: 2px solid #e2e8f0;
    border-radius: 50px;
    outline: none;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-soft);
}

.search-bar:focus {
    border-color: var(--purple-main);
    box-shadow: 0 0 0 4px rgba(107, 70, 193, 0.1);
}

.search-btn {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: var(--purple-main);
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease;
}

.search-btn:hover {
    transform: translateY(-50%) scale(1.05);
}

/* Floating Chips/Badges (Decorative) */
.chip {
    position: absolute;
    padding: 10px 20px;
    background: white;
    border-radius: 12px;
    box-shadow: var(--shadow-soft);
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 8px;
    pointer-events: none;
    animation: float 6s ease-in-out infinite;
    z-index: 10;
}

.chip svg {
    width: 18px;
    height: 18px;
    color: var(--pink-accent);
}

.chip-1 {
    top: -60px;
    right: -20px;
    animation-delay: 0s;
}

.chip-2 {
    bottom: -50px;
    left: -10px;
    animation-delay: 2s;
}

.chip-3 {
    bottom: -70px;
    right: 50px;
    animation-delay: 4s;
}

@keyframes float {
    0% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-10px);
    }

    100% {
        transform: translateY(0px);
    }
}

/* Loading Phase (Image 2) */
#loading-area {
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    width: 100%;
    max-width: 500px;
    margin-top: 20px;
}

.step-item {
    background: white;
    width: 100%;
    padding: 15px 20px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: var(--shadow-soft);
    opacity: 0.5;
    transform: translateY(10px);
    transition: all 0.5s ease;
    border: 1px solid #e2e8f0;
}

.step-item.active {
    opacity: 1;
    transform: translateY(0);
    border-color: var(--purple-main);
}

.step-item.completed .icon-box {
    background: #48bb78;
    color: white;
}

.icon-box {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: #edf2f7;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-weight: 700;
}

.text-box {
    font-weight: 600;
    color: var(--text-main);
}

/* Results Area (Image 3) */
#results-area {
    display: none;
    width: 100%;
    max-width: 800px;
    margin-top: 30px;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.result-card {
    background: white;
    padding: 25px;
    border-radius: 20px;
    box-shadow: var(--shadow-soft);
    border: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    gap: 15px;
    position: relative;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.result-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-strong);
    border-color: #b794f4;
}

.card-badge {
    align-self: flex-start;
    padding: 6px 12px;
    border-radius: 20px;
    color: white;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-question {
    background: linear-gradient(135deg, #667eea, #764ba2);
}

.badge-story {
    background: linear-gradient(135deg, #ff9a9e, #fad0c4);
    color: #822727;
}

.badge-bold {
    background: linear-gradient(135deg, #a18cd1, #fbc2eb);
    color: #44337a;
}

.caption-text {
    font-size: 1.1rem;
    line-height: 1.6;
    color: var(--text-main);
    font-weight: 500;
}

.actions {
    margin-top: auto;
    display: flex;
    justify-content: flex-end;
}

.copy-btn {
    background: #edf2f7;
    border: none;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.85rem;
    color: var(--text-muted);
    transition: background 0.2s;
}

.copy-btn:hover {
    background: #e2e8f0;
    color: var(--purple-main);
}

/* Confetti hidden by default */
.confetti {
    position: absolute;
    width: 10px;
    height: 10px;
    background: #f00;
    animation: fall 3s linear forwards;
}