:root {
    --primary: #FF6B6B;
    --primary-dark: #EE5253;
    --secondary: #4ECDC4;
    --dark: #2D3436;
    --gray: #636E72;
    --light-gray: #DFE6E9;
    --bg: #F7F9FC;
    --white: #FFFFFF;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-hover: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg);
    color: var(--dark);
    margin: 0;
    min-height: 100vh;
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, var(--dark) 0%, #2c3e50 100%);
    color: var(--white);
    padding: 60px 20px 40px;
    text-align: center;
    border-radius: 0 0 40px 40px;
    box-shadow: var(--shadow);
}

.hero-content {
    max-width: 700px;
    margin: 0 auto;
}

.logo {
    font-size: 3rem;
    margin: 0;
    letter-spacing: -1px;
    background: -webkit-linear-gradient(45deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.subtitle {
    font-size: 1.1rem;
    color: #b2bec3;
    margin: 10px 0 30px;
}

/* Search Area */
.search-container {
    position: relative;
    max-width: 500px;
    margin: 0 auto 20px;
}

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

.search-icon {
    position: absolute;
    left: 15px;
    font-size: 1.2rem;
    z-index: 2;
}

input {
    width: 100%;
    padding: 16px 16px 16px 45px;
    font-size: 16px;
    border: none;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    transition: all 0.2s ease;
}

input:focus {
    outline: none;
    transform: translateY(-1px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.2);
}

/* Suggestions */
.suggestions {
    position: absolute;
    top: 110%;
    left: 0;
    right: 0;
    background: var(--white);
    border-radius: 12px;
    list-style: none;
    padding: 5px 0;
    margin: 0;
    max-height: 250px;
    overflow-y: auto;
    box-shadow: var(--shadow-hover);
    z-index: 100;
    text-align: left;
    color: var(--dark);
}

.suggestions.hidden {
    display: none;
}

.suggestions li {
    padding: 12px 20px;
    cursor: pointer;
    transition: background 0.1s;
    font-weight: 500;
}

.suggestions li:hover {
    background-color: var(--bg);
    color: var(--primary);
}

.suggestions li.category {
    background-color: #fff9db;
    border-left: 4px solid #fcc419;
}

.suggestions li.category:hover, .suggestions li.category.highlighted {
    background-color: #fff3bf;
}

.suggestions li.category small {
    color: var(--gray);
    font-size: 0.75rem;
    float: right;
    margin-top: 2px;
}

.suggestions li.highlighted {
    background-color: var(--bg);
    color: var(--primary);
    outline: none;
}

/* Tags */
.tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    min-height: 30px;
}

.tag {
    background-color: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--white);
    padding: 8px 16px;
    border-radius: 50px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    animation: fadeIn 0.3s ease;
    backdrop-filter: blur(5px);
}

.tag:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.tag button {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    padding: 0;
    display: flex;
    align-items: center;
}

.tag button:hover {
    color: var(--white);
}

/* Filters */
.filters-container {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.checkbox-label:hover {
    opacity: 1;
}

.checkbox-label input {
    width: 18px;
    height: 18px;
    box-shadow: none;
}

.filter-select {
    padding: 8px 12px;
    border-radius: 8px;
    border: none;
    background-color: rgba(255, 255, 255, 0.9);
    color: var(--dark);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    outline: none;
}

.filter-select:hover {
    background-color: var(--white);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

/* Content Section */
.content-section {
    max-width: 1000px;
    margin: 0 auto;
    padding: 40px 20px;
}

.results-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 30px;
}

.results-header h2 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
}

.count-badge {
    background: var(--secondary);
    color: var(--dark);
    font-size: 0.8rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 12px;
}

.count-badge.hidden {
    display: none;
}

/* Status Message */
.status-message {
    text-align: center;
    color: var(--gray);
    font-size: 1.1rem;
    margin-top: 60px;
    padding: 20px;
}

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

.grid.hidden {
    display: none;
}

.card {
    background: var(--white);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
}

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

.card a {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.card-image-wrapper {
    position: relative;
    padding-top: 60%; /* Aspect ratio */
    background: #eee;
    overflow: hidden;
}

.card img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s;
}

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

.card-content {
    padding: 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.card h3 {
    margin: 0 0 10px;
    font-size: 1.1rem;
    line-height: 1.4;
    color: var(--dark);
}

.meta {
    margin-top: auto;
    display: flex;
    flex-direction: column; /* Changed for tags */
    gap: 6px;
    font-size: 0.85rem;
    color: var(--gray);
    font-weight: 500;
}

.recipe-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 4px;
}

.recipe-tag {
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 600;
}

.recipe-tag.cuisine {
    background-color: #e3f2fd;
    color: #1565c0;
}

.recipe-tag.category {
    background-color: #f3e5f5;
    color: #7b1fa2;
}

.source-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    color: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.source-badge.nrk {
    background-color: #00a3ff;
}

.source-badge.godt {
    background-color: #f9ca24;
    color: #2d3436;
}

.card-ingredients {
    list-style: none;
    padding: 0;
    margin: 15px 0 0;
    font-size: 0.8rem;
    color: var(--gray);
    border-top: 1px solid var(--light-gray);
    padding-top: 12px;
}

.card-ingredients li {
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-ingredients li.more {
    font-style: italic;
    color: var(--primary);
    font-weight: 500;
}

/* Ad Card */
.ad-card {
    background: #fff9db;
    border: 2px dashed #fcc419;
    position: relative;
}

.ad-card .card-content {
    justify-content: center;
    align-items: center;
    text-align: center;
}

.ad-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: #fcc419;
    color: var(--dark);
    font-size: 0.65rem;
    font-weight: 800;
    padding: 2px 6px;
    border-radius: 4px;
    text-transform: uppercase;
}

.ad-title {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--dark);
}

.ad-description {
    font-size: 0.9rem;
    color: var(--gray);
    margin-bottom: 20px;
}

.ad-button {
    background: var(--dark);
    color: white;
    padding: 10px 20px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: background 0.2s;
}

.ad-button:hover {
    background: #000;
}

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

@media (max-width: 600px) {
    .logo { font-size: 2rem; }
    .hero { border-radius: 0 0 25px 25px; padding: 40px 20px 30px; }
}