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

:root {
    --primary: #0ea5e9;
    --primary-dark: #0284c7;
    --secondary: #06b6d4;
    --accent: #14b8a6;
    --dark: #0f172a;
    --dark-light: #ffffff;
    --gray: #64748b;
    --light: #f1f5f9;
    --white: #ffffff;
    --success: #10b981;
    --warning: #f59e0b;
    --gradient: linear-gradient(135deg, #0ea5e9 0%, #06b6d4 100%);
    --gradient-2: linear-gradient(135deg, #e0f2fe 0%, #f0f9ff 100%);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', sans-serif;
    background: linear-gradient(180deg, #e0f2fe 0%, #f0f9ff 50%, #ffffff 100%);
    color: #0f172a;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 30% 20%, rgba(186, 230, 253, 0.3) 0%, transparent 50%),
                radial-gradient(circle at 70% 60%, rgba(165, 243, 252, 0.2) 0%, transparent 50%);
    animation: rotate 25s linear infinite;
    pointer-events: none;
    z-index: 0;
}

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

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    position: relative;
    z-index: 1;
}

header {
    text-align: center;
    padding: 4rem 0 3rem;
    animation: fadeInDown 0.8s ease-out;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

header h1 {
    font-size: 3.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, #0ea5e9 0%, #06b6d4 50%, #14b8a6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 1rem;
    letter-spacing: -2px;
    position: relative;
    display: inline-block;
}

header h1 i {
    font-size: 2.5rem;
    margin-left: 1rem;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.caption {
    font-size: 1.25rem;
    color: #475569;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
}

.search-container {
    max-width: 800px;
    margin: 3rem auto;
    animation: fadeInUp 0.8s ease-out 0.2s both;
}

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

.input-group {
    position: relative;
    background: var(--white);
    border-radius: 20px;
    padding: 0.5rem;
    display: flex;
    gap: 1rem;
    box-shadow: 0 4px 20px rgba(14, 165, 233, 0.12),
                0 0 0 1px rgba(14, 165, 233, 0.08);
    transition: all 0.3s ease;
}

.input-group:focus-within {
    box-shadow: 0 8px 30px rgba(14, 165, 233, 0.2),
                0 0 0 2px var(--primary);
    transform: translateY(-2px);
}

#query {
    flex: 1;
    background: transparent;
    border: none;
    padding: 1.5rem 2rem;
    font-size: 1.1rem;
    color: var(--dark);
    outline: none;
}

#query::placeholder {
    color: #94a3b8;
}

#search-button {
    background: var(--gradient);
    border: none;
    padding: 1.2rem 2.5rem;
    border-radius: 15px;
    color: white;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(14, 165, 233, 0.3);
}

#search-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(14, 165, 233, 0.4);
}

#search-button:active {
    transform: translateY(0);
}

.loading-container {
    text-align: center;
    padding: 3rem;
    animation: fadeIn 0.5s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.spinner {
    width: 60px;
    height: 60px;
    margin: 0 auto 1.5rem;
    border: 4px solid rgba(14, 165, 233, 0.2);
    border-top: 4px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-container p {
    font-size: 1.1rem;
    color: #64748b;
}

.error-container {
    max-width: 800px;
    margin: 2rem auto;
    animation: fadeInUp 0.5s ease-out;
}

.error-message {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.1), rgba(220, 38, 38, 0.1));
    border: 2px solid rgba(239, 68, 68, 0.3);
    padding: 1.5rem 2rem;
    border-radius: 15px;
    color: #fca5a5;
    font-size: 1.1rem;
}

.response-container {
    max-width: 1100px;
    margin: 3rem auto;
    animation: fadeInUp 0.8s ease-out;
}

.response-header {
    background: white;
    padding: 2rem;
    border-radius: 20px 20px 0 0;
    border-bottom: 2px solid rgba(14, 165, 233, 0.15);
}

.response-header h2 {
    font-size: 2rem;
    font-weight: 700;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.response-content {
    background: white;
    padding: 2.5rem;
    border-radius: 0 0 20px 20px;
    box-shadow: 0 4px 20px rgba(14, 165, 233, 0.08);
}

/* Enhanced Results Styling */
.response-content h2,
.response-content h3 {
    color: #0284c7;
    font-weight: 700;
    margin-top: 2rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid rgba(14, 165, 233, 0.15);
}

.response-content h2 {
    font-size: 1.8rem;
    color: #0369a1;
}

.response-content h3 {
    font-size: 1.5rem;
    color: #0284c7;
}

.response-content strong {
    color: #0ea5e9;
    font-weight: 600;
}

.response-content ul {
    list-style: none;
    padding-left: 0;
}

.response-content li {
    padding: 0.75rem 0;
    padding-left: 1.5rem;
    position: relative;
    color: #334155;
    line-height: 1.7;
}

.response-content li::before {
    content: '▸';
    position: absolute;
    left: 0;
    color: var(--primary);
    font-weight: bold;
}

.response-content p {
    color: #475569;
    line-height: 1.8;
    margin: 1rem 0;
}

.response-content a {
    color: #0ea5e9;
    text-decoration: none;
    transition: color 0.3s ease;
    font-weight: 500;
}

.response-content a:hover {
    color: #0284c7;
    text-decoration: underline;
}

/* Platform Cards */
.platform-section {
    background: rgba(240, 249, 255, 0.5);
    border: 1px solid rgba(14, 165, 233, 0.2);
    border-radius: 15px;
    padding: 2rem;
    margin: 2rem 0;
    transition: all 0.3s ease;
}

.platform-section:hover {
    border-color: rgba(14, 165, 233, 0.4);
    box-shadow: 0 4px 20px rgba(14, 165, 233, 0.12);
    transform: translateY(-2px);
}

/* Price Highlights */
.response-content li:has(strong:first-child) {
    background: rgba(224, 242, 254, 0.5);
    border-left: 3px solid var(--primary);
    padding: 1rem 1rem 1rem 1.5rem;
    margin: 0.5rem 0;
    border-radius: 8px;
}

/* Best Deals Section */
.response-content h2:contains("Best Deals"),
.response-content h3:contains("Best Deals") {
    color: #86efac;
    background: linear-gradient(135deg, #86efac 0%, #a7f3d0 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Money Saving Tips */
.response-content h2:contains("Money-Saving"),
.response-content h3:contains("Money-Saving") {
    color: #fde68a;
    background: linear-gradient(135deg, #fde68a 0%, #fef3c7 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Section Dividers */
.response-content hr {
    border: none;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(14, 165, 233, 0.2), transparent);
    margin: 2rem 0;
}

footer {
    text-align: center;
    padding: 4rem 0 2rem;
    color: #64748b;
    font-size: 0.95rem;
    animation: fadeIn 0.8s ease-out 0.4s both;
}

footer p {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

footer p::before {
    content: '⚡';
    font-size: 1.2rem;
}

.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    max-width: 1000px;
    margin: 3rem auto;
    animation: fadeInUp 0.8s ease-out 0.3s both;
}

.feature-card {
    background: white;
    padding: 2rem;
    border-radius: 20px;
    text-align: center;
    transition: all 0.3s ease;
    border: 1px solid rgba(14, 165, 233, 0.1);
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(14, 165, 233, 0.15);
    border-color: var(--primary);
}

.feature-card i {
    font-size: 2.5rem;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 1rem;
}

.feature-card h3 {
    font-size: 1.3rem;
    margin-bottom: 0.75rem;
    color: var(--dark);
}

.feature-card p {
    color: #64748b;
    line-height: 1.6;
}

@media (max-width: 768px) {
    header h1 {
        font-size: 2.5rem;
    }

    .caption {
        font-size: 1.1rem;
    }

    .input-group {
        flex-direction: column;
    }

    #search-button {
        width: 100%;
        justify-content: center;
    }

    .features {
        grid-template-columns: 1fr;
    }

    .response-content {
        padding: 1.5rem;
    }

    .platform-section {
        padding: 1.5rem;
    }
}