/* ==========================================================================
   CHEF'S COMPASS - APP LAYOUT & STYLES (PRESENTABLE TO CUSTOMERS & EMPLOYERS)
   ========================================================================== */

/* Header & Main Navigation */
#global-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: var(--bg-glass);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--bg-glass-border);
    padding: 0.85rem 1.8rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    box-shadow: var(--shadow-sm);
}

.brand-container {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    cursor: pointer;
    text-decoration: none;
}

.brand-logo-img {
    height: 42px;
    width: auto;
    object-fit: contain;
    transition: transform var(--transition-bounce);
}

.brand-container:hover .brand-logo-img {
    transform: scale(1.06) rotate(-3deg);
}

.brand-title {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.nav-pills {
    display: flex;
    align-items: center;
    background: var(--bg-surface-elevated);
    padding: 4px;
    border-radius: var(--radius-full);
    border: 1px solid var(--border-subtle);
    overflow-x: auto;
    max-width: 55vw;
}

.nav-pill-btn {
    padding: 0.5rem 1.1rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    border-radius: var(--radius-full);
    transition: all var(--transition-fast);
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.nav-pill-btn:hover {
    color: var(--text-primary);
    background: rgba(0, 0, 0, 0.03);
}

.nav-pill-btn.active {
    background: var(--bg-surface);
    color: var(--brand-primary);
    font-weight: 600;
    box-shadow: var(--shadow-sm);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.view-mode-toggle {
    display: flex;
    align-items: center;
    background: var(--brand-primary-light);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-full);
    padding: 3px;
}

.mode-btn {
    padding: 0.4rem 0.85rem;
    font-size: 0.8rem;
    font-weight: 600;
    border-radius: var(--radius-full);
    color: var(--text-secondary);
    transition: all var(--transition-fast);
}

.mode-btn.active {
    background: var(--brand-primary);
    color: var(--text-inverse);
    box-shadow: var(--shadow-sm);
}

/* Main Container */
#main-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 1350px;
    margin: 0 auto;
    padding: 1.8rem;
}

.view-section {
    display: none;
    animation: fadeIn 0.3s ease-in-out forwards;
}

.view-section.active {
    display: block;
}

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

/* Hero Section */
.hero-banner {
    position: relative;
    background: linear-gradient(135deg, rgba(42, 75, 52, 0.9), rgba(105, 150, 114, 0.85)),
                url('https://images.unsplash.com/photo-1556910103-1c02745aae4d?auto=format&fit=crop&w=1600&q=80') center/cover;
    border-radius: var(--radius-lg);
    padding: 5.5rem 3rem;
    color: white;
    text-align: center;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    margin-bottom: 2.5rem;
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
    margin: 0 auto;
}

.hero-logo-img {
    height: 75px;
    width: auto;
    filter: drop-shadow(0 4px 12px rgba(0,0,0,0.3));
    margin-bottom: 1rem;
}

.hero-badge {
    display: inline-block;
    background: rgba(255, 255, 255, 0.22);
    backdrop-filter: blur(8px);
    padding: 0.35rem 1.1rem;
    border-radius: var(--radius-full);
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    margin-bottom: 1.2rem;
    border: 1px solid rgba(255, 255, 255, 0.35);
}

.hero-title {
    font-family: var(--font-heading);
    font-size: 3.5rem;
    line-height: 1.15;
    margin-bottom: 1.2rem;
    font-weight: 700;
    color: white;
}

.hero-subtitle {
    font-size: 1.2rem;
    opacity: 0.95;
    margin-bottom: 2.2rem;
    font-weight: 300;
}

.hero-stats-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2.5rem;
    margin-top: 2.5rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.hero-stat-item {
    text-align: center;
}

.hero-stat-number {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    font-weight: 700;
}

.hero-stat-label {
    font-size: 0.82rem;
    opacity: 0.85;
    text-transform: uppercase;
}

/* Features & Testimonials Grid */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.feature-card {
    background: var(--bg-surface);
    padding: 1.8rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle);
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

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

.feature-icon {
    width: 50px;
    height: 50px;
    background: var(--brand-primary-light);
    color: var(--brand-primary);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 1.2rem;
}

.testimonial-card {
    background: var(--bg-surface-elevated);
    padding: 1.5rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle);
    font-style: italic;
}

.testimonial-author {
    font-style: normal;
    font-weight: 700;
    font-size: 0.9rem;
    margin-top: 0.8rem;
    color: var(--brand-primary);
}

/* Recipe Grid & Cards */
.search-hero {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-sm);
}

.search-bar-wrap {
    position: relative;
    max-width: 650px;
    margin: 0 auto 1.5rem auto;
}

.search-input {
    width: 100%;
    padding: 1rem 1.2rem 1rem 3.2rem;
    border-radius: var(--radius-full);
    border: 2px solid var(--border-subtle);
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 1rem;
    transition: all var(--transition-fast);
}

.search-input:focus {
    outline: none;
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 4px rgba(74, 122, 86, 0.15);
    background: var(--bg-surface);
}

.search-icon-svg {
    position: absolute;
    left: 1.1rem;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    color: var(--text-muted);
}

.category-filter-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.cat-chip {
    padding: 0.6rem 1.2rem;
    border-radius: var(--radius-full);
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.9rem;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.cat-chip:hover {
    border-color: var(--brand-sage);
    color: var(--brand-primary);
}

.cat-chip.active {
    background: var(--brand-primary);
    color: white;
    border-color: var(--brand-primary);
    box-shadow: var(--shadow-sm);
}

.recipe-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
    gap: 1.5rem;
}

.recipe-card {
    background: var(--bg-surface);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
    display: flex;
    flex-direction: column;
    position: relative;
    cursor: pointer;
}

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

.recipe-cover-wrap {
    position: relative;
    width: 100%;
    height: 195px;
    overflow: hidden;
    background: var(--border-subtle);
}

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

.recipe-card:hover .recipe-cover-img {
    transform: scale(1.06);
}

.recipe-tag {
    position: absolute;
    top: 12px;
    left: 12px;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(8px);
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--brand-primary);
    box-shadow: var(--shadow-sm);
    text-transform: uppercase;
}

.recipe-mini-badge {
    display: inline-block;
    background: var(--brand-sage-light);
    color: var(--brand-primary);
    font-size: 0.72rem;
    font-weight: 600;
    padding: 0.15rem 0.5rem;
    border-radius: var(--radius-sm);
}

.fav-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-fast);
}

.fav-btn:hover, .fav-btn.active {
    color: #E53935;
    background: white;
    transform: scale(1.1);
}

.recipe-body {
    padding: 1.2rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.recipe-name {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    line-height: 1.3;
}

.recipe-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: auto;
    padding-top: 0.8rem;
    border-top: 1px dashed var(--border-subtle);
}

/* Detail View Layout & Components */
.recipe-detail-header {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 2.5rem;
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-subtle);
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-sm);
}

@media (max-width: 850px) {
    .recipe-detail-header {
        grid-template-columns: 1fr;
    }
}

.detail-cover {
    width: 100%;
    height: 360px;
    border-radius: var(--radius-md);
    object-fit: cover;
    box-shadow: var(--shadow-md);
}

.detail-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.detail-title {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
    line-height: 1.2;
}

.detail-stats {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.stat-badge {
    background: var(--brand-primary-light);
    border: 1px solid var(--border-medium);
    padding: 0.75rem 1.2rem;
    border-radius: var(--radius-md);
    text-align: center;
}

.stat-val {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--brand-primary);
}

.stat-lbl {
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-transform: uppercase;
}

/* Nutrition Bar Card */
.nutrition-grid-card {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.8rem;
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-subtle);
    padding: 1rem;
    border-radius: var(--radius-md);
    margin-bottom: 1.5rem;
    text-align: center;
}

.nut-item strong {
    display: block;
    font-size: 1.1rem;
    color: var(--brand-primary);
}

.nut-item span {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
}

/* Cooking Timer Widget */
.cooking-timer-widget {
    background: var(--brand-primary-light);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-md);
    padding: 1.2rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.timer-display {
    font-family: var(--font-code);
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--brand-primary);
}

.detail-content-grid {
    display: grid;
    grid-template-columns: 1fr 1.6fr;
    gap: 2rem;
}

@media (max-width: 900px) {
    .detail-content-grid {
        grid-template-columns: 1fr;
    }
}

.detail-box {
    background: var(--bg-surface);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle);
    padding: 1.8rem;
    box-shadow: var(--shadow-sm);
}

.detail-box-title {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    margin-bottom: 1.2rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    color: var(--brand-primary);
    border-bottom: 2px solid var(--brand-primary-light);
    padding-bottom: 0.5rem;
}

.checklist-ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.checklist-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0.8rem;
    border-radius: var(--radius-sm);
    background: var(--bg-primary);
    border: 1px solid var(--border-subtle);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.checklist-item:hover {
    border-color: var(--brand-sage);
}

.checklist-item.done {
    text-decoration: line-through;
    opacity: 0.6;
    background: var(--bg-surface-elevated);
}

.custom-checkbox {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    border: 2px solid var(--brand-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.checklist-item.done .custom-checkbox {
    background: var(--brand-primary);
    color: white;
}

.procedure-steps {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.step-card {
    display: flex;
    gap: 1.2rem;
    background: var(--bg-primary);
    padding: 1.2rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle);
}

.step-num {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--brand-primary);
    color: white;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* Account Management */
.account-hero {
    background: linear-gradient(135deg, var(--bg-surface), var(--brand-primary-light));
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-subtle);
    padding: 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    margin-bottom: 2rem;
}

.user-profile-info {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.avatar-circle {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: var(--brand-primary);
    color: white;
    font-size: 2rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-md);
}

.account-layout {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 2rem;
}

@media (max-width: 900px) {
    .account-layout {
        grid-template-columns: 1fr;
    }
}

.category-mgr-box {
    background: var(--bg-surface);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
}

.category-item-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background: var(--bg-primary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    margin-bottom: 0.6rem;
}

.kebab-container {
    position: relative;
}

.kebab-menu {
    position: absolute;
    right: 0;
    top: 100%;
    background: var(--bg-surface);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-md);
    z-index: 100;
    display: none;
    flex-direction: column;
    min-width: 130px;
    overflow: hidden;
}

.kebab-menu.active {
    display: flex;
}

.kebab-item {
    padding: 0.6rem 1rem;
    font-size: 0.85rem;
    text-align: left;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: background var(--transition-fast);
}

.kebab-item:hover {
    background: var(--bg-surface-elevated);
}

.kebab-item.delete {
    color: var(--state-danger);
}

/* Forms */
.form-card {
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-subtle);
    padding: 2.5rem;
    max-width: 850px;
    margin: 0 auto;
    box-shadow: var(--shadow-md);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 0.4rem;
    color: var(--text-primary);
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-medium);
    background: var(--bg-primary);
    color: var(--text-primary);
    transition: all var(--transition-fast);
}

.form-control:focus {
    outline: none;
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 3px rgba(74, 122, 86, 0.15);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.dynamic-input-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.6rem;
}

.btn-add-row {
    background: var(--brand-primary-light);
    color: var(--brand-primary);
    font-weight: 600;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    border: 1px dashed var(--brand-primary);
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

/* Auth Modal */
.auth-card {
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-subtle);
    padding: 2.5rem;
    max-width: 440px;
    margin: 3rem auto;
    box-shadow: var(--shadow-lg);
    text-align: center;
}

.auth-tabs {
    display: flex;
    background: var(--bg-surface-elevated);
    padding: 4px;
    border-radius: var(--radius-md);
    margin-bottom: 1.8rem;
}

.auth-tab-btn {
    flex: 1;
    padding: 0.6rem;
    font-weight: 600;
    font-size: 0.9rem;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    transition: all var(--transition-fast);
}

.auth-tab-btn.active {
    background: var(--bg-surface);
    color: var(--brand-primary);
    box-shadow: var(--shadow-sm);
}

/* Design System Docs Viewport */
#docs-viewport {
    display: none;
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-subtle);
    padding: 2.5rem;
    box-shadow: var(--shadow-md);
}

#docs-viewport.active {
    display: block;
}

.docs-header {
    margin-bottom: 2.5rem;
    border-bottom: 2px solid var(--border-subtle);
    padding-bottom: 1.5rem;
}

.color-swatch-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.2rem;
    margin-bottom: 2.5rem;
}

.swatch-card {
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--border-subtle);
    box-shadow: var(--shadow-sm);
}

.swatch-color {
    height: 90px;
    width: 100%;
}

.swatch-info {
    padding: 0.8rem;
    background: var(--bg-surface);
}

.code-block {
    background: #181E19;
    color: #E2EADF;
    font-family: var(--font-code);
    padding: 1.2rem;
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    line-height: 1.5;
    overflow-x: auto;
    margin: 1rem 0;
}

.guideline-box {
    background: var(--brand-primary-light);
    border-left: 4px solid var(--brand-primary);
    padding: 1.2rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1.5rem;
}

/* Print Styles */
@media print {
    #global-header, #employer-demo-banner, .header-actions, .cta-group, footer, #toast-container {
        display: none !important;
    }
    body {
        background: white;
        color: black;
    }
    .detail-box, .recipe-detail-header {
        border: none;
        box-shadow: none;
    }
}

footer {
    border-top: 1px solid var(--border-subtle);
    background: var(--bg-surface);
    padding: 1.8rem;
    text-align: center;
    font-size: 0.88rem;
    color: var(--text-secondary);
    margin-top: auto;
}
