/* Core Variables & Colors */
:root {
    --bg-color: #0b0f19;
    --panel-bg: rgba(255, 255, 255, 0.03);
    --panel-border: rgba(255, 255, 255, 0.08);
    --primary: #6c5ce7;
    --primary-hover: #8073ea;
    --accent: #00d2d3;
    --text-main: #f5f6fa;
    --text-muted: #a4b0be;
    --danger: #ff6b81;
    --success: #2ed573;
}

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

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    min-height: 100vh;
    /* Rich aesthetic background with subtle gradients */
    background-image: 
        radial-gradient(circle at 15% 50%, rgba(108, 92, 231, 0.15), transparent 35%),
        radial-gradient(circle at 85% 30%, rgba(0, 210, 211, 0.15), transparent 35%);
    background-attachment: fixed;
    line-height: 1.6;
}

.app-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 4rem 1.5rem;
}

/* Header Styles */
header {
    text-align: center;
    margin-bottom: 3.5rem;
    animation: fadeInDown 0.8s ease;
}

header h1 {
    font-size: 4rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    letter-spacing: -1.5px;
}

.highlight {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

header p {
    color: var(--text-muted);
    font-size: 1.2rem;
    font-weight: 300;
}

/* Glassmorphism Panels */
.glass-panel {
    background: var(--panel-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--panel-border);
    border-radius: 24px;
    padding: 2rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

/* Search Section */
.search-section {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-bottom: 3rem;
    animation: fadeInUp 0.8s ease 0.2s both;
}

.search-controls {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    align-items: center;
    width: 100%;
}

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

.search-input {
    flex: 2;
    min-width: 250px;
}

.api-input {
    flex: 1;
    min-width: 200px;
}

.input-group svg {
    position: absolute;
    left: 1.2rem;
    color: var(--text-muted);
}

input {
    width: 100%;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--panel-border);
    color: var(--text-main);
    padding: 1.2rem 1.5rem 1.2rem 3.5rem;
    border-radius: 16px;
    font-size: 1.05rem;
    font-family: inherit;
    transition: all 0.3s ease;
}

input:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(0, 0, 0, 0.5);
    box-shadow: 0 0 0 4px rgba(108, 92, 231, 0.15);
}

input::placeholder {
    color: var(--text-muted);
}

button {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: white;
    border: none;
    padding: 0 2.5rem;
    height: 60px;
    border-radius: 16px;
    font-size: 1.1rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 180px;
    position: relative;
    overflow: hidden;
}

button:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 10px 25px rgba(108, 92, 231, 0.4);
}

button:active {
    transform: translateY(0) scale(0.98);
}

/* Quick Suggestions */
.quick-suggestions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.8rem;
    margin-top: 0.5rem;
}

.suggestion-label {
    color: var(--text-muted);
    font-size: 0.95rem;
    font-weight: 300;
}

.chip {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--panel-border);
    color: var(--text-muted);
    padding: 0.4rem 1rem;
    height: auto;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 400;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: unset;
}

.chip:hover {
    background: rgba(108, 92, 231, 0.2);
    border-color: var(--primary);
    color: var(--text-main);
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

/* Results Grid */
.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem;
}

.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 5rem 0;
    color: var(--text-muted);
    font-size: 1.2rem;
    animation: fadeInUp 0.5s ease both;
}

/* Product Card */
.product-card {
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    border-radius: 20px;
    padding: 1.5rem;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    flex-direction: column;
    animation: fadeInUp 0.5s ease both;
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
}

.product-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s ease;
}

.product-card:hover {
    transform: translateY(-10px);
    border-color: rgba(0, 210, 211, 0.3);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4), 0 0 20px rgba(0, 210, 211, 0.1);
    background: rgba(255, 255, 255, 0.05);
}

.product-card:hover::before {
    transform: scaleX(1);
}

.product-image-container {
    width: 100%;
    height: 220px;
    background: #fff;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    padding: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transition: transform 0.4s ease;
}

.product-card:hover .product-image {
    transform: scale(1.08);
}

.product-source {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 0.8rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.trusted-badge {
    background: rgba(46, 213, 115, 0.15);
    color: var(--success);
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    border: 1px solid rgba(46, 213, 115, 0.3);
}

.product-title {
    font-size: 1.2rem;
    font-weight: 400;
    margin-bottom: 1.5rem;
    flex-grow: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
}

.product-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    border-top: 1px solid var(--panel-border);
    padding-top: 1.2rem;
}

.product-price {
    font-size: 1.8rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.5px;
}

.buy-link {
    background: rgba(255, 255, 255, 0.08);
    color: white;
    text-decoration: none;
    padding: 0.8rem 1.2rem;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.buy-link:hover {
    background: #fff;
    color: #000;
    box-shadow: 0 4px 15px rgba(255, 255, 255, 0.3);
}

/* Error/Info Box */
.error-box {
    background: rgba(255, 107, 129, 0.1);
    border: 1px solid var(--danger);
    color: var(--danger);
    padding: 1.2rem 1.5rem;
    border-radius: 16px;
    margin-bottom: 2rem;
    text-align: center;
    font-weight: 600;
    backdrop-filter: blur(8px);
    animation: fadeInUp 0.4s ease;
}

.error-box.info {
    background: rgba(46, 213, 115, 0.1);
    border-color: var(--success);
    color: var(--success);
}

.hidden {
    display: none !important;
}

/* Loader */
.loader {
    width: 24px;
    height: 24px;
    border: 3px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s cubic-bezier(0.5, 0.1, 0.4, 0.9) infinite;
}

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

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

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

/* Responsive */
@media (max-width: 768px) {
    header h1 {
        font-size: 3rem;
    }
    .search-controls {
        flex-direction: column;
    }
    .input-group, button {
        width: 100%;
        min-width: 100%;
    }
    .results-grid {
        grid-template-columns: 1fr;
    }
}
