* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Professional Color System */
    --primary-color: #3B82F6;
    --primary-hover: #2563EB;
    --secondary-color: #8B5CF6;
    --accent-color: #10B981;
    --error-color: #EF4444;

    /* Neutral Scale */
    --text-dark: #0F172A;
    --text-medium: #475569;
    --text-light: #64748B;
    --border-color: #E2E8F0;
    --bg-light: #F8FAFC;
    --bg-white: #FFFFFF;

    /* Shadows - Subtle Elevation */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);

    /* Spacing & Sizing */
    --border-radius: 12px;
    --border-radius-lg: 16px;
    --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Dark Mode Support */
[data-theme="dark"] {
    --primary-color: #60A5FA;
    --primary-hover: #3B82F6;
    --secondary-color: #A78BFA;
    --accent-color: #34D399;
    --error-color: #F87171;

    --text-dark: #F1F5F9;
    --text-medium: #CBD5E1;
    --text-light: #94A3B8;
    --border-color: #334155;
    --bg-light: #0F172A;
    --bg-white: #1E293B;

    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.4), 0 1px 2px -1px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -2px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -4px rgba(0, 0, 0, 0.4);
    --shadow-hover: 0 20px 25px -5px rgba(0, 0, 0, 0.4), 0 8px 10px -6px rgba(0, 0, 0, 0.4);
}

/* Dark mode specific overrides */
[data-theme="dark"] .detail-notes {
    background: #422006;
    border-left-color: #f59e0b;
    color: #fcd34d;
}

[data-theme="dark"] .step-content.completed .step-text {
    background: #064e3b;
}

/* ==================== FEED DESIGN SYSTEM ==================== */

/* Feed-specific color variables */
:root {
    --feed-primary: #FF6B6B;
    --feed-secondary: #4ECDC4;
    --feed-accent: #FFE66D;
    --feed-border: #E8E8E8;
}

[data-theme="dark"] {
    --feed-border: #334155;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg-light);
    min-height: 100vh;
    color: var(--text-dark);
    margin: 0;
    padding: 0;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

/* Feed Layout Specific Styles */
body.feed-layout {
    padding-bottom: 70px;
}

/* Top Bar */
.feed-top-bar {
    position: sticky;
    top: 0;
    background: var(--bg-white);
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--feed-border);
    z-index: 100;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.feed-logo {
    font-size: 20px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--feed-primary), var(--feed-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.feed-top-actions {
    display: flex;
    gap: 8px;
}

.feed-icon-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: var(--bg-light);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    transition: transform 150ms, background 150ms;
}

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

.feed-icon-btn:hover {
    background: var(--border-color);
}

/* SVG Icons */
.icon-svg {
    width: 20px;
    height: 20px;
    stroke: var(--text-dark);
    transition: stroke 150ms, transform 150ms;
}

.feed-icon-btn:hover .icon-svg {
    stroke: var(--primary-color);
    transform: scale(1.1);
}

[data-theme="dark"] .icon-svg {
    stroke: var(--text-light);
}

[data-theme="dark"] .feed-icon-btn:hover .icon-svg {
    stroke: var(--primary-color);
}

/* Dark mode icon animation */
#darkModeIcon {
    display: flex;
    align-items: center;
    justify-content: center;
}

.moon-icon,
.sun-icon {
    transition: opacity 200ms, transform 200ms;
}

/* Search Bar */
.feed-search-bar {
    background: var(--bg-white);
    border-bottom: 1px solid var(--feed-border);
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 99;
}

.feed-search-bar input {
    flex: 1;
    border: none;
    background: var(--bg-light);
    padding: 10px 16px;
    border-radius: 20px;
    font-size: 15px;
    color: var(--text-dark);
    outline: none;
}

.feed-search-bar input::placeholder {
    color: var(--text-light);
}

.feed-search-close {
    background: none;
    border: none;
    font-size: 18px;
    color: var(--text-light);
    cursor: pointer;
    padding: 4px 8px;
}

/* Main Content Area */
.feed-content-area {
    min-height: calc(100vh - 130px);
    padding-bottom: 20px;
}

/* Tab Content */
.feed-tab-content {
    display: none;
}

.feed-tab-content.active {
    display: block;
}

/* View Header */
.feed-view-header {
    padding: 20px 16px 16px;
    background: var(--bg-white);
    border-bottom: 1px solid var(--feed-border);
}

.feed-view-header h1 {
    font-size: 28px;
    font-weight: 700;
    margin: 0 0 4px;
    color: var(--text-dark);
}

.feed-view-header p {
    font-size: 14px;
    color: var(--text-light);
    margin: 0;
}

/* Filter Bar */
.feed-filter-bar {
    background: var(--bg-white);
    border-bottom: 1px solid var(--feed-border);
    padding: 12px 0;
    overflow: hidden;
}

.feed-filter-scroll {
    display: flex;
    gap: 8px;
    padding: 0 16px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.feed-filter-scroll::-webkit-scrollbar {
    display: none;
}

.feed-filter-chip {
    flex-shrink: 0;
    padding: 8px 16px;
    border-radius: 20px;
    border: 1px solid var(--feed-border);
    background: var(--bg-white);
    color: var(--text-medium);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 150ms;
    white-space: nowrap;
}

.feed-filter-chip:hover {
    border-color: var(--feed-primary);
    color: var(--feed-primary);
}

.feed-filter-chip.active {
    background: linear-gradient(135deg, var(--feed-primary), var(--feed-secondary));
    color: white;
    border-color: transparent;
}

.feed-filter-country {
    padding: 8px 16px 0;
}

.feed-select {
    width: 100%;
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid var(--feed-border);
    background: var(--bg-white);
    color: var(--text-dark);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: border-color 150ms;
}

.feed-select:hover {
    border-color: var(--feed-primary);
}

.feed-select:focus {
    outline: none;
    border-color: var(--feed-primary);
}

.feed-select-inline {
    flex-shrink: 0;
    padding: 8px 16px;
    border-radius: 20px;
    border: 1px solid var(--feed-border);
    background: var(--bg-white);
    color: var(--text-medium);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 150ms;
    white-space: nowrap;
    max-width: 180px;
}

.feed-select-inline:hover {
    border-color: var(--feed-primary);
    color: var(--feed-primary);
}

.feed-select-inline:focus {
    outline: none;
    border-color: var(--feed-primary);
    color: var(--feed-primary);
}

/* Recipes Container */
.feed-recipes-container {
    padding: 16px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

/* Feed Recipe Card */
.feed-recipe-card {
    background: var(--bg-white);
    cursor: pointer;
    transition: transform 150ms, box-shadow 150ms;
    border: 1px solid var(--feed-border);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.feed-recipe-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

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

.feed-card-header {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    gap: 12px;
}

.feed-card-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea, #764ba2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

.feed-card-user-info {
    flex: 1;
}

.feed-card-username {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-dark);
}

.feed-card-time {
    font-size: 12px;
    color: var(--text-light);
}

.feed-card-image-container {
    position: relative;
    width: 100%;
    height: 350px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.feed-card-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.feed-card-emoji {
    font-size: 100px;
}

/* Recipe Heart/Favorite Button */
.recipe-heart-btn {
    position: absolute;
    top: 16px;
    right: 16px;
    background: rgba(255, 255, 255, 0.95);
    border: none;
    border-radius: 50%;
    width: 48px;
    height: 48px;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    transition: all 200ms ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    z-index: 10;
}

.recipe-heart-btn:hover {
    transform: scale(1.1);
    background: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.recipe-heart-btn.favorited {
    color: #ff6b6b;
    background: white;
}

.recipe-heart-btn.favorited:hover {
    transform: scale(1.15);
    color: #ff5252;
}

.feed-card-actions {
    display: flex;
    align-items: center;
    padding: 12px 16px 8px;
    gap: 8px;
}

.feed-action-btn {
    flex: 1;
    background: var(--bg-light);
    border: 1px solid var(--feed-border);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 150ms;
    padding: 8px 12px;
    border-radius: 8px;
    color: var(--text-dark);
}

.feed-action-btn:hover {
    background: var(--bg-white);
    border-color: var(--feed-primary);
    color: var(--feed-primary);
}

.feed-action-btn:active {
    transform: scale(0.95);
}

.feed-action-btn.edit-btn:hover {
    border-color: #4ECDC4;
    color: #4ECDC4;
}

.feed-action-btn.delete-btn:hover {
    border-color: #FF6B6B;
    color: #FF6B6B;
}

.feed-card-content {
    padding: 0 16px 16px;
}

.feed-card-title {
    font-weight: 600;
    font-size: 16px;
    margin-bottom: 6px;
    color: var(--text-dark);
}

.feed-card-description {
    font-size: 14px;
    color: var(--text-medium);
    line-height: 1.5;
    margin-bottom: 12px;
}

.feed-card-tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.feed-tag {
    background: linear-gradient(135deg, rgba(255, 107, 107, 0.1), rgba(78, 205, 196, 0.1));
    color: var(--feed-primary);
    font-size: 12px;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 20px;
    border: 1px solid rgba(255, 107, 107, 0.2);
}

.feed-tag.public-badge,
.quick-meal-badge.public-badge {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border: 1px solid #059669;
    font-weight: 700;
    /* Position on left side, not right */
    right: auto;
    left: 12px;
}

.feed-card-stats {
    display: flex;
    gap: 16px;
    padding-top: 12px;
    border-top: 1px solid var(--feed-border);
    font-size: 13px;
    color: var(--text-light);
}

.feed-stat {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Stories Row */
.feed-stories-row {
    display: flex;
    gap: 16px;
    padding: 16px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    background: var(--bg-white);
    border-bottom: 1px solid var(--feed-border);
}

.feed-stories-row::-webkit-scrollbar {
    display: none;
}

.feed-story-item {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    scroll-snap-align: start;
    cursor: pointer;
}

.feed-story-avatar {
    width: 68px;
    height: 68px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--feed-primary), var(--feed-secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    border: 3px solid var(--bg-white);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.feed-story-label {
    font-size: 12px;
    color: var(--text-light);
    max-width: 68px;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Discover Container */
.feed-discover-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 25px;
    padding: 0 20px 30px;
}

/* Discover Toggle Buttons */
.discover-toggle-container {
    display: flex;
    gap: 12px;
    padding: 0 20px 20px;
}

.discover-toggle-btn {
    flex: 1;
    padding: 12px 20px;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    background: var(--bg-white);
    color: var(--text-dark);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 200ms ease;
}

.discover-toggle-btn:hover {
    border-color: var(--feed-primary);
    background: rgba(255, 107, 107, 0.05);
}

.discover-toggle-btn.active {
    background: linear-gradient(135deg, var(--feed-primary), var(--feed-secondary));
    color: white;
    border-color: var(--feed-primary);
}

/* Profile Container */
.profile-container {
    padding: 0 0 20px;
}

.profile-header {
    background: linear-gradient(135deg, var(--feed-primary), var(--feed-secondary));
    padding: 40px 20px 30px;
    text-align: center;
    color: white;
}

.profile-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: white;
    color: var(--feed-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    font-weight: 700;
    margin: 0 auto 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.profile-header h2 {
    font-size: 24px;
    margin: 0 0 20px;
    font-weight: 600;
}

.profile-stats-row {
    display: flex;
    justify-content: center;
    gap: 32px;
}

.profile-stat {
    text-align: center;
}

.profile-stat-value {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 4px;
}

.profile-stat-label {
    font-size: 12px;
    opacity: 0.9;
}

.profile-section {
    background: var(--bg-white);
    padding: 20px 16px;
    margin-top: 12px;
    border-top: 1px solid var(--feed-border);
    border-bottom: 1px solid var(--feed-border);
}

.profile-section h3 {
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 16px;
    color: var(--text-dark);
}

.streak-info {
    display: flex;
    justify-content: space-around;
    gap: 0;
    padding: 0;
    background: var(--bg-white);
    border-radius: 12px;
    border: 2px solid var(--border-color);
    overflow: hidden;
}

.streak-stat {
    text-align: center;
    flex: 1;
    padding: 20px 16px;
    position: relative;
}

.streak-stat:not(:last-child)::after {
    content: '';
    position: absolute;
    right: 0;
    top: 20%;
    height: 60%;
    width: 1px;
    background: var(--border-color);
}

.streak-label {
    font-size: 13px;
    color: var(--text-dark);
    margin-bottom: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    display: block;
    opacity: 0.7;
}

.streak-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-dark);
    line-height: 1.2;
}

.profile-badges-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 16px;
}

/* Badge Styling */
.profile-badge {
    position: relative;
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
    padding: 12px;
    transition: all 300ms cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}

.profile-badge:hover {
    transform: translateY(-4px);
}

.badge-icon-container {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.badge-icon-container svg {
    width: 40px;
    height: 40px;
    stroke-width: 2;
    transition: all 300ms;
}

.badge-rarity-indicator {
    position: absolute;
    bottom: 4px;
    right: 4px;
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 2px 6px;
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(4px);
    color: white;
}

/* Badge Rarity Levels */
.badge-locked {
    background: var(--bg-light);
    border: 2px solid var(--border-color);
}

.badge-locked svg {
    stroke: var(--text-light);
}

.badge-common {
    background: linear-gradient(135deg, #64748B 0%, #94A3B8 100%);
    border: 2px solid #CBD5E1;
    box-shadow: 0 4px 12px rgba(100, 116, 139, 0.3);
}

.badge-common svg {
    stroke: white;
}

.badge-common:hover {
    box-shadow: 0 8px 24px rgba(100, 116, 139, 0.4);
}

.badge-rare {
    background: linear-gradient(135deg, #3B82F6 0%, #60A5FA 100%);
    border: 2px solid #93C5FD;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4), 0 0 20px rgba(59, 130, 246, 0.2);
}

.badge-rare svg {
    stroke: white;
}

.badge-rare:hover {
    box-shadow: 0 8px 24px rgba(59, 130, 246, 0.5), 0 0 30px rgba(59, 130, 246, 0.3);
}

.badge-epic {
    background: linear-gradient(135deg, #A855F7 0%, #C084FC 100%);
    border: 2px solid #E9D5FF;
    box-shadow: 0 4px 12px rgba(168, 85, 247, 0.4), 0 0 20px rgba(168, 85, 247, 0.2);
    animation: epicGlow 2s ease-in-out infinite;
}

.badge-epic svg {
    stroke: white;
    filter: drop-shadow(0 0 4px rgba(255, 255, 255, 0.5));
}

.badge-epic:hover {
    box-shadow: 0 8px 24px rgba(168, 85, 247, 0.6), 0 0 40px rgba(168, 85, 247, 0.4);
}

.badge-legendary {
    background: linear-gradient(135deg, #F59E0B 0%, #FBBF24 100%);
    border: 2px solid #FDE047;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.5), 0 0 20px rgba(245, 158, 11, 0.3);
    animation: legendaryGlow 2s ease-in-out infinite;
}

.badge-legendary svg {
    stroke: white;
    filter: drop-shadow(0 0 6px rgba(255, 255, 255, 0.8));
}

.badge-legendary:hover {
    box-shadow: 0 8px 24px rgba(245, 158, 11, 0.7), 0 0 50px rgba(245, 158, 11, 0.5);
}

/* Badge Animations */
@keyframes epicGlow {
    0%, 100% {
        box-shadow: 0 4px 12px rgba(168, 85, 247, 0.4), 0 0 20px rgba(168, 85, 247, 0.2);
    }
    50% {
        box-shadow: 0 4px 16px rgba(168, 85, 247, 0.6), 0 0 30px rgba(168, 85, 247, 0.4);
    }
}

@keyframes legendaryGlow {
    0%, 100% {
        box-shadow: 0 4px 12px rgba(245, 158, 11, 0.5), 0 0 20px rgba(245, 158, 11, 0.3);
    }
    50% {
        box-shadow: 0 4px 16px rgba(245, 158, 11, 0.7), 0 0 40px rgba(245, 158, 11, 0.5);
    }
}

.profile-actions {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.profile-action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 20px;
    background: var(--bg-light);
    border: 1px solid var(--feed-border);
    border-radius: 12px;
    cursor: pointer;
    transition: all 150ms;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-dark);
}

.profile-action-btn:active {
    transform: scale(0.95);
}

.profile-action-btn span:first-child {
    font-size: 32px;
}

/* Embedded iframes */
.feed-iframe {
    width: 100%;
    height: calc(100vh - 130px);
    border: none;
}

/* Back Header */
.feed-back-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: var(--bg-white);
    border-bottom: 1px solid var(--feed-border);
    position: sticky;
    top: 0;
    z-index: 10;
}

.feed-back-btn {
    background: none;
    border: none;
    font-size: 16px;
    color: var(--feed-primary);
    cursor: pointer;
    padding: 8px;
    font-weight: 500;
}

.feed-back-header h2 {
    font-size: 20px;
    margin: 0;
    color: var(--text-dark);
}

/* Floating Action Button */
.feed-fab {
    position: fixed;
    bottom: 80px;
    right: 20px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--feed-primary), var(--feed-secondary));
    color: white;
    border: none;
    font-size: 28px;
    box-shadow: 0 4px 16px rgba(255, 107, 107, 0.4);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 200ms;
    z-index: 99;
}

.feed-fab:active {
    transform: scale(0.9);
}

.feed-fab:hover {
    transform: scale(1.05);
}

/* Bottom Navigation */
.feed-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-white);
    display: flex;
    justify-content: space-around;
    padding: 8px 0 8px;
    border-top: 1px solid var(--feed-border);
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.04);
    z-index: 100;
}

.feed-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    border: none;
    background: transparent;
    cursor: pointer;
    padding: 8px 8px;
    color: var(--text-light);
    transition: color 150ms;
    flex: 1;
    max-width: 80px;
}

.feed-nav-item.active {
    color: var(--feed-primary);
}

.feed-nav-icon {
    font-size: 22px;
    margin-bottom: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Navigation SVG icons */
.nav-icon-svg {
    width: 24px;
    height: 24px;
    stroke: var(--text-light);
    transition: stroke 200ms, transform 200ms;
}

.feed-nav-item.active .nav-icon-svg {
    stroke: var(--primary-color);
}

.feed-nav-item:hover .nav-icon-svg {
    stroke: var(--primary-color);
    transform: translateY(-2px);
}

[data-theme="dark"] .nav-icon-svg {
    stroke: rgba(255, 255, 255, 0.6);
}

[data-theme="dark"] .feed-nav-item.active .nav-icon-svg {
    stroke: var(--primary-color);
}

[data-theme="dark"] .feed-nav-item:hover .nav-icon-svg {
    stroke: var(--primary-color);
}

.feed-nav-label {
    font-size: 9px;
    font-weight: 500;
    text-align: center;
}

/* Empty State */
.feed-empty-state {
    padding: 60px 20px;
    text-align: center;
}

.feed-empty-state-icon {
    font-size: 64px;
    margin-bottom: 16px;
}

.feed-empty-state h3 {
    font-size: 20px;
    color: var(--text-dark);
    margin-bottom: 8px;
}

.feed-empty-state p {
    font-size: 14px;
    color: var(--text-light);
}

/* ==================== END FEED DESIGN SYSTEM ==================== */

/* Feed Iframe Clean Styling */
body.feed-iframe-body {
    background: transparent;
    padding: 0;
    margin: 0;
    min-height: 100vh;
    overflow-x: hidden;
}

.feed-iframe-content {
    padding: 0;
}

.feed-iframe-header {
    padding: 16px;
    display: flex;
    justify-content: flex-end;
    background: transparent;
}

.feed-primary-btn {
    background: var(--feed-primary);
    color: white;
    border: none;
    border-radius: 24px;
    padding: 12px 24px;
    font-size: 15px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: transform 150ms, box-shadow 150ms;
    box-shadow: 0 2px 8px rgba(255, 107, 107, 0.3);
}

.feed-primary-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.4);
}

.feed-primary-btn:active {
    transform: translateY(0);
}

.feed-secondary-btn {
    background: var(--feed-secondary);
    color: white;
    border: none;
    border-radius: 24px;
    padding: 12px 24px;
    font-size: 15px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: transform 150ms, box-shadow 150ms;
    box-shadow: 0 2px 8px rgba(78, 205, 196, 0.3);
    margin-left: 8px;
}

.feed-secondary-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(78, 205, 196, 0.4);
}

.feed-secondary-btn:active {
    transform: translateY(0);
}

.feed-iframe-header {
    gap: 8px;
}

body.feed-iframe-body .friends-section,
body.feed-iframe-body .shared-recipes-section {
    margin: 0;
    padding: 0;
}

body.feed-iframe-body .friends-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

body.feed-iframe-body .friends-category {
    margin-bottom: 16px;
}

body.feed-iframe-body .friends-category h3 {
    padding: 12px 16px;
    margin: 0;
    background: var(--bg-white);
    border-bottom: 1px solid var(--feed-border);
    font-size: 14px;
    font-weight: 600;
    color: var(--text-dark);
}

body.feed-iframe-body .friend-card {
    background: var(--bg-white);
    border-bottom: 1px solid var(--feed-border);
    padding: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 150ms;
}

body.feed-iframe-body .friend-card:hover {
    background: var(--bg-light);
}

body.feed-iframe-body .friend-card h4 {
    color: var(--text-dark);
    margin: 0 0 4px 0;
}

body.feed-iframe-body .friend-card p {
    color: var(--text-light);
    margin: 0;
    font-size: 14px;
}

body.feed-iframe-body .request-date {
    color: var(--text-light);
    font-size: 13px;
}

body.feed-iframe-body .shared-recipes-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 0 16px;
}

body.feed-iframe-body .empty-state {
    padding: 40px 16px;
    text-align: center;
    color: var(--text-light);
}

/* ========================================
   SAAS DASHBOARD LAYOUT
   ======================================== */

.saas-layout {
    display: flex;
    min-height: 100vh;
    background: var(--bg-light);
}

/* ========================================
   SIDEBAR
   ======================================== */

.sidebar {
    background: var(--bg-white);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    width: 260px;
    flex-shrink: 0;
    transition: var(--transition);
}

.sidebar-header {
    padding: 24px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.app-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-dark);
    letter-spacing: -0.01em;
}

.logo-icon {
    font-size: 1.75rem;
}

.sidebar-toggle {
    display: none;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
    color: var(--text-medium);
    transition: var(--transition);
}

.sidebar-toggle:hover {
    background: var(--bg-light);
}

.sidebar-nav {
    flex: 1;
    padding: 20px 12px;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    margin-bottom: 4px;
    border-radius: 8px;
    color: var(--text-medium);
    text-decoration: none;
    font-size: 0.9375rem;
    font-weight: 500;
    transition: var(--transition);
    cursor: pointer;
}

.nav-item:hover {
    background: var(--bg-light);
    color: var(--text-dark);
}

.nav-item.active {
    background: var(--primary-color);
    color: white;
    font-weight: 600;
}

.nav-icon {
    font-size: 1.25rem;
}

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

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

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 1rem;
}

.user-info {
    flex: 1;
    min-width: 0;
}

.user-name {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-dark);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-level {
    font-size: 0.75rem;
    color: var(--text-light);
}

.btn-logout {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
    color: var(--text-medium);
    transition: var(--transition);
    font-size: 1.25rem;
}

.btn-logout:hover {
    background: var(--bg-light);
    color: var(--error-color);
}

/* ========================================
   MAIN CONTENT AREA
   ======================================== */

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    width: calc(100% - 260px);
}

.top-header {
    background: var(--bg-white);
    border-bottom: 1px solid var(--border-color);
    padding: 16px 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    box-shadow: var(--shadow-sm);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
    flex: 1;
    max-width: 600px;
}

.mobile-menu-btn {
    display: none;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 8px;
    font-size: 1.5rem;
    color: var(--text-medium);
}

.search-bar {
    position: relative;
    flex: 1;
}

.search-bar .search-input {
    width: 100%;
    padding: 10px 14px 10px 40px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.9375rem;
    background: var(--bg-light);
    color: var(--text-dark);
    transition: var(--transition);
}

.search-bar .search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    background: var(--bg-white);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.125rem;
    pointer-events: none;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.theme-switcher-compact {
    display: flex;
    align-items: center;
}

.dark-mode-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: transparent;
    cursor: pointer;
    transition: var(--transition);
}

.dark-mode-btn:hover {
    background: var(--bg-light);
}

.dark-mode-checkbox {
    display: none;
}

.dark-mode-icon {
    font-size: 1.25rem;
}

.btn-add-recipe {
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.btn-icon {
    font-size: 1.125rem;
    font-weight: 700;
}

.user-menu-dropdown {
    position: relative;
}

.user-menu-trigger {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9375rem;
    color: var(--text-dark);
    transition: var(--transition);
}

.user-menu-trigger:hover {
    background: var(--bg-light);
}

.user-greeting-short {
    font-weight: 500;
}

.dropdown-arrow {
    font-size: 0.75rem;
    color: var(--text-light);
}

.user-menu-content {
    display: none;
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    padding: 8px;
    min-width: 200px;
    z-index: 100;
}

.user-menu-content .menu-item {
    padding: 8px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.theme-select-compact {
    padding: 4px 8px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.875rem;
    background: var(--bg-light);
    color: var(--text-dark);
}

/* ========================================
   CONTENT AREA
   ======================================== */

.content-area {
    flex: 1;
    padding: 32px;
    overflow-y: auto;
}

.view {
    display: block;
}

.view-header {
    margin-bottom: 32px;
}

.view-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 8px;
    letter-spacing: -0.02em;
}

.view-subtitle {
    font-size: 1rem;
    color: var(--text-medium);
}

/* ========================================
   DASHBOARD STYLES
   ======================================== */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

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

.stat-icon {
    font-size: 2.5rem;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
}

.stat-info {
    flex: 1;
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-light);
    margin-bottom: 4px;
    font-weight: 500;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-dark);
    line-height: 1;
}

.dashboard-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.dashboard-card {
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 28px;
    box-shadow: var(--shadow);
}

.dashboard-card h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 20px;
    letter-spacing: -0.01em;
}

/* ========================================
   RECIPES VIEW
   ======================================== */

.recipes-controls {
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 20px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-sm);
}

.filter-section {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.sort-section {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

/* ========================================
   EMBEDDED PAGES (iframes)
   ======================================== */

.embedded-page {
    width: 100%;
    min-height: calc(100vh - 250px);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    background: var(--bg-white);
}

/* ========================================
   MOBILE RESPONSIVE
   ======================================== */

@media (max-width: 1024px) {
    .dashboard-row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        transform: translateX(-100%);
        width: 280px;
        z-index: 1000;
    }

    .sidebar.mobile-open {
        transform: translateX(0);
        box-shadow: var(--shadow-lg);
    }

    .main-content {
        width: 100%;
    }

    .mobile-menu-btn {
        display: block;
    }

    .top-header {
        padding: 12px 16px;
    }

    .content-area {
        padding: 20px 16px;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .btn-text {
        display: none;
    }

    .search-bar {
        max-width: 200px;
    }

    .user-greeting-short {
        display: none;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .header-left {
        max-width: 100%;
    }

    .search-bar {
        max-width: none;
    }
}

/* ========================================
   LEGACY LAYOUT COMPATIBILITY
   ======================================== */

/* Hide old layout elements when using SaaS layout */
.saas-layout .app-container {
    display: none;
}

.app-container {
    max-width: 1400px;
    margin: 0 auto;
}

/* Header */
.app-header {
    background: var(--bg-white);
    padding: 32px 40px;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow);
    margin-bottom: 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 24px;
    border: 1px solid var(--border-color);
}

.header-content h1 {
    color: var(--text-dark);
    font-size: 2.25rem;
    margin-bottom: 6px;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.tagline {
    color: var(--text-medium);
    font-size: 1rem;
    font-weight: 500;
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border: 2px solid transparent;
    border-radius: 10px;
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 200ms ease;
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--feed-primary) 0%, var(--feed-secondary) 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 107, 107, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(255, 107, 107, 0.3);
}

.btn-secondary {
    background: var(--bg-white);
    color: var(--text-dark);
    border-color: var(--border-color);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.btn-secondary:hover {
    background: var(--bg-light);
    border-color: var(--text-medium);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Search Section */
.search-section {
    background: var(--bg-white);
    padding: 28px 32px;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow);
    margin-bottom: 32px;
    border: 1px solid var(--border-color);
}

.search-controls {
    display: flex;
    gap: 15px;
    align-items: center;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.search-input {
    flex: 1;
    min-width: 250px;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.9375rem;
    font-family: inherit;
    transition: var(--transition);
    background: var(--bg-white);
    color: var(--text-dark);
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

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

.sort-control {
    display: flex;
    align-items: center;
    gap: 10px;
    white-space: nowrap;
}

.sort-control label {
    font-weight: 600;
    color: var(--text-dark);
    font-size: 0.875rem;
}

.sort-select, .theme-select {
    padding: 10px 14px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.9375rem;
    font-family: inherit;
    background: var(--bg-white);
    color: var(--text-dark);
    cursor: pointer;
    transition: var(--transition);
}

.sort-select:focus, .theme-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.sort-select:hover, .theme-select:hover {
    border-color: var(--text-medium);
}

.filter-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 8px 16px;
    border: 1px solid var(--border-color);
    background: var(--bg-white);
    color: var(--text-dark);
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.875rem;
    transition: var(--transition);
    font-family: inherit;
}

.filter-btn:hover {
    background: var(--bg-light);
    border-color: var(--text-medium);
}

.filter-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.quick-meal-filter.active {
    background: var(--accent-color);
    color: white;
    border-color: var(--accent-color);
}

.modified-filter.active {
    background: var(--secondary-color);
    color: white;
    border-color: var(--secondary-color);
}

/* Recipe Grid */
.recipes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 25px;
    margin-bottom: 30px;
}

.recipe-card {
    background: var(--bg-white);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    border: 1px solid var(--border-color);
}

.recipe-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
}

.quick-meal-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: var(--accent-color);
    color: white;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    z-index: 1;
    box-shadow: var(--shadow-md);
    letter-spacing: 0.025em;
}

/* Public badge goes on the left side */
.quick-meal-badge.public-badge {
    right: auto;
    left: 12px;
}

.recipe-image {
    width: 100%;
    height: 220px;
    object-fit: cover;
    background: linear-gradient(135deg, var(--accent-color) 0%, var(--primary-color) 100%);
}

.recipe-content {
    padding: 20px;
}

.recipe-category {
    display: inline-block;
    padding: 4px 10px;
    background: rgba(59, 130, 246, 0.1);
    color: var(--primary-color);
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.recipe-name {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 8px;
    line-height: 1.4;
    letter-spacing: -0.01em;
}

.recipe-author {
    color: var(--text-medium);
    font-size: 0.875rem;
    margin-bottom: 12px;
}

.recipe-meta {
    display: flex;
    gap: 16px;
    color: var(--text-light);
    font-size: 0.875rem;
    margin-bottom: 16px;
    font-weight: 500;
}

.recipe-actions {
    display: flex;
    gap: 8px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

.action-btn {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid transparent;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.875rem;
    transition: var(--transition);
    font-family: inherit;
}

.edit-btn {
    background: rgba(59, 130, 246, 0.1);
    color: var(--primary-color);
    border-color: transparent;
}

.edit-btn:hover {
    background: var(--primary-color);
    color: white;
}

.delete-btn {
    background: rgba(239, 68, 68, 0.1);
    color: var(--error-color);
    border-color: transparent;
}

.delete-btn:hover {
    background: var(--error-color);
    color: white;
}

/* Action Icon Styles */
.action-icon {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    margin-right: 6px;
    vertical-align: middle;
    transition: all 150ms;
}

.feed-action-btn,
.action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.feed-action-btn:hover .action-icon,
.action-btn:hover .action-icon {
    transform: scale(1.1);
}

/* Search Bar Icon */
.search-bar-icon {
    width: 20px;
    height: 20px;
    stroke: var(--text-light);
    flex-shrink: 0;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    z-index: 1000;
    overflow-y: auto;
    padding: 24px;
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: var(--bg-white);
    border-radius: var(--border-radius-lg);
    max-width: 700px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-hover);
    border: 1px solid var(--border-color);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    background: var(--bg-white);
    z-index: 10;
}

.modal-header h2 {
    color: var(--text-dark);
    font-size: 1.5rem;
    font-weight: 700;
}

.close-btn {
    background: var(--bg-light);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 1.5rem;
    color: var(--text-medium);
    cursor: pointer;
    transition: all 150ms ease;
    padding: 0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-btn:hover {
    background: var(--bg-white);
    border-color: var(--text-dark);
    color: var(--text-dark);
    transform: scale(1.05);
}

/* Form */
#recipeForm,
.modal-content form {
    padding: 25px;
}

.form-group {
    margin-bottom: 25px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text-dark);
    letter-spacing: -0.01em;
}

.form-group small {
    display: block;
    margin-top: 6px;
    font-size: 0.8125rem;
    color: var(--text-medium);
}

input[type="text"],
input[type="email"],
input[type="url"],
input[type="number"],
input[type="date"],
select,
textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    font-size: 0.9375rem;
    font-family: inherit;
    transition: all 200ms ease;
    background: var(--bg-white);
    color: var(--text-dark);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--feed-primary);
    box-shadow: 0 0 0 4px rgba(255, 107, 107, 0.1), 0 1px 3px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

input::placeholder,
textarea::placeholder {
    color: var(--text-light);
}

textarea {
    resize: vertical;
}

.form-actions {
    display: flex;
    gap: 15px;
    justify-content: flex-end;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 2px solid #e0e0e0;
}

/* Smart Paste Section */
.smart-paste-section {
    padding: 25px;
    background: #f8f9fa;
    margin: 0 -25px -25px;
    border-radius: 0 0 var(--border-radius) var(--border-radius);
}

.smart-paste-section hr {
    border: none;
    border-top: 2px solid #e0e0e0;
    margin-bottom: 20px;
}

.smart-paste-section h3 {
    color: var(--secondary-color);
    margin-bottom: 10px;
}

.help-text {
    color: var(--text-light);
    margin-bottom: 15px;
    font-size: 0.95em;
}

/* Recipe Detail */
.recipe-detail {
    max-width: 900px;
}

.detail-header {
    position: relative;
}

.detail-image {
    width: 100%;
    height: 300px;
    object-fit: cover;
}

.detail-info {
    padding: 30px;
}

.detail-category {
    display: inline-block;
    padding: 6px 14px;
    background: linear-gradient(135deg, var(--feed-primary), var(--feed-secondary));
    color: white;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.875rem;
    margin-bottom: 12px;
    text-transform: capitalize;
}

.detail-name {
    font-size: 2rem;
    color: var(--text-dark);
    margin-bottom: 20px;
    font-weight: 700;
    line-height: 1.2;
}

.detail-meta {
    display: flex;
    gap: 20px;
    margin-bottom: 24px;
    padding: 16px;
    background: var(--bg-light);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    flex-wrap: wrap;
}

.meta-item {
    text-align: center;
    min-width: 80px;
}

.meta-label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-medium);
    margin-bottom: 4px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.meta-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-dark);
}

.detail-section {
    margin-bottom: 32px;
}

.section-title {
    font-size: 1.25rem;
    color: var(--text-dark);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--border-color);
}

.ingredients-list,
.instructions-list {
    list-style: none;
    padding: 0;
}

.ingredients-list li {
    padding: 14px 16px;
    margin-bottom: 10px;
    background: var(--bg-light);
    border-radius: 10px;
    border: 2px solid var(--border-color);
    transition: all 150ms ease;
    display: flex;
    align-items: center;
    gap: 12px;
}

.ingredients-list li:hover {
    border-color: var(--feed-secondary);
    transform: translateX(4px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.ingredients-list li::before {
    content: '✓';
    width: 24px;
    height: 24px;
    background: linear-gradient(135deg, var(--feed-secondary), var(--feed-primary));
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.75rem;
    flex-shrink: 0;
}

.instructions-list li {
    padding: 18px 20px 18px 70px;
    margin-bottom: 16px;
    background: var(--bg-light);
    border-radius: 12px;
    border: 2px solid var(--border-color);
    position: relative;
    transition: all 150ms ease;
    line-height: 1.6;
}

.instructions-list li:hover {
    border-color: var(--feed-primary);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

.step-number {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--feed-primary), var(--feed-secondary));
    color: white;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1rem;
    box-shadow: 0 2px 8px rgba(255, 107, 107, 0.3);
}

.detail-notes {
    padding: 18px 20px;
    background: linear-gradient(135deg, #FFF9E6 0%, #FFF3CD 100%);
    border: 2px solid #FFE066;
    border-radius: 12px;
    color: #9A6B00;
    font-size: 0.9375rem;
    line-height: 1.6;
    box-shadow: 0 2px 8px rgba(255, 193, 7, 0.15);
}

.detail-actions {
    display: flex;
    gap: 15px;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 2px solid #e0e0e0;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    background: var(--bg-white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
}

.empty-state h3 {
    font-size: 1.8em;
    color: var(--text-light);
    margin-bottom: 10px;
}

.empty-state p {
    color: var(--text-light);
}

/* Responsive */
@media (max-width: 768px) {
    .app-header {
        flex-direction: column;
        text-align: center;
    }

    .header-content h1 {
        font-size: 2em;
    }

    .recipes-grid {
        grid-template-columns: 1fr;
    }

    .detail-meta {
        flex-direction: column;
        gap: 15px;
    }

    .form-actions {
        flex-direction: column;
    }

    .detail-name {
        font-size: 1.8em;
    }
}

/* Header Actions */
.header-actions {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.user-greeting {
    color: var(--text-light);
    font-size: 0.95em;
    padding-right: 10px;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

/* ========================================
   AD CONTAINER STYLES
   ======================================== */

/* General ad container styling */
.ad-container {
    margin: 30px auto;
    text-align: center;
    min-height: 0; /* Collapses when empty */
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

/* Add subtle "Advertisement" label above ads */
.ad-container::before {
    content: "Advertisement";
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.7em;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0; /* Hidden by default */
}

/* Top banner ad - after header */
.ad-top-banner {
    background: var(--bg-white);
    padding: 20px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    max-width: 728px;
}

/* In-grid ads - between recipe cards */
.ad-in-grid {
    grid-column: 1 / -1; /* Span full width of grid */
    background: var(--bg-white);
    padding: 20px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    max-width: 728px;
    margin: 20px auto;
}

/* Recipe detail modal ads */
.ad-recipe-detail {
    background: rgba(255, 255, 255, 0.5);
    padding: 20px;
    border-radius: var(--border-radius);
    margin: 25px 0;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .ad-container {
        margin: 20px auto;
        padding: 10px;
    }

    .ad-top-banner,
    .ad-in-grid {
        max-width: 100%;
    }
}

/* ========================================
   CUSTOM MODAL DIALOGS (Confirm/Alert)
   ======================================== */

/* Overlay background */
.custom-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease;
}

.custom-modal-overlay.active {
    display: flex;
}

/* Modal container */
.custom-modal {
    background: var(--bg-white);
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    padding: 30px;
    max-width: 400px;
    width: 90%;
    text-align: center;
    animation: slideIn 0.3s ease;
}

/* Modal icon */
.custom-modal-icon {
    font-size: 3em;
    margin-bottom: 15px;
}

/* Modal title */
.custom-modal-title {
    color: var(--text-dark);
    font-size: 1.5em;
    margin-bottom: 10px;
    font-weight: 600;
}

/* Modal message */
.custom-modal-message {
    color: var(--text-light);
    font-size: 1em;
    line-height: 1.5;
    margin-bottom: 25px;
}

/* Modal buttons */
.custom-modal-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.custom-modal-buttons .btn {
    flex: 1;
    max-width: 150px;
}

/* Confirm modal specific styling */
.confirm-modal .custom-modal-icon {
    color: #ff6b6b;
}

/* Alert modal specific styling */
.alert-modal .custom-modal-icon {
    color: #4ecdc4;
}

/* Success variant */
.alert-modal.success .custom-modal-icon {
    color: #5cb85c;
}

/* Error variant */
.alert-modal.error .custom-modal-icon {
    color: #ff6b6b;
}

/* Info variant */
.alert-modal.info .custom-modal-icon {
    color: #5bc0de;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideIn {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Mobile responsive */
@media (max-width: 768px) {
    .custom-modal {
        padding: 25px 20px;
        max-width: 340px;
    }

    .custom-modal-title {
        font-size: 1.3em;
    }

    .custom-modal-message {
        font-size: 0.95em;
    }

    .custom-modal-buttons {
        flex-direction: column;
    }

    .custom-modal-buttons .btn {
        max-width: 100%;
    }
}

/* ========================================
   FETCH PROGRESS BAR
   ======================================== */

/* Progress container */
.fetch-progress-container {
    margin: 15px 0;
    padding: 20px;
    background: linear-gradient(135deg, rgba(255, 107, 107, 0.1) 0%, rgba(255, 135, 135, 0.15) 100%);
    border-radius: 12px;
    border: 1px solid rgba(255, 107, 107, 0.2);
    animation: fadeIn 0.3s ease;
}

/* Progress bar wrapper */
.fetch-progress-bar-wrapper {
    width: 100%;
    height: 10px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 5px;
    overflow: hidden;
    margin-bottom: 12px;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Animated progress bar */
.fetch-progress-bar {
    height: 100%;
    width: 100%;
    background: linear-gradient(90deg, 
        var(--primary-color) 0%, 
        #ff8787 25%, 
        var(--primary-color) 50%, 
        #ff8787 75%, 
        var(--primary-color) 100%
    );
    background-size: 200% 100%;
    border-radius: 5px;
    animation: shimmer 2s ease-in-out infinite;
    box-shadow: 0 0 10px rgba(255, 107, 107, 0.4);
}

/* Progress text */
.fetch-progress-text {
    text-align: center;
    color: var(--primary-color);
    font-size: 0.95em;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

/* Elapsed time styling */
#fetchElapsedTime {
    color: #ff8787;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

/* Shimmer animation */
@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

/* Pulse animation for wrapper */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.8;
    }
}

/* User Stats Section */
.user-stats-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

/* Gamification Widget */
.gamification-widget {
    background: var(--bg-white);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow);
    padding: 28px;
    border: 1px solid var(--border-color);
}

.gamification-widget h3 {
    color: var(--text-dark);
    margin-bottom: 20px;
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.gamification-content {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.level-display {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
}

.level-circle {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--bg-white);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.level-number {
    font-size: 2.5em;
    font-weight: 700;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.level-info {
    flex: 1;
}

.level-label {
    font-size: 0.9em;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.points-display {
    font-size: 1.5em;
    font-weight: 700;
    color: white;
}

.badges-display h4 {
    color: var(--text-dark);
    margin-bottom: 15px;
    font-size: 1.1em;
}

.badges-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
}

.badge-slot {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    font-size: 2.5em;
    transition: all 0.3s ease;
    background: #f5f5f5;
    border: 2px dashed #ddd;
}

.badge-slot.empty {
    opacity: 0.3;
}

.badge-slot.unlocked {
    background: linear-gradient(135deg, var(--accent-color) 0%, var(--primary-color) 100%);
    border: none;
    box-shadow: var(--shadow);
    transform: scale(1);
    opacity: 1;
}

.badge-slot.unlocked:hover {
    transform: scale(1.1);
    box-shadow: var(--shadow-hover);
}

/* Skills & Mastery Widget */
.skills-widget {
    background: var(--bg-white);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow);
    padding: 28px;
    border: 1px solid var(--border-color);
}

.skills-widget h3 {
    color: var(--text-dark);
    margin-bottom: 20px;
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.no-skills-message {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-light);
    font-style: italic;
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 15px;
}

.skill-card {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    padding: 20px;
    border-radius: 12px;
    text-align: center;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

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

.skill-icon {
    font-size: 3em;
    margin-bottom: 10px;
}

.skill-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.skill-name {
    font-weight: 700;
    font-size: 1.1em;
    color: var(--text-dark);
}

.skill-level {
    font-size: 1.3em;
    font-weight: 700;
    color: var(--primary-color);
}

.skill-progress-bar {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 10px;
    overflow: hidden;
}

.skill-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    border-radius: 10px;
    transition: width 0.5s ease;
}

.skill-xp-text {
    font-size: 0.85em;
    color: var(--text-light);
    font-weight: 600;
}

.skill-recipes-count {
    font-size: 0.8em;
    color: var(--text-light);
}

/* New Skill Card System */
.skill-category {
    margin-bottom: 32px;
}

.skill-category-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--border-color);
}

.skill-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.skill-card {
    background: var(--bg-white);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 16px;
    transition: all 300ms cubic-bezier(0.4, 0, 0.2, 1);
}

.skill-card.unlocked {
    border-color: var(--primary-color);
}

.skill-card.locked {
    opacity: 0.6;
}

.skill-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

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

.skill-card-icon {
    font-size: 32px;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-light);
    border-radius: 8px;
}

.skill-card-info {
    flex: 1;
}

.skill-card-name {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 2px;
}

.skill-card-level {
    font-size: 12px;
    color: var(--text-light);
    font-weight: 600;
}

.skill-card-stars {
    font-size: 16px;
    margin-bottom: 8px;
    letter-spacing: 2px;
}

.skill-card-progress {
    margin-top: 8px;
}

.skill-progress-bar-container {
    width: 100%;
    height: 6px;
    background: var(--bg-light);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 6px;
}

.skill-progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--feed-primary), var(--feed-secondary));
    border-radius: 10px;
    transition: width 600ms cubic-bezier(0.4, 0, 0.2, 1);
}

.skill-progress-text {
    font-size: 11px;
    color: var(--text-light);
    font-weight: 600;
}

.skill-card-locked {
    margin-top: 8px;
    text-align: center;
    padding: 16px 8px;
    background: var(--bg-light);
    border-radius: 8px;
}

.skill-lock-icon {
    font-size: 24px;
    margin-bottom: 4px;
}

.skill-lock-text {
    font-size: 11px;
    color: var(--text-medium);
    font-weight: 500;
}

/* Badge Unlock Animation */
@keyframes badgeUnlock {
    0% {
        transform: scale(0.3) rotate(-180deg);
        opacity: 0;
    }
    50% {
        transform: scale(1.2) rotate(10deg);
    }
    100% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
}

@keyframes badgePulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(255, 107, 107, 0.7);
    }
    50% {
        box-shadow: 0 0 0 20px rgba(255, 107, 107, 0);
    }
}

.profile-badge.just-unlocked {
    animation: badgeUnlock 600ms cubic-bezier(0.68, -0.55, 0.265, 1.55),
               badgePulse 1.5s ease-out 600ms;
}

/* Cooking Streak Calendar */
.cooking-streak-widget {
    background: var(--bg-white);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow);
    padding: 28px;
    border: 1px solid var(--border-color);
}

.cooking-streak-widget h3 {
    color: var(--text-dark);
    margin-bottom: 20px;
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.streak-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.streak-item {
    text-align: center;
    padding: 15px;
    background: linear-gradient(135deg, var(--accent-color) 0%, var(--primary-color) 100%);
    border-radius: 10px;
}

.streak-number {
    display: block;
    font-size: 2.5em;
    font-weight: 700;
    color: white;
    margin-bottom: 5px;
}

.calendar-header {
    text-align: center;
    margin: 20px 0;
}

.calendar-header h4 {
    color: var(--text-dark);
    font-size: 1.2em;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 5px;
}

.calendar-day-header {
    text-align: center;
    font-weight: 600;
    padding: 8px;
    color: var(--text-light);
    font-size: 0.85em;
}

.calendar-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: #f5f5f5;
    font-size: 0.9em;
    color: var(--text-dark);
    font-weight: 500;
    transition: all 0.2s ease;
}

.calendar-day.empty {
    background: transparent;
}

.calendar-day.today {
    border: 2px solid var(--primary-color);
    font-weight: 700;
}

.calendar-day.cooked {
    background: var(--secondary-color);
    color: white;
    font-weight: 700;
}

.calendar-day.cooked.today {
    background: var(--primary-color);
    border: 2px solid var(--text-dark);
}

/* Recipe Ratings Section */
.ratings-section {
    background: var(--bg-white);
    padding: 20px;
    border-radius: 10px;
    margin-top: 20px;
}

.average-ratings {
    margin-bottom: 20px;
}

.ratings-intro {
    font-weight: 600;
    margin-bottom: 15px;
    color: var(--text-dark);
}

.rating-item {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    padding: 12px;
    background: var(--bg-white);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
}

.rating-label {
    font-weight: 600;
    min-width: 120px;
    font-size: 0.9375rem;
    color: var(--text-dark);
}

.rating-value {
    font-weight: 700;
    color: var(--primary-color);
    font-size: 1rem;
}

.rating-stars {
    color: #fbbf24;
    font-size: 1.125rem;
}

.rating-diff {
    font-size: 0.8125rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 6px;
}

.rating-diff.over {
    background: #ffebee;
    color: #c62828;
}

.rating-diff.under {
    background: #e8f5e9;
    color: #2e7d32;
}

.section-divider {
    border: none;
    border-top: 2px solid #e0e0e0;
    margin: 20px 0;
}

.rate-recipe {
    margin-top: 15px;
}

.rate-intro {
    margin-bottom: 15px;
    color: var(--text-dark);
}

.rating-input-group {
    margin-bottom: 15px;
}

.rating-input-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-dark);
}

.rating-input-group input[type="number"] {
    width: 100%;
    max-width: 200px;
    padding: 10px 14px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 0.9375rem;
    font-family: inherit;
    transition: var(--transition);
}

.rating-input-group input[type="number"]:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.rating-input-group small {
    display: block;
    color: var(--text-light);
    font-size: 0.8125rem;
    margin-top: 6px;
}

.star-rating {
    display: flex;
    gap: 5px;
    font-size: 2em;
    cursor: pointer;
    user-select: none;
}

.star-rating .star {
    color: #ccc;
    transition: all 0.2s ease;
}

.star-rating .star:hover {
    transform: scale(1.2);
}

/* Cooking Attempts Timeline Section */
.attempts-timeline-section {
    background: var(--bg-white);
    padding: 24px;
    border-radius: var(--border-radius-lg);
    margin-top: 24px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow);
}

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

.attempts-count {
    background: var(--secondary-color);
    color: white;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 600;
    letter-spacing: 0.01em;
}

.no-attempts-message {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-light);
    font-style: italic;
}

.attempts-timeline {
    margin-bottom: 30px;
}

.timeline-item {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
}

.timeline-marker {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex-shrink: 0;
}

.marker-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--accent-color) 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1em;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.marker-line {
    width: 3px;
    flex: 1;
    background: linear-gradient(180deg, var(--primary-color) 0%, transparent 100%);
    min-height: 100px;
    margin-top: 5px;
}

.timeline-content {
    flex: 1;
    background: var(--bg-white);
    padding: 20px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
}

.timeline-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}

.timeline-title {
    font-weight: 700;
    font-size: 1.0625rem;
    color: var(--text-dark);
    letter-spacing: -0.01em;
}

.timeline-date {
    color: var(--text-light);
    font-size: 0.875rem;
    font-style: italic;
}

.timeline-header-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.btn-delete-attempt {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 1.2em;
    padding: 5px 8px;
    border-radius: 5px;
    transition: all 0.2s ease;
    opacity: 0.6;
}

.btn-delete-attempt:hover {
    background: rgba(255, 0, 0, 0.1);
    opacity: 1;
    transform: scale(1.1);
}

.timeline-photos {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 15px;
    align-items: center;
    margin-bottom: 15px;
}

.timeline-photo-item {
    text-align: center;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.timeline-photo-label {
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--text-dark);
    font-size: 0.9em;
}

.timeline-img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
    display: block;
    background: #f0f0f0;
}

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

.timeline-arrow {
    font-size: 2em;
    color: var(--primary-color);
    font-weight: 700;
}

.timeline-notes {
    background: #f5f5f5;
    padding: 12px 15px;
    border-radius: 8px;
    border-left: 4px solid var(--secondary-color);
    line-height: 1.5;
}

.timeline-notes strong {
    color: var(--text-dark);
}

.add-attempt-photo {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 2px solid #e0e0e0;
}

.add-attempt-photo textarea {
    width: 100%;
    padding: 10px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1em;
    font-family: inherit;
    resize: vertical;
}

.add-attempt-photo textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* Mobile responsive */
@media (max-width: 768px) {
    .fetch-progress-container {
        padding: 15px;
        margin: 10px 0;
    }

    .fetch-progress-text {
        font-size: 0.85em;
    }

    .fetch-progress-bar-wrapper {
        height: 8px;
    }

    .streak-stats {
        grid-template-columns: 1fr;
    }

    .calendar-grid {
        gap: 3px;
    }

    .calendar-day {
        font-size: 0.8em;
    }

    .rating-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .rating-label {
        min-width: auto;
    }

    /* Timeline responsive */
    .timeline-photos {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .timeline-arrow {
        transform: rotate(90deg);
        font-size: 1.5em;
    }

    .timeline-img {
        height: 150px;
    }

    .timeline-item {
        gap: 10px;
    }

    .marker-circle {
        width: 30px;
        height: 30px;
        font-size: 0.9em;
    }

    .marker-line {
        width: 2px;
        min-height: 80px;
    }

    .timeline-content {
        padding: 15px;
    }
}

/* ========================================
   COOKING MODE
   ======================================== */

.cooking-mode-modal .modal-content {
    max-width: 95vw;
    max-height: 95vh;
    width: 1200px;
    padding: 0;
}

.cooking-mode-container {
    display: flex;
    flex-direction: column;
    height: 90vh;
}

.cooking-mode-header {
    background: linear-gradient(135deg, var(--feed-primary) 0%, var(--feed-secondary) 100%);
    color: white;
    padding: 24px 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    border-bottom: 3px solid rgba(255, 255, 255, 0.2);
}

.cooking-mode-header h2 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.cooking-mode-timer {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(10px);
    padding: 12px 20px;
    border-radius: 12px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.timer-icon {
    font-size: 1.5rem;
}

.timer-display {
    font-size: 1.5rem;
    font-weight: 700;
    font-family: 'SF Mono', 'Monaco', 'Courier New', monospace;
    letter-spacing: 0.05em;
}

.cooking-mode-header .close-btn {
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 200ms ease;
}

.cooking-mode-header .close-btn:hover {
    background: rgba(255, 255, 255, 0.35);
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.cooking-mode-content {
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 0;
    flex: 1;
    overflow: hidden;
}

/* Ingredients Panel */
.ingredients-checklist-panel {
    background: var(--bg-light);
    padding: 32px;
    border-right: 1px solid var(--border-color);
    overflow-y: auto;
}

.ingredients-checklist-panel h3 {
    color: var(--text-dark);
    margin-bottom: 20px;
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    position: sticky;
    top: 0;
    background: var(--bg-light);
    padding-bottom: 12px;
}

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

.checklist-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px 18px;
    background: var(--bg-white);
    border-radius: 10px;
    cursor: pointer;
    transition: all 150ms ease;
    border: 2px solid var(--border-color);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.checklist-item:hover {
    border-color: var(--feed-secondary);
    transform: translateX(4px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.checklist-item.checked {
    background: linear-gradient(135deg, #E8F5E9 0%, #C8E6C9 100%);
    border-color: #4caf50;
    opacity: 0.8;
}

.checklist-item input[type="checkbox"] {
    width: 22px;
    height: 22px;
    cursor: pointer;
    flex-shrink: 0;
    margin-top: 2px;
    accent-color: var(--feed-primary);
}

.checklist-text {
    flex: 1;
    line-height: 1.5;
}

.checklist-item.checked .checklist-text {
    text-decoration: line-through;
    color: var(--text-light);
}

/* Steps Panel */
.steps-panel {
    padding: 40px;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.step-counter {
    text-align: center;
    font-size: 1.2em;
    color: var(--text-light);
    margin-bottom: 20px;
    font-weight: 600;
}

.step-counter #currentStepNum {
    color: var(--primary-color);
    font-size: 1.5em;
    font-weight: 700;
}

.current-step-display {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 30px;
}

.step-content {
    max-width: 700px;
    width: 100%;
}

.step-text {
    font-size: 1.5rem;
    line-height: 1.7;
    color: var(--text-dark);
    margin-bottom: 30px;
    padding: 32px;
    background: var(--bg-white);
    border-radius: 16px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    border: 3px solid transparent;
    border-left-color: var(--feed-primary);
    transition: all 200ms ease;
}

.step-text:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

.step-content.completed .step-text {
    background: linear-gradient(135deg, #E8F5E9 0%, #C8E6C9 100%);
    border-left-color: #4caf50;
    opacity: 0.85;
}

.step-subheader {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    color: white !important;
    font-weight: 700;
    text-align: center;
    border-left: none !important;
    font-size: 2em !important;
    padding: 25px 30px !important;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.step-content.subheader {
    margin-bottom: 20px;
}

.step-checkbox {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.2em;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.step-checkbox:hover {
    background: #e9ecef;
}

.step-checkbox input[type="checkbox"] {
    width: 24px;
    height: 24px;
    cursor: pointer;
}

.checkbox-label {
    font-weight: 600;
    color: var(--text-dark);
}

.step-navigation {
    display: flex;
    gap: 16px;
    justify-content: center;
    margin-bottom: 20px;
}

.step-navigation .btn {
    min-width: 140px;
    font-size: 1rem;
    padding: 14px 28px;
    border-radius: 12px;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: all 200ms ease;
}

.step-navigation .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.step-navigation .btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.completed-steps-indicator {
    text-align: center;
}

.steps-progress {
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

.progress-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #e0e0e0;
    transition: all 0.3s ease;
}

.progress-dot.current {
    background: var(--primary-color);
    transform: scale(1.5);
    box-shadow: 0 0 10px var(--primary-color);
}

.progress-dot.completed {
    background: #4caf50;
}

.cooking-mode-btn {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.cooking-mode-btn:hover {
    background: linear-gradient(135deg, #f5576c 0%, #f093fb 100%);
}

/* Mobile responsive for cooking mode */
@media (max-width: 900px) {
    .cooking-mode-content {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr;
    }

    .ingredients-checklist-panel {
        border-right: none;
        border-bottom: 2px solid #e0e0e0;
        max-height: 200px;
    }

    .step-text {
        font-size: 1.3em;
        padding: 20px;
    }

    .cooking-mode-header h2 {
        font-size: 1.3em;
    }

    .timer-display {
        font-size: 1.3em;
    }

    .steps-panel {
        padding: 20px;
    }
}

/* ========================================
   AUTHENTICITY RATINGS
   ======================================== */

.authenticity-section {
    background: var(--bg-white);
    padding: 20px;
    border-radius: 10px;
    margin-top: 20px;
}

.authenticity-display {
    margin-bottom: 20px;
    text-align: center;
}

.authenticity-badge {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 15px 25px;
    border-radius: 25px;
    font-weight: 700;
    font-size: 1.2em;
    margin-bottom: 10px;
}

.authenticity-badge.authentic {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    color: white;
}

.authenticity-badge.good {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
}

.authenticity-badge.okay {
    background: linear-gradient(135deg, #ffeaa7 0%, #fdcb6e 100%);
    color: var(--text-dark);
}

.badge-icon {
    font-size: 1.3em;
    font-weight: 700;
}

.authenticity-stats {
    color: var(--text-light);
    font-size: 0.95em;
}

.rate-authenticity {
    border-top: 2px solid #e0e0e0;
    padding-top: 20px;
    margin-top: 20px;
}

.rate-description {
    color: var(--text-light);
    font-size: 0.9em;
    margin-bottom: 15px;
    font-style: italic;
}

/* ========================================
   RECIPE MODIFICATIONS
   ======================================== */

.fork-btn {
    background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
    color: var(--text-dark);
    font-weight: 600;
}

.fork-btn:hover {
    background: linear-gradient(135deg, #fed6e3 0%, #a8edea 100%);
    transform: translateY(-2px);
}

.modification-indicator {
    background: linear-gradient(135deg, #ffeaa7 0%, #fdcb6e 100%);
    padding: 15px 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    border-left: 4px solid #fdcb6e;
}

.modification-indicator h4 {
    margin: 0 0 10px 0;
    color: var(--text-dark);
    font-size: 1.1em;
}

.modification-summary {
    font-style: italic;
    color: #636e72;
    margin-bottom: 10px;
}

.modification-changes {
    font-size: 0.9em;
    color: var(--text-light);
}

/* ========================================
   CHALLENGES SECTION
   ======================================== */

.challenges-section {
    background: var(--bg-white);
    padding: 28px;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow);
    margin-bottom: 32px;
    border: 1px solid var(--border-color);
}

.challenges-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
    margin-bottom: 15px;
}

.challenge-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 20px;
    border-radius: 12px;
    color: white;
    display: flex;
    gap: 15px;
    transition: all 0.3s ease;
}

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

.challenge-card.completed {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
}

.challenge-icon {
    font-size: 3em;
}

.challenge-info {
    flex: 1;
}

.challenge-name {
    font-weight: 700;
    font-size: 1.125rem;
    margin-bottom: 6px;
    letter-spacing: -0.01em;
}

.challenge-description {
    font-size: 0.875rem;
    opacity: 0.9;
    margin-bottom: 12px;
    line-height: 1.5;
}

.challenge-progress-bar {
    height: 8px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 5px;
}

.challenge-progress-fill {
    height: 100%;
    background: var(--primary-color);
    border-radius: 10px;
    transition: width 0.5s ease;
}

.challenge-progress-text {
    font-size: 0.85em;
    opacity: 0.9;
}

.challenge-complete-badge {
    background: rgba(255, 255, 255, 0.3);
    padding: 8px 15px;
    border-radius: 20px;
    display: inline-block;
    font-weight: 700;
    margin: 10px 0;
}

.challenge-reward {
    font-weight: 600;
    margin-top: 10px;
}

.challenges-note {
    text-align: center;
    color: var(--text-light);
    font-style: italic;
    margin-top: 15px;
}

/* ========================================
   TIER 4 PAGES STYLES
======================================== */

/* Tier 4 Navigation */
.tier4-nav {
    display: flex;
    gap: 8px;
    padding: 16px 24px;
    margin-bottom: 32px;
    background: var(--bg-white);
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    flex-wrap: wrap;
    overflow-x: auto;
}

.tier4-nav-link {
    padding: 10px 18px;
    border: none;
    background: transparent;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-medium);
    text-decoration: none;
    transition: var(--transition);
    white-space: nowrap;
}

.tier4-nav-link:hover {
    background: var(--bg-light);
    color: var(--text-dark);
}

.tier4-nav-link.active {
    background: var(--primary-color);
    color: white;
    box-shadow: var(--shadow-sm);
}

/* Tier 4 Content */
.tier4-content {
    padding: 32px 24px;
    max-width: 1200px;
    margin: 0 auto;
}

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

.tier4-header h2 {
    margin: 0;
    color: var(--text-dark);
    font-size: 1.875rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

/* Friends Styles */
.friends-section, .shared-recipes-section {
    margin-bottom: 48px;
}

.friends-section h3, .shared-recipes-section h3 {
    margin-bottom: 20px;
    color: var(--text-dark);
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.friends-list {
    display: grid;
    gap: 15px;
}

.friend-card {
    background: var(--bg-white);
    padding: 20px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: var(--transition);
}

.friend-card:hover {
    box-shadow: var(--shadow-md);
}

.friend-info h4 {
    margin: 0 0 6px 0;
    color: var(--text-dark);
    font-size: 1.0625rem;
    font-weight: 600;
}

.friend-info p {
    margin: 0;
    color: var(--text-light);
    font-size: 0.875rem;
}

.friend-status {
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 0.8125rem;
    font-weight: 600;
    margin-right: 10px;
    letter-spacing: 0.01em;
}

.friend-status.pending {
    background: #fef3c7;
    color: #92400e;
}

.friend-status.accepted {
    background: #d1fae5;
    color: #065f46;
}

.friend-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

/* Friends Categories */
.friends-category {
    margin-bottom: 40px;
}

.friends-category h3 {
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--border-color);
    color: var(--text-dark);
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.request-date {
    display: block;
    font-size: 0.85em;
    color: var(--text-light);
    margin-top: 5px;
}

.friend-card.incoming-request {
    border-left: 4px solid #3b82f6;
}

.friend-card.outgoing-request {
    border-left: 4px solid #f59e0b;
}

.friend-card.accepted-friend {
    border-left: 4px solid #10b981;
}

/* Shared Recipes */
.shared-recipes-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.shared-recipe-card {
    background: var(--bg-white);
    padding: 20px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.shared-recipe-card:hover {
    box-shadow: var(--shadow-md);
}

.shared-recipe-card h4 {
    margin: 0 0 10px 0;
    color: var(--text-dark);
    font-size: 1.0625rem;
    font-weight: 600;
}

.shared-recipe-info {
    color: var(--text-light);
    font-size: 0.875rem;
    margin-bottom: 12px;
}

.permission-badge {
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 0.8125rem;
    font-weight: 600;
    display: inline-block;
    letter-spacing: 0.01em;
}

.permission-badge.can-edit {
    background: #d1fae5;
    color: #065f46;
}

.permission-badge.view-only {
    background: #dbeafe;
    color: #1e40af;
}

/* Empty State */
.empty-state {
    text-align: center;
    color: var(--text-light);
    padding: 48px 24px;
    font-size: 1.0625rem;
    line-height: 1.6;
}

/* Community/Public Recipes */
.recipes-grid-tier4 {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.recipe-card {
    background: var(--bg-white);
    border-radius: 12px;
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: transform 0.2s ease;
}

.recipe-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.1);
}

.recipe-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.recipe-content {
    padding: 20px;
}

.recipe-content h3 {
    margin: 0 0 10px 0;
    color: var(--text-color);
}

.recipe-author, .recipe-category {
    color: var(--text-light);
    font-size: 0.9em;
    margin: 5px 0;
}

/* Friends Activity Feed Cards */
.feed-activity-card {
    background: var(--bg-white);
    border-radius: 12px;
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: transform 0.2s ease;
    cursor: pointer;
    display: flex;
    flex-direction: column;
}

.feed-activity-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.1);
}

.feed-recipe-image {
    width: 100%;
    height: 200px;
    background-size: cover;
    background-position: center;
    position: relative;
}

.feed-recipe-category {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-primary);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.feed-recipe-content {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.feed-recipe-header {
    display: flex;
    align-items: center;
    gap: 10px;
}

.feed-recipe-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.feed-recipe-author {
    font-size: 0.9rem;
    color: var(--text-primary);
    font-weight: 500;
}

.feed-recipe-time {
    font-size: 0.8rem;
    color: var(--text-light);
}

.feed-recipe-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    line-height: 1.4;
}

.feed-activity-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    background: var(--bg-secondary);
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-primary);
    width: fit-content;
}

/* Pantry Styles */
.pantry-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.pantry-item-card {
    background: var(--bg-white);
    padding: 20px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.pantry-item-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
}

.pantry-item-card h4 {
    margin: 0 0 10px 0;
    color: var(--text-dark);
    font-size: 1.0625rem;
    font-weight: 600;
}

.pantry-item-card p {
    margin: 6px 0;
    color: var(--text-light);
    font-size: 0.875rem;
}

.expiring-items-alert {
    background: #fef3c7;
    border-left: 4px solid #f59e0b;
    padding: 16px 20px;
    margin-bottom: 24px;
    border-radius: var(--border-radius);
    color: #92400e;
    font-size: 0.9375rem;
    font-weight: 500;
}

/* Meal Planner Styles */
.meal-calendar {
    display: grid;
    gap: 15px;
    margin-top: 20px;
}

.meal-plan-item {
    background: var(--bg-white);
    padding: 20px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: var(--transition);
}

.meal-plan-item:hover {
    box-shadow: var(--shadow-md);
}

.meal-plan-item strong {
    color: var(--text-dark);
    font-size: 1.0625rem;
    font-weight: 600;
}

/* Leftovers Styles */
.leftovers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.leftover-card {
    background: var(--bg-white);
    padding: 20px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.leftover-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
}

.leftover-card strong {
    color: var(--text-dark);
    display: block;
    margin-bottom: 10px;
    font-size: 1.0625rem;
    font-weight: 600;
}

/* Rescue Styles */
.rescue-grid {
    display: grid;
    gap: 20px;
    margin-top: 20px;
}

.rescue-card {
    background: var(--bg-white);
    padding: 20px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.rescue-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
}

.rescue-card h4 {
    margin: 0 0 10px 0;
    color: var(--text-dark);
    font-size: 1.0625rem;
    font-weight: 600;
}

.rescue-card p {
    color: var(--text-light);
    margin: 6px 0;
    font-size: 0.875rem;
}

/* Responsive */
@media (max-width: 768px) {
    .tier4-nav {
        flex-wrap: nowrap;
        overflow-x: auto;
    }

    .tier4-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .friend-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .friend-actions {
        width: 100%;
        flex-wrap: wrap;
    }

    .shared-recipes-list {
        grid-template-columns: 1fr;
    }

    .recipes-grid-tier4,
    .pantry-grid,
    .leftovers-grid {
        grid-template-columns: 1fr;
    }

    /* Mobile header optimizations */
    .app-header {
        padding: 15px;
    }

    .header-actions {
        flex-direction: column;
        gap: 10px;
        width: 100%;
    }

    .header-actions .btn {
        width: 100%;
        justify-content: center;
    }

    .user-greeting {
        font-size: 0.875rem;
    }

    /* Mobile tier4-nav improvements */
    .tier4-nav {
        padding: 10px 15px;
        gap: 8px;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none; /* Firefox */
    }

    .tier4-nav::-webkit-scrollbar {
        display: none; /* Chrome, Safari */
    }

    .tier4-nav-link {
        padding: 8px 16px;
        font-size: 0.875rem;
        white-space: nowrap;
    }

    /* Mobile modal optimizations */
    .modal {
        padding: 10px;
    }

    .modal-content {
        max-width: 100%;
        max-height: 95vh;
    }

    .modal-header {
        padding: 20px 15px;
    }

    .modal-header h2 {
        font-size: 1.375rem;
    }

    #recipeForm,
    .modal-content form {
        padding: 20px 15px;
    }

    /* Mobile form improvements */
    .form-actions {
        flex-direction: column;
    }

    .form-actions .btn {
        width: 100%;
        padding: 14px;
        font-size: 1rem;
    }

    /* Mobile touch targets - minimum 44px */
    .btn {
        min-height: 44px;
        padding: 12px 20px;
    }

    .btn-sm {
        min-height: 40px;
        padding: 10px 16px;
    }

    /* Mobile tier4 content */
    .tier4-content {
        padding: 20px 15px;
    }

    .tier4-header h2 {
        font-size: 1.5rem;
    }

    .search-input {
        width: 100%;
        font-size: 16px; /* Prevents iOS zoom on focus */
    }

    /* Mobile friend cards */
    .friend-info h4 {
        font-size: 1.0625rem;
    }

    .friend-status {
        font-size: 0.8125rem;
        padding: 4px 12px;
    }

    /* Mobile recipe cards */
    .recipe-card {
        margin-bottom: 15px;
    }

    .recipe-image {
        height: 180px;
    }

    /* Mobile gamification widgets */
    .widget {
        margin-bottom: 20px;
    }

    .level-circle {
        width: 80px;
        height: 80px;
    }

    .level-number {
        font-size: 2em;
    }

    /* Mobile filter buttons */
    .filters {
        flex-wrap: wrap;
        gap: 8px;
    }

    .filter-btn {
        font-size: 0.85em;
        padding: 8px 14px;
    }

    /* Mobile calendar */
    .calendar-grid {
        gap: 3px;
    }

    .calendar-day {
        width: 32px;
        height: 32px;
        font-size: 0.85em;
    }
}

/* ========================================
   EXTRA SMALL MOBILE (Portrait phones)
   ======================================== */
@media (max-width: 480px) {
    /* Typography adjustments */
    .app-header h1 {
        font-size: 1.5rem;
    }

    .tagline {
        font-size: 0.8125rem;
    }

    .modal-header h2 {
        font-size: 1.125rem;
    }

    .tier4-header h2 {
        font-size: 1.25rem;
    }

    /* Tighter spacing */
    .tier4-content {
        padding: 15px 10px;
    }

    .modal-header,
    #recipeForm,
    .modal-content form {
        padding: 15px 12px;
    }

    /* Smaller touch targets acceptable on very small screens */
    .tier4-nav-link {
        padding: 6px 12px;
        font-size: 0.8125rem;
    }

    /* Friend cards more compact */
    .friend-card {
        padding: 15px;
    }

    .friend-info h4 {
        font-size: 1rem;
    }

    /* Recipe images smaller */
    .recipe-image {
        height: 150px;
    }

    /* Calendar more compact */
    .calendar-day {
        width: 28px;
        height: 28px;
        font-size: 0.75em;
    }

    /* Form inputs with better spacing */
    .form-group {
        margin-bottom: 20px;
    }

    input[type="text"],
    input[type="email"],
    input[type="url"],
    input[type="number"],
    input[type="date"],
    select,
    textarea {
        font-size: 16px; /* Prevents zoom on iOS */
    }
}

/* ========================================
   ACHIEVEMENT TOAST NOTIFICATIONS
   ======================================== */

.achievement-toast {
    position: fixed;
    top: 80px;
    right: -400px;
    min-width: 280px;
    max-width: 350px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    z-index: 10000;
    transition: right 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    backdrop-filter: blur(10px);
}

.achievement-toast.show {
    right: 20px;
}

.achievement-toast-content {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.achievement-toast-title {
    font-size: 1.2em;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.achievement-toast-message {
    font-size: 0.95em;
    opacity: 0.95;
    font-weight: 500;
}

/* Toast type variants */
.achievement-toast.xp-gain {
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-left: 4px solid #f093fb;
}

.achievement-toast.level-up {
    background: linear-gradient(135deg, #f093fb, #f5576c);
    border-left: 4px solid #ffd700;
    animation: pulse-glow 0.5s ease-in-out;
}

.achievement-toast.achievement {
    background: linear-gradient(135deg, #4facfe, #00f2fe);
    border-left: 4px solid #43e97b;
}

@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    }
    50% {
        box-shadow: 0 8px 32px rgba(255, 215, 0, 0.6);
    }
}

/* Dark mode adjustments */
[data-theme="dark"] .achievement-toast {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}

/* Mobile responsive */
@media (max-width: 768px) {
    .achievement-toast {
        top: 70px;
        min-width: 260px;
        max-width: calc(100% - 40px);
        padding: 16px;
        right: -350px;
    }

    .achievement-toast.show {
        right: 10px;
    }

    .achievement-toast-title {
        font-size: 1.1em;
    }

    .achievement-toast-message {
        font-size: 0.9em;
    }
}

/* ========================================
   GITHUB-STYLE STREAK CALENDAR
   ======================================== */

/* Monthly Calendar */
.monthly-calendar {
    padding: 16px;
    background: var(--bg-white);
    border-radius: 12px;
    border: 2px solid var(--border-color);
}

.monthly-calendar-header {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 16px;
    text-align: center;
}

.monthly-calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}

.calendar-day-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-medium);
    text-align: center;
    padding: 8px 4px;
    text-transform: uppercase;
}

.calendar-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: var(--text-dark);
    border-radius: 8px;
    background: var(--bg-light);
    font-weight: 500;
    transition: all 0.2s ease;
}

.calendar-day.empty {
    background: transparent;
}

.calendar-day.today {
    background: var(--primary-color);
    color: white;
    font-weight: 700;
}

.calendar-day.cooked {
    background: linear-gradient(135deg, var(--feed-primary), var(--feed-secondary));
    color: white;
    font-weight: 700;
    position: relative;
}

.calendar-day.cooked::after {
    content: '🔥';
    position: absolute;
    top: 2px;
    right: 2px;
    font-size: 10px;
}

.calendar-day.today.cooked {
    box-shadow: 0 0 0 2px var(--bg-white), 0 0 0 4px var(--primary-color);
}

/* Mobile responsive */
@media (max-width: 768px) {
    .monthly-calendar {
        padding: 12px;
    }

    .calendar-day {
        font-size: 12px;
    }

    .calendar-day-label {
        font-size: 10px;
        padding: 6px 2px;
    }

    .calendar-day.cooked::after {
        font-size: 8px;
    }
}

/* ========================================
   DIFFICULTY BADGES
   ======================================== */

.difficulty-easy {
    background: linear-gradient(135deg, #84fab0 0%, #8fd3f4 100%) !important;
    color: #000 !important;
    font-weight: 600;
}

.difficulty-medium {
    background: linear-gradient(135deg, #ffeaa7 0%, #fdcb6e 100%) !important;
    color: #000 !important;
    font-weight: 600;
}

.difficulty-hard {
    background: linear-gradient(135deg, #fd79a8 0%, #e17055 100%) !important;
    color: #fff !important;
    font-weight: 600;
}

.difficulty-expert {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%) !important;
    color: #fff !important;
    font-weight: 600;
    animation: pulse-difficulty 2s infinite;
}

@keyframes pulse-difficulty {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(231, 76, 60, 0.7);
    }
    50% {
        box-shadow: 0 0 0 6px rgba(231, 76, 60, 0);
    }
}

/* ========================================
   SKILL TREE
   ======================================== */

.skill-tree-container {
    display: flex;
    flex-direction: column;
    gap: 30px;
    padding: 20px;
    background: var(--bg-light);
    border-radius: 16px;
    overflow-x: auto;
}

.skill-tier {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
    position: relative;
}

.skill-tier[data-tier="1"] {
    gap: 30px;
}

.skill-node {
    width: 140px;
    padding: 16px;
    background: var(--card-bg);
    border: 3px solid var(--border-color);
    border-radius: 16px;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
}

.skill-node:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.skill-node.unlocked {
    border-color: var(--primary-color);
    background: linear-gradient(135deg, rgba(255, 107, 107, 0.05), rgba(255, 142, 83, 0.05));
}

.skill-node.locked {
    opacity: 0.5;
    border-color: var(--border-color);
    filter: grayscale(0.7);
}

.skill-node.locked:hover {
    opacity: 0.7;
    transform: translateY(-2px);
}

.skill-node-icon {
    font-size: 3rem;
    margin-bottom: 8px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.skill-node.locked .skill-node-icon {
    filter: grayscale(1) opacity(0.5);
}

.skill-node-level {
    position: absolute;
    top: 8px;
    right: 8px;
    background: var(--primary-color);
    color: white;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 700;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.skill-node.locked .skill-node-level {
    background: var(--text-light);
}

.skill-node-name {
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--text-dark);
    margin-bottom: 12px;
    line-height: 1.2;
}

.skill-node-progress {
    margin-top: 12px;
}

.skill-progress-bar {
    height: 8px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 6px;
}

.skill-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    border-radius: 10px;
    transition: width 0.5s ease;
}

.skill-xp-text {
    font-size: 0.7rem;
    color: var(--text-light);
    font-weight: 600;
}

.skill-node-locked-text {
    font-size: 0.7rem;
    color: var(--text-light);
    margin-top: 8px;
    line-height: 1.3;
}

.skill-tier-connector {
    height: 30px;
    width: 3px;
    background: linear-gradient(180deg, var(--primary-color), var(--border-color));
    margin: 0 auto;
    position: relative;
}

.skill-tier-connector::before,
.skill-tier-connector::after {
    content: '';
    position: absolute;
    width: 80px;
    height: 3px;
    background: var(--border-color);
    top: 0;
}

.skill-tier-connector::before {
    left: 3px;
    transform-origin: left;
    transform: rotate(30deg);
}

.skill-tier-connector::after {
    right: 3px;
    transform-origin: right;
    transform: rotate(-30deg);
}

/* Dark mode */
[data-theme="dark"] .skill-tree-container {
    background: var(--card-bg);
}

[data-theme="dark"] .skill-node {
    background: var(--bg-color);
    border-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .skill-node.unlocked {
    background: linear-gradient(135deg, rgba(255, 107, 107, 0.1), rgba(255, 142, 83, 0.1));
    border-color: var(--primary-color);
}

/* Mobile responsive */
@media (max-width: 768px) {
    .skill-tree-container {
        padding: 12px;
        gap: 20px;
    }

    .skill-node {
        width: 110px;
        padding: 12px;
    }

    .skill-node-icon {
        font-size: 2.2rem;
    }

    .skill-node-name {
        font-size: 0.8rem;
    }

    .skill-tier {
        gap: 12px;
    }

    .skill-tier-connector {
        height: 20px;
    }
}
