:root {
    --bg-color: #0f172a;
    --card-bg: rgba(30, 41, 59, 0.7);
    --card-border: rgba(255, 255, 255, 0.1);
    --primary: #8b5cf6;
    --primary-hover: #7c3aed;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --accent: #0ea5e9;
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* Background Blobs for Glassmorphism */
.background-blobs {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: -1;
    overflow: hidden;
}

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

.blob-1 {
    width: 400px; height: 400px;
    background: var(--primary);
    top: -100px; left: -100px;
}

.blob-2 {
    width: 300px; height: 300px;
    background: var(--accent);
    bottom: -50px; right: -50px;
    animation-delay: -5s;
}

.blob-3 {
    width: 250px; height: 250px;
    background: #ec4899;
    top: 40%; left: 50%;
    transform: translate(-50%, -50%);
    animation-delay: -2s;
}

.blob-4 {
    width: 200px; height: 200px;
    background: #14b8a6;
    top: 70%; left: 20%;
    animation-delay: -7s;
}

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

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

header {
    text-align: center;
    margin-bottom: 3rem;
    animation: fadeInDown 0.8s ease-out;
}

header h1 {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    letter-spacing: -1px;
}

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

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

.controls {
    display: flex;
    justify-content: center;
    margin-bottom: 2rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-hover));
    color: white;
    border: none;
    padding: 0.8rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 50px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.6);
}

.btn-primary:active {
    transform: translateY(1px);
}

.btn-primary .icon {
    font-size: 1.2rem;
}

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

.card {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    animation: fadeInUp 0.5s ease-out backwards;
}

.card:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    border-color: rgba(255, 255, 255, 0.2);
}

.card-image-container {
    width: 100%;
    height: 180px;
    background: rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.card-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

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

.no-image {
    font-size: 3rem;
    color: var(--text-muted);
    opacity: 0.5;
}

.card-content {
    padding: 1.5rem;
}

.card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.8rem;
    font-size: 0.85rem;
}

.subreddit-tag {
    background: rgba(139, 92, 246, 0.2);
    color: #a78bfa;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-weight: 600;
}

.time-tag {
    color: var(--text-muted);
}

.card-title {
    font-size: 1.1rem;
    line-height: 1.4;
    margin-bottom: 1.2rem;
    font-weight: 600;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-action {
    display: block;
    text-align: center;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
    text-decoration: none;
    padding: 0.8rem;
    border-radius: 12px;
    font-weight: 600;
    transition: background 0.3s ease;
}

.card-action:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Categories */
.categories {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2.5rem;
    flex-wrap: wrap;
}

.category-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-muted);
    padding: 0.6rem 1.2rem;
    border-radius: 20px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Inter', sans-serif;
}

.category-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-main);
}

.category-btn.active {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: white;
    border-color: transparent;
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3);
}

/* Loading state */
.loader {
    text-align: center;
    padding: 4rem 0;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--primary);
    border-radius: 50%;
    margin: 0 auto 1rem;
    animation: spin 1s linear infinite;
}

.hidden {
    display: none !important;
}

.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    border-radius: 20px;
    border: 1px solid var(--card-border);
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

@keyframes spin { 100% { transform: rotate(360deg); } }
@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 768px) {
    header h1 { font-size: 2.5rem; }
    .container { padding: 1rem; }
    .results-grid { grid-template-columns: 1fr; }
}

/* New component classes */
.card-keys {
    margin-bottom: 1rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.key-badge {
    background: rgba(16, 185, 129, 0.2);
    color: #34d399;
    padding: 0.3rem 0.6rem;
    border-radius: 8px;
    font-family: monospace;
    font-size: 0.9rem;
    font-weight: bold;
    border: 1px solid rgba(52, 211, 153, 0.3);
    letter-spacing: 0.05em;
    cursor: pointer;
    transition: background 0.2s;
}

.key-badge:hover {
    background: rgba(16, 185, 129, 0.4);
}

.price-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.price-old {
    text-decoration: line-through;
    color: #94a3b8;
    font-size: 0.9rem;
}

.price-new {
    color: #10b981;
    font-weight: 700;
    font-size: 1.3rem;
    text-shadow: 0 0 10px rgba(16, 185, 129, 0.4);
}

.card-excerpt {
    margin-bottom: 1rem;
    font-size: 0.85rem;
    color: #cbd5e1;
    line-height: 1.5;
    background: rgba(255,255,255,0.03);
    padding: 0.75rem;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.05);
}
