:root {
    --bg-dark: #0f172a;
    --glass-bg: rgba(30, 41, 59, 0.4);
    --glass-border: rgba(255, 255, 255, 0.1);
    --accent-red: #f43f5e;
    --accent-purple: #8b5cf6;
    --accent-blue: #3b82f6;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Outfit', sans-serif;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* Dynamic Gradients Background */
.background-gradients {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    z-index: -1;
    overflow: hidden;
}

.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.5;
    animation: float 20s infinite ease-in-out alternate;
}

.blob-1 {
    width: 600px; height: 600px;
    background: radial-gradient(circle, var(--accent-purple), transparent 70%);
    top: -100px; left: -100px;
}

.blob-2 {
    width: 500px; height: 500px;
    background: radial-gradient(circle, var(--accent-red), transparent 70%);
    bottom: -100px; right: -100px;
    animation-delay: -5s;
}

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

/* Typography & Layout */
.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 40px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.header {
    text-align: center;
    margin-bottom: 50px;
}

.title {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 10px;
}

.title span {
    background: linear-gradient(90deg, var(--accent-red), var(--accent-purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.subtitle {
    font-size: 1.2rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
}

/* Glassmorphism Classes */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
}

/* Upload Section */
.upload-section {
    width: 100%;
    max-width: 600px;
}

.drop-zone {
    padding: 60px 40px;
    text-align: center;
    border: 2px dashed rgba(139, 92, 246, 0.5);
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.drop-zone:hover, .drop-zone.dragover {
    border-color: var(--accent-purple);
    background: rgba(139, 92, 246, 0.1);
    transform: translateY(-5px);
}

.upload-icon {
    width: 64px; height: 64px;
    color: var(--accent-purple);
    margin-bottom: 20px;
}

.drop-content h3 { font-size: 1.5rem; margin-bottom: 10px; }
.drop-content p { color: var(--text-secondary); }

.preview-img {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    object-fit: contain;
    background: rgba(0,0,0,0.8);
    z-index: 5;
}

/* Scanner Animation */
.scanner {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(4px);
    z-index: 10;
    display: flex;
    justify-content: center;
    align-items: center;
}

.laser {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 2px;
    background: #00ffcc;
    box-shadow: 0 0 20px #00ffcc;
    animation: scan 2s linear infinite alternate;
}

.scan-text {
    color: #00ffcc;
    font-weight: 600;
    letter-spacing: 2px;
    animation: pulse 1s infinite alternate;
}

@keyframes scan {
    0% { top: 0%; }
    100% { top: 100%; }
}
@keyframes pulse {
    from { opacity: 0.5; }
    to { opacity: 1; }
}

.hidden { display: none !important; }

/* Results Grid */
.results-section {
    width: 100%;
    margin-top: 60px;
    animation: fadeIn 0.8s ease forwards;
}

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

.results-title {
    font-size: 2rem; margin-bottom: 30px; text-align: center;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
}

/* Product Card */
.card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
    display: flex;
    flex-direction: column;
}

.card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
    border-color: var(--accent-purple);
}

.card-img-wrapper {
    width: 100%;
    height: 250px;
    overflow: hidden;
    position: relative;
    background: #fff; /* Amazon images often have white background */
}

.card-img {
    width: 100%; height: 100%;
    object-fit: contain;
    transition: transform 0.5s;
}

.card:hover .card-img { transform: scale(1.1); }

.match-badge {
    position: absolute;
    top: 15px; right: 15px;
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 800;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.card-body { padding: 20px; flex-grow: 1; display: flex; flex-direction: column; }
.card-title { font-size: 1.1rem; line-height: 1.4; margin-bottom: 15px; font-weight: 600; }
.card-price { font-size: 1.5rem; color: #10b981; font-weight: 800; margin-bottom: 20px; }

.btn-amazon {
    margin-top: auto;
    display: block;
    width: 100%; text-align: center;
    background: linear-gradient(90deg, #ff9900, #ffb84d);
    color: #111;
    padding: 12px;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 800;
    transition: all 0.3s;
}

.btn-amazon:hover {
    transform: scale(1.02);
    box-shadow: 0 0 20px rgba(255, 153, 0, 0.4);
}
