/* === Beslutsapp – Huvudstil === */

:root {
    --bg: #FAFAF9;
    --bg-card: #FFFFFF;
    --text: #1A1A1A;
    --text-muted: #6B7280;
    --primary: #2D5F2D;
    --primary-light: #3A7A3A;
    --primary-bg: #E8F5E8;
    --accent: #E8B931;
    --accent-dark: #C9A028;
    --border: #E5E7EB;
    --shadow: 0 2px 8px rgba(0,0,0,0.08);
    --shadow-lg: 0 8px 30px rgba(0,0,0,0.12);
    --radius: 12px;
    --radius-lg: 16px;
    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Mörkt läge */
@media (prefers-color-scheme: dark) {
    :root {
        --bg: #111111;
        --bg-card: #1E1E1E;
        --text: #F0F0F0;
        --text-muted: #9CA3AF;
        --primary: #4CAF50;
        --primary-light: #66BB6A;
        --primary-bg: #1B3A1B;
        --border: #333333;
        --shadow: 0 2px 8px rgba(0,0,0,0.3);
        --shadow-lg: 0 8px 30px rgba(0,0,0,0.4);
    }
}

/* === Reset === */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
}

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* === Vyer === */
.view {
    display: none;
    width: 100%;
}
.view.active {
    display: block;
}

/* === Hem === */
.hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 80vh;
    padding: 2rem;
    text-align: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.logo-icon {
    font-size: 2.5rem;
    line-height: 1;
}

.logo h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary);
    letter-spacing: -0.02em;
}

.tagline {
    font-size: 1.25rem;
    color: var(--text-muted);
    margin-bottom: 2rem;
    font-weight: 400;
}

/* === Sökbox === */
.search-box {
    display: flex;
    align-items: center;
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: 999px;
    padding: 0.5rem 0.5rem 0.5rem 1.5rem;
    width: 100%;
    max-width: 600px;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.search-box:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(45, 95, 45, 0.1);
}

.search-box input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 1.1rem;
    font-family: var(--font);
    background: transparent;
    color: var(--text);
    min-width: 0;
}

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

.search-box button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border: none;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    cursor: pointer;
    transition: background var(--transition), transform 0.15s;
    flex-shrink: 0;
}

.search-box button:hover {
    background: var(--primary-light);
    transform: scale(1.05);
}

.search-box button:active {
    transform: scale(0.95);
}

/* Topp-position (laddning/resultat) */
.search-box-top {
    margin: 1.5rem auto 1rem;
    max-width: 600px;
}

/* === Kategori-chips === */
.category-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
    margin-top: 1.5rem;
    max-width: 600px;
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.5rem 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 999px;
    font-size: 0.9rem;
    color: var(--text);
    cursor: pointer;
    transition: all var(--transition);
    user-select: none;
}

.chip:hover {
    border-color: var(--primary);
    background: var(--primary-bg);
    color: var(--primary);
}

.ai-badge {
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
}

.card-action-search {
    background: var(--accent);
    color: #1A1A1A;
}
.card-action-search:hover {
    background: var(--accent-dark);
}

/* === Laddning === */
.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 2rem;
}

.loading-bar {
    width: 200px;
    height: 3px;
    background: var(--border);
    border-radius: 2px;
    overflow: hidden;
    margin-top: 2rem;
}

.loading-bar-inner {
    width: 40%;
    height: 100%;
    background: var(--primary);
    border-radius: 2px;
    animation: loading 1.2s ease-in-out infinite;
}

@keyframes loading {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(350%); }
}

.loading-text {
    margin-top: 1rem;
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* === Resultat === */
.results-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 1.5rem 3rem;
}

.results-info {
    text-align: center;
    margin: 1rem 0 1.5rem;
}

.results-info .category-badge {
    display: inline-block;
    padding: 0.3rem 0.8rem;
    background: var(--primary-bg);
    color: var(--primary);
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 500;
}

.results-info .results-count {
    display: block;
    margin-top: 0.5rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* === Resultatkort === */
.results-grid {
    display: grid;
    gap: 1.25rem;
}

.result-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    transition: transform var(--transition), box-shadow var(--transition);
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.5s ease forwards;
}

.result-card:nth-child(1) { animation-delay: 0.1s; }
.result-card:nth-child(2) { animation-delay: 0.25s; }
.result-card:nth-child(3) { animation-delay: 0.4s; }

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

.result-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.result-card.top-pick {
    border-color: var(--accent);
    border-width: 2px;
    position: relative;
}

.top-pick-badge {
    position: absolute;
    top: -0.7rem;
    left: 1.5rem;
    background: var(--accent);
    color: #1A1A1A;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.2rem 0.75rem;
    border-radius: 999px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

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

.card-header h3 {
    font-size: 1.3rem;
    font-weight: 600;
    line-height: 1.3;
}

.card-price {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary);
    white-space: nowrap;
}

.card-pitch {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 1rem;
}

.card-rating {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

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

.card-pros {
    list-style: none;
    margin-bottom: 1.25rem;
}

.card-pros li {
    padding: 0.2rem 0;
    font-size: 0.9rem;
    color: var(--text);
}

.card-pros li::before {
    content: '✓ ';
    color: var(--primary);
    font-weight: 600;
}

.card-action {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 600;
    font-family: var(--font);
    cursor: pointer;
    transition: background var(--transition), transform 0.15s;
    text-decoration: none;
}

.card-action:hover {
    background: var(--primary-light);
    transform: scale(1.02);
}

.card-action:active {
    transform: scale(0.98);
}

/* === Inga resultat === */
.no-results {
    text-align: center;
    padding: 3rem 1rem;
}

.no-results-emoji {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.no-results h2 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.no-results p {
    color: var(--text-muted);
    max-width: 400px;
    margin: 0 auto;
}

/* === Tillbaka-knapp === */
.back-btn {
    display: block;
    margin: 2rem auto 0;
    padding: 0.6rem 1.5rem;
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.95rem;
    font-family: var(--font);
    cursor: pointer;
    transition: all var(--transition);
}

.back-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

/* === Footer === */
footer {
    margin-top: auto;
    text-align: center;
    padding: 1.5rem;
    color: var(--text-muted);
    font-size: 0.8rem;
}

/* === Responsivt === */
@media (max-width: 768px) {
    .logo h1 {
        font-size: 1.8rem;
    }
    .logo-icon {
        font-size: 2rem;
    }
    .tagline {
        font-size: 1.05rem;
    }
    .search-box {
        padding: 0.4rem 0.4rem 0.4rem 1rem;
    }
    .search-box input {
        font-size: 1rem;
    }
    .search-box button {
        width: 42px;
        height: 42px;
    }
    .result-card {
        padding: 1.25rem;
    }
    .card-header h3 {
        font-size: 1.1rem;
    }
}

@media (max-width: 480px) {
    .hero {
        padding: 1.5rem 1rem;
        min-height: 70vh;
    }
    .logo h1 {
        font-size: 1.5rem;
    }
    .tagline {
        font-size: 0.95rem;
        margin-bottom: 1.5rem;
    }
    .results-container {
        padding: 0 1rem 2rem;
    }
    .card-header {
        flex-direction: column;
        gap: 0.25rem;
    }
}
