:root {
    --bg-dark: #0f1115;
    --text-primary: #ffffff;
    --text-secondary: #94a3b8;
    --accent: #3b82f6;
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.08);
}

body {
    margin: 0;
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-primary);
    background-image: radial-gradient(circle at 50% -20%, #1e3a8a 0%, transparent 60%);
    min-height: 100vh;
}

header {
    padding: 2rem 5%;
}

h1 {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -1px;
}

.highlight {
    color: var(--accent);
}

.hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 4rem 1rem;
}

h2 {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 1rem;
    background: linear-gradient(to right, #fff, #94a3b8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero p {
    color: var(--text-secondary);
    max-width: 600px;
    font-size: 1.1rem;
    line-height: 1.5;
    margin-bottom: 3rem;
}

/* Glassmorphism Search Bar */
.search-container {
    display: flex;
    align-items: center;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 50px;
    padding: 0.5rem 0.5rem 0.5rem 1.5rem;
    width: 100%;
    max-width: 700px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.4);
    backdrop-filter: blur(12px);
    transition: box-shadow 0.3s ease;
}

.search-container:focus-within {
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.5);
}

input {
    flex: 1;
    background: transparent;
    border: none;
    color: white;
    font-size: 1.1rem;
    outline: none;
    font-family: 'Inter', sans-serif;
}

input::placeholder {
    color: #475569;
}

button {
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 50%;
    width: 48px;
    height: 48px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
}

button:hover {
    transform: scale(1.05);
}

/* Results Section */
#results-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 5%;
}

.hidden {
    display: none !important;
}

/* Loader */
#loader {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 4rem;
    color: var(--text-secondary);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--glass-border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

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

/* Cards Grid */
#cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 2rem;
    backdrop-filter: blur(10px);
    transition: transform 0.3s ease, border-color 0.3s;
    animation: slideUp 0.5s ease forwards;
    opacity: 0;
    transform: translateY(20px);
}

.card:hover {
    transform: translateY(-5px);
    border-color: rgba(255,255,255,0.2);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.card-img {
    width: 100%;
    height: 180px;
    object-fit: contain;     /* Keep the product fully visible instead of cropping */
    background: transparent;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    filter: drop-shadow(0 4px 6px rgba(0,0,0,0.4));
}

.rank {
    background: rgba(59, 130, 246, 0.2);
    color: var(--accent);
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 800;
}

.card h3 {
    font-size: 1.3rem;
    margin: 0 0 1rem 0;
    line-height: 1.4;
}

.metrics {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.metric {
    display: flex;
    flex-direction: column;
}

.metric-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.metric-value {
    font-size: 1.2rem;
    font-weight: 600;
}

.pitch {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.6;
    border-top: 1px solid var(--glass-border);
    padding-top: 1.5rem;
}

.laptop-specs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.spec-badge {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    padding: 0.4rem 0.6rem;
    font-size: 0.75rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
}

@keyframes slideUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dev-toggle-container {
    margin-top: 1.5rem;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
}

.dev-toggle-container label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 0.9rem;
    transition: color 0.2s;
}

.dev-toggle-container label:hover {
    color: var(--accent);
}

#dev-data {
    background: #111827;
    border: 1px solid rgba(59, 130, 246, 0.5);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    font-family: inherit;
    font-size: 0.9rem;
    color: #94a3b8;
    box-shadow: 0 10px 20px rgba(0,0,0,0.5);
    line-height: 1.6;
}

#dev-data h4 {
    margin: 0 0 1rem 0;
    color: #3b82f6;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 1px;
}

.insights-btn {
    border-radius: 20px;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    background: transparent;
    border: 1px solid var(--glass-border);
    color: var(--text-secondary);
    cursor: pointer;
    margin-left: 1rem;
    width: auto;
    height: auto;
}

.insights-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: none;
}

#market-insights-container {
    width: 100%;
    max-width: 800px;
    margin: 2rem auto;
    background: var(--glass-bg);
    padding: 2rem;
    border-radius: 16px;
    border: 1px solid var(--glass-border);
}

#topsis-controls {
    max-width: 800px;
    margin: 0 auto 2rem;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 1.5rem;
}

#topsis-controls h3 {
    margin-top: 0;
    text-align: center;
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.sliders-row {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
}

.slider-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
}

.slider-group label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.slider-val {
    margin-top: 0.5rem;
    font-weight: 800;
    color: var(--accent);
}
