/* ==========================================================================
   DESIGN SYSTEM - COZINHA DE DORAMA
   ========================================================================== */

:root {
    /* Color Palette */
    --bg-primary: #FAF6F0;       /* Soft Cream */
    --bg-card: #FFFFFF;          /* Pure White */
    --text-primary: #2A2625;     /* Dark Charcoal */
    --text-muted: #7E746F;       /* Warm Gray */
    --accent-coral: #E57C69;     /* K-Drama Coral Pink */
    --accent-sage: #8FB9A8;      /* Sage Green */
    --accent-yellow: #FEDC81;    /* Warm Yellow */
    --border-light: rgba(226, 217, 203, 0.5); /* Soft border */
    
    /* Typography */
    --font-sans: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --font-serif: 'Playfair Display', Georgia, serif;
    
    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(126, 116, 111, 0.08);
    --shadow-md: 0 8px 24px rgba(126, 116, 111, 0.12);
    --shadow-lg: 0 16px 36px rgba(126, 116, 111, 0.18);
    
    /* Transitions */
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
    --transition-fast: 0.2s var(--ease-spring);
    --transition-smooth: 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* Reset & Base Styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: var(--font-sans);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.5;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Base Web App Container */
.app-container {
    width: 100%;
    height: 100vh;
    background-color: var(--bg-primary);
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Common Screens and Layouts */
.screen {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    padding-bottom: 80px; /* Spacer for bottom nav */
    transition: opacity var(--transition-smooth);
}

.hidden {
    display: none !important;
}

/* Welcome / Auth Screen */
#auth-screen {
    justify-content: center;
    align-items: center;
    padding: 24px;
    background: linear-gradient(135deg, #FAF6F0 0%, #F5EDE0 100%);
    padding-bottom: 0;
}

.auth-card {
    width: 100%;
    background-color: var(--bg-card);
    border-radius: 24px;
    padding: 32px 24px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-light);
    display: flex;
    flex-direction: column;
    gap: 24px;
    animation: slideUp var(--transition-fast);
}

.brand-logo {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.logo-badge {
    font-size: 2.5rem;
    padding: 12px;
    background-color: rgba(229, 124, 105, 0.1);
    border-radius: 20px;
    margin-bottom: 8px;
}

.brand-logo h1 {
    font-family: var(--font-serif);
    font-size: 2rem;
    color: var(--text-primary);
}

.brand-tagline {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-muted);
}

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

.input-wrapper i {
    position: absolute;
    left: 14px;
    width: 18px;
    height: 18px;
    stroke: var(--text-muted);
}

.input-wrapper input {
    width: 100%;
    padding: 14px 14px 14px 42px;
    border-radius: 12px;
    border: 1px solid #D2C5B5;
    background-color: var(--bg-primary);
    font-family: var(--font-sans);
    font-size: 0.95rem;
    color: var(--text-primary);
    transition: all var(--transition-fast);
}

.input-wrapper input:focus {
    outline: none;
    border-color: var(--accent-coral);
    background-color: var(--bg-card);
    box-shadow: 0 0 0 3px rgba(229, 124, 105, 0.15);
}

.btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 16px;
    border-radius: 12px;
    border: none;
    font-family: var(--font-sans);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-primary {
    background-color: var(--accent-coral);
    color: #FFF;
}

.btn-primary:active {
    transform: scale(0.97);
    background-color: #d16b5a;
}

.auth-help {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-align: center;
    line-height: 1.4;
}

/* Main Dashboard Header */
.app-header {
    background-color: rgba(250, 246, 240, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    position: sticky;
    top: 0;
    z-index: 10;
    padding: 20px 20px 12px 20px;
    border-bottom: 1px solid var(--border-light);
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.user-greeting {
    display: flex;
    align-items: center;
    gap: 12px;
}

.avatar {
    width: 44px;
    height: 44px;
    background-color: var(--accent-sage);
    color: #FFF;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    font-weight: 600;
}

.user-greeting h2 {
    font-size: 1rem;
    font-weight: 600;
}

.user-greeting p {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.icon-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--bg-card);
    border: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-fast);
}

.icon-btn i {
    width: 18px;
    height: 18px;
    stroke: var(--text-primary);
}

.icon-btn:active {
    transform: scale(0.92);
}

/* Search and Filters */
.search-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.search-bar {
    position: relative;
    display: flex;
    align-items: center;
}

.search-bar i {
    position: absolute;
    left: 12px;
    width: 18px;
    height: 18px;
    stroke: var(--text-muted);
}

.search-bar input {
    width: 100%;
    padding: 12px 12px 12px 38px;
    border-radius: 12px;
    border: 1px solid var(--border-light);
    background-color: rgba(226, 217, 203, 0.3);
    font-family: var(--font-sans);
    font-size: 0.9rem;
    transition: all var(--transition-fast);
}

.search-bar input:focus {
    outline: none;
    border-color: var(--accent-coral);
    background-color: var(--bg-card);
}

.filter-tabs {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    scrollbar-width: none; /* Hide scrollbar for Firefox */
}

.filter-tabs::-webkit-scrollbar {
    display: none; /* Hide scrollbar for Chrome/Safari */
}

.filter-tab {
    padding: 8px 16px;
    border-radius: 20px;
    border: 1px solid var(--border-light);
    background-color: var(--bg-card);
    font-family: var(--font-sans);
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    white-space: nowrap;
    transition: var(--transition-fast);
}

.filter-tab.active {
    background-color: var(--accent-coral);
    color: #FFF;
    border-color: var(--accent-coral);
    box-shadow: 0 4px 12px rgba(229, 124, 105, 0.2);
}

/* Dashboard Content Grid */
.app-content {
    flex: 1;
    overflow-y: auto;
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.content-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.section-title {
    font-family: var(--font-serif);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
}

.section-header-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.badge {
    background-color: rgba(143, 185, 168, 0.15);
    color: var(--accent-sage);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 12px;
}

/* Featured Card */
.featured-card {
    border-radius: 20px;
    overflow: hidden;
    box-shadow: var(--shadow-md);
    cursor: pointer;
    transition: var(--transition-fast);
}

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

.featured-card-img {
    height: 180px;
    background-size: cover;
    background-position: center;
    position: relative;
    padding: 16px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.category-badge {
    align-self: flex-start;
    background-color: var(--accent-yellow);
    color: var(--text-primary);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
}

.featured-content {
    color: #FFF;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.dorama-tag {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--accent-yellow);
    display: flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 4px;
}

.featured-content h3 {
    font-family: var(--font-serif);
    font-size: 1.4rem;
}

.featured-content p {
    font-size: 0.8rem;
    opacity: 0.9;
}

/* Grid of Recipes */
.recipes-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.recipe-card {
    background-color: var(--bg-card);
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    transition: var(--transition-fast);
}

.recipe-card:active {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.card-img-wrapper {
    height: 110px;
    background-size: cover;
    background-position: center;
    position: relative;
    padding: 8px;
}

.fav-card-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background-color: rgba(0, 0, 0, 0.4);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    backdrop-filter: blur(4px);
}

.fav-card-btn i {
    width: 14px;
    height: 14px;
}

.category-badge-small {
    position: absolute;
    bottom: 8px;
    left: 8px;
    font-size: 0.65rem;
    font-weight: 600;
    padding: 3px 6px;
    border-radius: 6px;
    background-color: rgba(255, 255, 255, 0.9);
    color: var(--text-primary);
}

.alcoholic-badge {
    position: absolute;
    bottom: 8px;
    right: 8px;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 3px 6px;
    border-radius: 6px;
    background-color: #E57C69;
    color: #FFFFFF;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.card-info {
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}

.card-dorama {
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--accent-coral);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-title {
    font-family: var(--font-serif);
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1.3;
    height: 2.6rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-meta {
    display: flex;
    justify-content: space-between;
    margin-top: auto;
    font-size: 0.7rem;
    color: var(--text-muted);
}

.card-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Empty State */
.empty-state {
    grid-column: span 2;
    text-align: center;
    padding: 40px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    color: var(--text-muted);
}

/* Bottom Navigation Bar */
.bottom-nav {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 72px;
    background-color: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid var(--border-light);
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding-bottom: env(safe-area-inset-bottom);
    z-index: 10;
}

.nav-btn {
    border: none;
    background: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    color: var(--text-muted);
    cursor: pointer;
    width: 60px;
    transition: var(--transition-fast);
}

.nav-btn i {
    width: 20px;
    height: 20px;
    stroke-width: 2px;
}

.nav-btn span {
    font-size: 0.7rem;
    font-weight: 500;
}

.nav-btn.active {
    color: var(--accent-coral);
}

/* Detail Screen Layout */
.detail-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    background-color: var(--bg-primary);
    position: sticky;
    top: 0;
    z-index: 12;
    border-bottom: 1px solid var(--border-light);
}

.back-btn {
    border: none;
    background: none;
    display: flex;
    align-items: center;
    gap: 4px;
    font-family: var(--font-sans);
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    cursor: pointer;
}

.nav-title-wrapper {
    flex: 1;
    text-align: center;
    max-width: 60%;
}

.nav-dorama {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--accent-coral);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
}

.detail-scroll-container {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.detail-banner {
    height: 240px;
    background-size: cover;
    background-position: center;
    position: relative;
    display: flex;
    align-items: flex-end;
}

.detail-banner-overlay {
    width: 100%;
    padding: 24px;
    color: #FFF;
    text-shadow: 0 2px 8px rgba(0,0,0,0.6);
}

.detail-banner-overlay h1 {
    font-family: var(--font-serif);
    font-size: 1.8rem;
    line-height: 1.2;
    margin-top: 4px;
}

.korean-name {
    font-size: 0.9rem;
    opacity: 0.9;
}

.detail-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Cards System inside Details */
.card {
    background-color: var(--bg-card);
    border-radius: 16px;
    border: 1px solid var(--border-light);
    padding: 16px;
    box-shadow: var(--shadow-sm);
}

.dorama-context-card {
    border-left: 4px solid var(--accent-coral);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.dorama-header {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.icon-tag {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 4px;
}

.dorama-header h3 {
    font-family: var(--font-serif);
    font-size: 1.15rem;
    color: var(--text-primary);
}

.dorama-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.4;
}

/* Embedded Youtube Player */
.youtube-player {
    border-radius: 12px;
    overflow: hidden;
    margin-top: 8px;
    box-shadow: var(--shadow-sm);
    aspect-ratio: 16/9;
}

/* Recipe Stats */
.recipe-stats {
    display: grid;
    grid-template-columns: 1fr 1.1fr 1fr;
    background-color: var(--bg-card);
    border-radius: 16px;
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-sm);
    padding: 14px;
    gap: 8px;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.stat-item i {
    width: 20px;
    height: 20px;
    stroke: var(--accent-sage);
}

.stat-label {
    display: block;
    font-size: 0.65rem;
    color: var(--text-muted);
}

.stat-val {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
}

.portions-controls {
    display: flex;
    align-items: center;
    gap: 6px;
}

.portion-btn {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 1px solid var(--border-light);
    background-color: var(--bg-primary);
    font-family: var(--font-sans);
    font-weight: 600;
    font-size: 0.75rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.portion-btn:active {
    background-color: #E2D9CB;
}

/* Ingredient substitution tips alert box */
.substitution-card {
    background-color: rgba(143, 185, 168, 0.1);
    border-left: 4px solid var(--accent-sage);
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.sub-header {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--accent-sage);
}

.sub-header h4 {
    font-size: 0.85rem;
    font-weight: 600;
}

.substitution-card p {
    font-size: 0.8rem;
    color: var(--text-primary);
    line-height: 1.4;
}

/* Ingredients list with checkboxes */
.detail-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.section-subtitle {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.ingredients-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ingredients-list li {
    background-color: var(--bg-card);
    border-radius: 12px;
    border: 1px solid var(--border-light);
    padding: 12px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition-fast);
}

.ingredient-checkbox {
    display: flex;
    align-items: center;
    cursor: pointer;
    gap: 12px;
}

/* Hide native checkbox */
.ingredient-checkbox input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

/* Custom Checkbox circle */
.custom-checkbox {
    min-width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 2px solid #D2C5B5;
    background-color: #FFF;
    display: inline-block;
    position: relative;
    transition: var(--transition-fast);
}

.ingredient-checkbox input:checked ~ .custom-checkbox {
    background-color: var(--accent-sage);
    border-color: var(--accent-sage);
}

/* Custom check icon */
.custom-checkbox::after {
    content: "";
    position: absolute;
    display: none;
    left: 7px;
    top: 3px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.ingredient-checkbox input:checked ~ .custom-checkbox::after {
    display: block;
}

.ingredient-text {
    font-size: 0.85rem;
    color: var(--text-primary);
    line-height: 1.3;
}

.ingredient-checkbox input:checked ~ .ingredient-text {
    text-decoration: line-through;
    opacity: 0.6;
}

.ingredient-amount {
    color: var(--accent-coral);
}

/* Steps list */
.steps-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.step-item {
    background-color: var(--bg-card);
    border-radius: 16px;
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-sm);
    padding: 16px;
    display: flex;
    gap: 12px;
    counter-increment: step-counter;
}

.step-item::before {
    content: counter(step-counter);
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background-color: var(--accent-coral);
    color: #FFF;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
    flex-shrink: 0;
}

.step-item p {
    font-size: 0.85rem;
    line-height: 1.4;
    color: var(--text-primary);
}

/* DYNAMIC WATERMARK OVERLAY (Security Defense)
   Covers the screen obliquely with user CPF and Email at low opacity,
   making screenshot tracing immediate and preventing refund fraud leaks. */
.watermark-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 100;
    pointer-events: none; /* User can click through it completely */
    user-select: none;
    overflow: hidden;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(3, 1fr);
    opacity: 0.05; /* Barely visible to reader, highly visible to camera/screenshot */
    mix-blend-mode: difference;
}

.watermark-text {
    font-size: 0.55rem;
    font-weight: 700;
    color: #A09080;
    text-transform: uppercase;
    white-space: nowrap;
    transform: rotate(-25deg);
    display: flex;
    align-items: center;
    justify-content: center;
    letter-spacing: 1px;
}

/* Animations */
@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.sparkle {
    display: inline-block;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-4px) scale(1.1); }
}

/* ==========================================================================
   LOCKED CONTENT & UPSELL SYSTEM
   ========================================================================== */

/* Locked Recipe Card Blur */
.recipe-card.locked {
    position: relative;
    opacity: 0.9;
}

.lock-card-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(42, 38, 37, 0.45);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    color: #FFFFFF;
    font-size: 0.8rem;
    font-weight: 600;
    z-index: 3;
    pointer-events: none; /* Clicking overlay triggers click on card */
}

/* Upsell Modal Overlay (Fullscreen Blur) */
.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: flex-end; /* Slide up bottom sheet effect */
    justify-content: center;
    z-index: 200;
    animation: fadeInModal 0.25s ease-out;
}

@keyframes fadeInModal {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Upsell Bottom Sheet Card */
.modal-sheet {
    width: 100%;
    background-color: var(--bg-primary);
    border-radius: 28px 28px 0 0;
    padding: 32px 24px 24px 24px;
    box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    gap: 20px;
    position: relative;
    animation: slideUpSheet 0.35s cubic-bezier(0.25, 0.8, 0.25, 1);
}

@keyframes slideUpSheet {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

.close-modal-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: rgba(226, 217, 203, 0.4);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-fast);
}

.close-modal-btn i {
    width: 16px;
    height: 16px;
    stroke: var(--text-primary);
}

.close-modal-btn:active {
    transform: scale(0.9);
}

.upsell-header {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.upsell-badge-icon {
    font-size: 1.8rem;
    background-color: rgba(229, 124, 105, 0.15);
    width: 52px;
    height: 52px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 4px;
}

.upsell-header h2 {
    font-family: var(--font-serif);
    font-size: 1.4rem;
    color: var(--text-primary);
}

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

.upsell-body {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.upsell-body p {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.4;
    text-align: center;
}

/* Preview Card of Upsell Product */
.upsell-preview-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: 16px;
    padding: 12px;
    display: flex;
    gap: 12px;
    align-items: center;
    box-shadow: var(--shadow-sm);
}

.preview-img {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    background-size: cover;
    background-position: center;
    background-color: #E2D9CB;
}

.preview-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.preview-tag {
    font-size: 0.65rem;
    color: var(--accent-sage);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.preview-info h4 {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
}

.preview-price {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.preview-price strong {
    color: var(--accent-coral);
    font-size: 1.05rem;
}

/* Footer buttons */
.upsell-footer {
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: center;
}

.btn-large {
    width: 100%;
    padding: 16px;
    text-decoration: none;
}

.btn-secondary-link {
    background: none;
    border: none;
    font-family: var(--font-sans);
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-muted);
    text-decoration: underline;
    cursor: pointer;
    transition: var(--transition-fast);
}

.btn-secondary-link:active {
    opacity: 0.7;
}

/* Recipe Detail Intermediate Image */
.intermediate-image-container {
    width: 100%;
    margin: 28px 0;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-light);
    height: 180px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.intermediate-recipe-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-smooth);
}

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

/* ==========================================================================
   BRAND LOGOS & CUSTOM DESIGN SYSTEMS
   ========================================================================== */
.brand-logo-img {
    width: 90px;
    height: 90px;
    object-fit: cover;
    border-radius: 24px;
    margin-bottom: 8px;
    box-shadow: var(--shadow-md);
    border: 2.5px solid var(--accent-coral);
    background-color: var(--bg-card);
}

.avatar-logo {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--accent-sage);
    box-shadow: var(--shadow-sm);
    background-color: var(--bg-card);
}

/* ==========================================================================
   RESPONSIVE MEDIA QUERIES (PC, TABLET, MOBILE)
   ========================================================================== */

@media (min-width: 768px) {
    /* 1. Body & Fluid Container */
    body {
        background-color: var(--bg-primary); /* Consistent warm soft cream background */
        padding: 0;
        align-items: stretch;
        overflow-y: auto; /* Natural browser scrollbar usage */
    }

    .app-container {
        max-width: 100%; /* Spans full browser width */
        margin: 0;
        height: auto; /* Expand naturally with the document flow */
        border-radius: 0;
        box-shadow: none;
        border: none;
        overflow: visible;
    }

    /* 2. Welcome Login Card Centering on full screen */
    #auth-screen {
        min-height: 100vh;
        justify-content: center;
        align-items: center;
    }

    .auth-card {
        max-width: 420px;
        margin: 0 auto;
    }

    /* 3. Navigation Bar moved to Top as a Sticky Header navbar */
    .bottom-nav {
        order: -1; /* Move navigation to the top of container flow */
        position: sticky;
        top: 0;
        left: 0;
        width: 100%;
        height: 70px;
        border-top: none;
        border-bottom: 1px solid var(--border-light);
        justify-content: center; /* Centered menu items for a cleaner editorial look */
        padding: 0 40px;
        gap: 32px;
        background-color: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(16px);
        -webkit-backdrop-filter: blur(16px);
        padding-bottom: 0;
        z-index: 100;
        box-shadow: var(--shadow-sm);
    }

    .nav-btn {
        flex-direction: row; /* Icon and text inline */
        gap: 8px;
        width: auto;
        padding: 8px 16px;
        border-radius: 12px;
        transition: background-color var(--transition-fast);
    }

    .nav-btn span {
        font-size: 0.85rem;
    }

    .nav-btn:hover {
        background-color: rgba(229, 124, 105, 0.08);
    }

    .nav-btn.active {
        background-color: rgba(229, 124, 105, 0.12);
    }

    /* 4. Screen Height layout adjustment (no inner panel scrolling) */
    .screen {
        height: auto;
        overflow-y: visible;
        padding-bottom: 60px;
    }

    .detail-scroll-container {
        height: auto;
        overflow-y: visible;
    }

    /* 5. Header Grid (Centered & Wide container) */
    .app-header {
        max-width: 1280px;
        margin: 0 auto;
        width: 100%;
        padding: 40px 40px 20px 40px;
        display: flex;
        justify-content: space-between;
        align-items: center;
        flex-direction: row;
        gap: 24px;
        background-color: transparent;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        border-bottom: none;
        position: static;
    }

    .header-top {
        margin-bottom: 0;
        flex: 1;
    }

    .search-section {
        flex-direction: row;
        align-items: center;
        flex: 1.5;
        gap: 16px;
        justify-content: flex-end;
    }

    .search-bar {
        width: 280px;
    }

    /* 6. Dashboard Grid Columns (Centered & Wide container) */
    .app-content {
        max-width: 1280px;
        margin: 0 auto;
        width: 100%;
        padding: 0 40px 40px 40px;
        overflow-y: visible;
    }

    .recipes-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 28px;
    }

    /* 7. Featured Card layout */
    .featured-card-img {
        height: 280px;
        padding: 28px;
    }

    .featured-content h3 {
        font-size: 1.8rem;
    }

    /* 8. Recipe Detail Screen split into 2 Columns (Wide layout) */
    .detail-nav {
        max-width: 100%;
        width: 100%;
        padding: 16px 40px;
        background-color: var(--bg-primary);
        position: sticky;
        top: 0; /* Sticky at very top of viewport since bottom-nav is hidden */
        z-index: 90;
        border-bottom: 1px solid var(--border-light);
    }

    .detail-body {
        max-width: 1280px;
        margin: 0 auto;
        display: grid;
        grid-template-columns: 1fr 1.2fr;
        gap: 48px;
        align-items: start;
        padding: 40px;
    }

    .detail-col-left, .detail-col-right {
        display: flex;
        flex-direction: column;
        gap: 24px;
    }

    .detail-banner {
        height: 340px;
        border-radius: 24px;
        overflow: hidden;
    }

    .detail-banner-overlay h1 {
        font-size: 2.5rem;
    }

    .intermediate-image-container {
        height: 260px;
        margin: 12px 0;
    }

    /* 9. Centered Lightbox style Upsell Modal */
    .modal-overlay {
        align-items: center; /* Center the card */
    }

    .modal-sheet {
        max-width: 500px;
        border-radius: 28px;
        padding: 36px 32px;
        transform: translateY(0);
        animation: scaleInModal 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
        margin: 0 auto;
    }

    @keyframes scaleInModal {
        from { transform: scale(0.9); opacity: 0; }
        to { transform: scale(1); opacity: 1; }
    }
}

@media (min-width: 1024px) {
    /* PC / Desktop grid override */
    .recipes-grid {
        grid-template-columns: repeat(4, 1fr); /* 4 columns on full PC screens */
        gap: 28px;
    }
}

/* ============================================================
   GUIDE DRAWER
============================================================ */
#guide-modal {
    position: fixed;
    z-index: 300;
}

.guide-sheet {
    width: 100%;
    height: 92vh;
    background: var(--bg-primary);
    border-radius: 24px 24px 0 0;
    display: flex;
    flex-direction: column;
    box-shadow: 0 -8px 32px rgba(0,0,0,.15);
    animation: slideUpSheet 0.35s cubic-bezier(0.25, 0.8, 0.25, 1);
    overflow: hidden;
}

.guide-handle {
    width: 40px;
    height: 4px;
    background: var(--border-light);
    border-radius: 2px;
    margin: 12px auto 0;
    flex-shrink: 0;
}

.guide-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px 14px;
    border-bottom: 1px solid var(--border-light);
    flex-shrink: 0;
}

.guide-header h2 {
    font-family: var(--font-serif);
    font-size: 1.15rem;
    color: var(--text-primary);
}

.guide-content {
    flex: 1;
    overflow-y: auto;
    padding: 18px 16px 40px;
    -webkit-overflow-scrolling: touch;
}

.guide-category {
    margin-bottom: 28px;
}

.guide-category-label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--accent-coral);
    margin-bottom: 12px;
    padding-left: 2px;
}

.guide-tip {
    background: var(--bg-card);
    border-radius: 14px;
    padding: 14px 16px;
    margin-bottom: 10px;
    border: 1px solid var(--border-light);
    display: flex;
    gap: 13px;
    align-items: flex-start;
}

.guide-tip-icon {
    font-size: 22px;
    flex-shrink: 0;
    line-height: 1.2;
}

.guide-tip-body h4 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
    line-height: 1.3;
}

.guide-tip-body p {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.55;
}

@media (min-width: 768px) {
    .guide-sheet {
        max-width: 500px;
        height: 85vh;
        border-radius: 24px;
        margin: auto;
    }
    #guide-modal.modal-overlay {
        align-items: center;
    }
}



