/* urCooked custom styles */

:root {
    /* Primary actions */
    --pico-primary: #3d3d3d;
    --pico-primary-hover: #2a2a2a;

    /* urCooked palette */
    --uc-primary: #3d3d3d;
    --uc-primary-hover: #2a2a2a;
    --uc-bg: #F4CFC7;              /* Pale Dogwood */
    --uc-accent-coral: #E79796;    /* Light Coral */
    --uc-accent-sunset: #FFC98B;   /* Sunset */
    --uc-surface: #ffffff;
    --uc-text: #1a1a1a;
    --uc-text-muted: #6b6b6b;
    --uc-success: #22c55e;
    --uc-error: #ef4444;
}

/* Apply warm background to body */
body {
    background-color: var(--uc-bg);
}

/* Brand in navbar */
nav .brand {
    font-weight: bold;
    font-size: 1.3rem;
    color: var(--uc-text);
}

/* Nav active state helper — add via JS or template */
nav a[aria-current="page"] {
    font-weight: 600;
    border-bottom: 2px solid var(--uc-accent-coral);
}

/* Page headings */
main > h2:first-child {
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--uc-accent-coral);
}

/* Cards / articles */
article {
    border-radius: 8px;
    background-color: var(--uc-surface);
}

/* Ensure main content area has white background for readability */
main.container {
    background-color: var(--uc-surface);
    border-radius: 12px;
    padding: 1.5rem;
    margin-top: 1rem;
    margin-bottom: 1rem;
}

/* Nav bar styling */
nav.container-fluid {
    background-color: var(--uc-surface);
}

/* Brand logo in navbar */
.brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
}

.brand-logo {
    width: 36px;
    height: 36px;
    border-radius: 8px;
}

/* Bottom tab bar */
.bottom-tabs {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: var(--uc-surface);
    border-top: 1px solid var(--uc-accent-coral);
    padding: 0.5rem 0;
    padding-bottom: calc(0.5rem + env(safe-area-inset-bottom));
    z-index: 1000;
    justify-content: space-around;
}

.tab-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: var(--uc-text-muted);
    padding: 0.5rem;
    min-width: 64px;
    min-height: 48px;
    border-radius: 8px;
    transition: color 0.2s, background-color 0.2s;
}

.tab-item i {
    width: 24px;
    height: 24px;
    margin-bottom: 0.25rem;
}

.tab-item span {
    font-size: 0.7rem;
    font-weight: 500;
}

.tab-item.active,
.tab-item:hover {
    color: var(--uc-primary);
    background-color: var(--uc-bg);
}

.tab-item.active {
    color: var(--uc-accent-coral);
}

/* Mobile/tablet: show bottom tabs, hide top nav links */
@media (max-width: 1024px) {
    .bottom-tabs {
        display: flex;
    }

    .top-nav ul:last-child {
        display: none;
    }

    main.container {
        margin-bottom: calc(80px + env(safe-area-inset-bottom));
    }

    .grid {
        grid-template-columns: 1fr !important;
    }
}

/* Desktop: hide bottom tabs */
@media (min-width: 1025px) {
    .bottom-tabs {
        display: none;
    }
}

/* Better details/summary for forms */
details > summary {
    margin-bottom: 1rem;
}

details[open] > summary {
    margin-bottom: 0.5rem;
}

/* Shopping item checkboxes */
#shopping-items > div {
    border-bottom: 1px solid var(--pico-muted-border-color);
}

#shopping-items > div:last-child {
    border-bottom: none;
}

/* =================================
   Mobile-First Improvements
   ================================= */

/* Prevent double-tap zoom on interactive elements */
button, a, input, select, textarea {
    touch-action: manipulation;
}

/* Ensure minimum touch target size (48px) */
button,
[role="button"],
input[type="checkbox"],
input[type="radio"] {
    min-height: 48px;
    min-width: 48px;
}

/* Ensure inputs don't zoom on iOS (requires 16px minimum) */
input, select, textarea {
    font-size: 16px;
}

/* Button active state feedback */
button:active,
[role="button"]:active,
.tab-item:active {
    transform: scale(0.97);
    opacity: 0.9;
}

/* Success and error color utilities */
.text-success {
    color: var(--uc-success);
}

.text-error {
    color: var(--uc-error);
}

.bg-success {
    background-color: var(--uc-success);
    color: white;
}

.bg-error {
    background-color: var(--uc-error);
    color: white;
}

/* Accent backgrounds */
.bg-coral {
    background-color: var(--uc-accent-coral);
}

.bg-sunset {
    background-color: var(--uc-accent-sunset);
}

/* =================================
   PWA Install Banner
   ================================= */

.install-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.75rem 1rem;
    background-color: var(--uc-accent-sunset);
    border-bottom: 1px solid var(--uc-accent-coral);
}

.install-banner-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.install-banner-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
}

.install-banner-text {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.install-banner-text strong {
    font-size: 0.9rem;
    color: var(--uc-text);
}

.install-banner-text span {
    font-size: 0.75rem;
    color: var(--uc-text-muted);
}

.install-banner-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.install-btn {
    padding: 0.5rem 1rem;
    background-color: var(--uc-primary);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    min-height: 36px;
    min-width: auto;
}

.install-btn:hover {
    background-color: var(--uc-primary-hover);
}

.install-dismiss {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    min-width: 32px;
    min-height: 32px;
    padding: 0;
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--uc-text-muted);
    border-radius: 4px;
}

.install-dismiss:hover {
    background-color: rgba(0, 0, 0, 0.1);
}

.install-dismiss i {
    width: 20px;
    height: 20px;
}

/* =================================
   Netflix-Style Chef Picker
   ================================= */

.chef-picker {
    margin: -1.5rem;
    min-height: calc(100vh - 100px);
    display: flex;
    flex-direction: column;
    background-color: #141414;
}

/* Hero section with food background */
.chef-picker-hero {
    position: relative;
    height: 45vh;
    min-height: 280px;
    max-height: 400px;
    background-image: url('https://images.unsplash.com/photo-1504674900247-0877df9cc836?w=1200&q=80');
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.chef-picker-hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom,
        rgba(20, 20, 20, 0.3) 0%,
        rgba(20, 20, 20, 0.5) 50%,
        rgba(20, 20, 20, 1) 100%
    );
}

.chef-picker-hero-content {
    position: relative;
    z-index: 1;
    text-align: center;
    padding: 2rem;
    padding-bottom: 1rem;
}

.chef-picker-hero-content h1 {
    color: #ffffff;
    font-size: 2.5rem;
    font-weight: 700;
    margin: 0;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.chef-picker-hero-content .kitchen-name {
    color: var(--uc-accent-coral);
    font-size: 1.2rem;
    font-weight: 500;
    margin: 0.5rem 0 0;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}

/* Chef profiles grid */
.chef-picker-profiles {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.5rem;
    padding: 2rem;
    background-color: #141414;
}

.chef-profile {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    padding: 1rem;
    border-radius: 8px;
    transition: transform 0.2s ease, background-color 0.2s ease;
    min-width: 100px;
}

.chef-profile:hover,
.chef-profile:focus {
    transform: scale(1.05);
    background-color: rgba(255, 255, 255, 0.1);
    outline: none;
}

.chef-profile:active {
    transform: scale(0.98);
}

.chef-avatar {
    width: 100px;
    height: 100px;
    border-radius: 12px;
    object-fit: cover;
    border: 3px solid transparent;
    transition: border-color 0.2s ease;
}

.chef-profile:hover .chef-avatar,
.chef-profile:focus .chef-avatar {
    border-color: var(--uc-accent-coral);
}

.chef-avatar-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--uc-accent-coral), var(--uc-accent-sunset));
    font-size: 2.5rem;
    font-weight: 700;
    color: #fff;
}

.chef-avatar-add {
    background: rgba(255, 255, 255, 0.1);
    border: 2px dashed rgba(255, 255, 255, 0.3);
    font-size: 2.5rem;
    font-weight: 300;
    color: rgba(255, 255, 255, 0.5);
}

.chef-profile-add:hover .chef-avatar-add {
    border-color: var(--uc-accent-coral);
    color: var(--uc-accent-coral);
}

.chef-name {
    margin-top: 0.75rem;
    font-size: 1rem;
    font-weight: 600;
    color: #ffffff;
    text-align: center;
}

.chef-badge {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.75rem;
}

.chef-points {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.8rem;
    margin-top: 0.25rem;
}

/* Footer actions */
.chef-picker-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    margin-top: auto;
    background-color: #141414;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.chef-picker-link {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s ease;
}

.chef-picker-link:hover {
    color: var(--uc-accent-coral);
}

.chef-picker-logout {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: rgba(255, 255, 255, 0.7);
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    min-height: 40px;
    min-width: auto;
    transition: all 0.2s ease;
}

.chef-picker-logout:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.5);
    color: #ffffff;
}

/* =================================
   Compact Calendar Navigation
   ================================= */

.cal-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.nav-compact {
    min-height: 36px !important;
    min-width: 36px !important;
    padding: 0.25rem 0.5rem !important;
    font-size: 1rem;
}

/* Responsive adjustments */
@media (max-width: 600px) {
    .chef-picker-hero {
        height: 35vh;
        min-height: 220px;
    }

    .chef-picker-hero-content h1 {
        font-size: 1.8rem;
    }

    .chef-picker-profiles {
        padding: 1.5rem 1rem;
        gap: 1rem;
    }

    .chef-avatar {
        width: 80px;
        height: 80px;
    }

    .chef-avatar-placeholder,
    .chef-avatar-add {
        font-size: 2rem;
    }

    .chef-name {
        font-size: 0.9rem;
    }
}
