/**
 * Pinterest-Inspired Design System for Baking.ieasynote.com
 * Based on awesome-design-md/pinterest/DESIGN.md
 * Yii3 + Bootstrap 5
 */

/* ============================================
   CSS Custom Properties (Design Tokens)
   ============================================ */

:root {
    /* Brand Colors */
    --pinterest-red: #e60023;
    --pinterest-red-hover: #ad081b;
    
    /* Text Colors - Warm Plum Black Scale */
    --text-primary: #211922;
    --text-secondary: #62625b;
    --text-tertiary: #91918c;
    --text-black: #000000;
    --text-white: #ffffff;
    
    /* Surface Colors */
    --bg-primary: #ffffff;
    --bg-secondary: #e5e5e0;
    --bg-tertiary: #e0e0d9;
    --bg-warm-wash: hsla(60, 20%, 98%, 0.5);
    --bg-fog: #f6f6f3;
    --bg-dark: #33332e;
}

/* ============================================
   Dark Mode Theme
   ============================================ */

[data-theme="dark"] {
    /* Inverted Text Colors */
    --text-primary: #f7f8f8;
    --text-secondary: #d0d6e0;
    --text-tertiary: #8a8f98;
    --text-black: #ffffff;
    --text-white: #000000;
    
    /* Dark Surface Colors */
    --bg-primary: #0f1011;
    --bg-secondary: #191a1b;
    --bg-tertiary: #252525;
    --bg-warm-wash: hsla(0, 0%, 10%, 0.5);
    --bg-fog: #1f1f1f;
    --bg-dark: #08090a;
    
    /* Adjust brand for dark mode */
    --pinterest-red: #ff4757;
    --pinterest-red-hover: #ff6b7a;
}

/* System dark mode support */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --text-primary: #f7f8f8;
        --text-secondary: #d0d6e0;
        --text-tertiary: #8a8f98;
        --text-black: #ffffff;
        --text-white: #000000;
        
        --bg-primary: #0f1011;
        --bg-secondary: #191a1b;
        --bg-tertiary: #252525;
        --bg-warm-wash: hsla(0, 0%, 10%, 0.5);
        --bg-fog: #1f1f1f;
        --bg-dark: #08090a;
        
        --pinterest-red: #ff4757;
        --pinterest-red-hover: #ff6b7a;
    }
}

/* ============================================
   Interactive Colors
   ============================================ */
:root {
    --focus-blue: #435ee5;
    --link-blue: #2b48d4;
    
    /* Border Colors */
    --border-disabled: #c8c8c1;
    --border-hover: #bcbcb3;
    --border-input: #91918c;
    
    /* Border Radius Scale */
    --radius-sm: 12px;
    --radius-md: 16px;
    --radius-lg: 20px;
    --radius-xl: 28px;
    --radius-2xl: 32px;
    --radius-3xl: 40px;
    --radius-pill: 9999px;
    --radius-circle: 50%;
    
    /* Typography */
    --font-primary: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 
                    'Noto Sans SC', 'Microsoft YaHei', sans-serif;
    
    /* Font Sizes */
    --font-display: 70px;
    --font-section: 28px;
    --font-body: 16px;
    --font-caption: 14px;
    --font-small: 12px;
    
    /* Font Weights */
    --weight-light: 400;
    --weight-medium: 500;
    --weight-semibold: 600;
    --weight-bold: 700;
    
    /* Border Radius Scale */
    --radius-sm: 12px;
    --radius-md: 16px;
    --radius-lg: 20px;
    --radius-xl: 28px;
    --radius-2xl: 32px;
    --radius-3xl: 40px;
    --radius-pill: 9999px;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
}

/* ============================================
   Base Styles
   ============================================ */

body {
    font-family: var(--font-primary);
    font-size: var(--font-body);
    font-weight: var(--weight-light);
    line-height: 1.4;
    color: var(--text-primary);
    background-color: var(--bg-primary);
}

/* Navbar Spacer */
.navbar-spacer {
    height: 80px !important;
    min-height: 80px !important;
    display: block !important;
    clear: both;
    visibility: visible !important;
}

@media (max-width: 768px) {
    .navbar-spacer {
        height: 64px;
    }
}

@media (max-width: 576px) {
    .navbar-spacer {
        height: 56px;
    }
}

/* Main Content - Ensure it's below navbar */
.container.py-4 {
    position: relative;
    z-index: 1;
}

/* ============================================
   Typography
   ============================================ */

h1, h2, h3, h4, h5, h6 {
    font-weight: var(--weight-bold);
    line-height: 1.15;
    letter-spacing: -1.2px;
    color: var(--text-primary);
}

h1 { font-size: var(--font-display); }
h2 { font-size: var(--font-section); }
h3 { font-size: 24px; }
h4 { font-size: 20px; }

p { color: var(--text-secondary); }

a {
    color: var(--link-blue);
    text-decoration: none;
}

a:hover {
    color: var(--pinterest-red);
}

/* ============================================
   Buttons
   ============================================ */

.btn-primary {
    background-color: var(--pinterest-red);
    border-color: var(--pinterest-red);
    color: var(--text-black);
    font-weight: var(--weight-medium);
    border-radius: var(--radius-md);
    padding: 6px 14px;
    font-size: 12px;
}

.btn-primary:hover {
    background-color: var(--pinterest-red-hover);
    border-color: var(--pinterest-red-hover);
    color: var(--text-white);
}

.btn-secondary {
    background-color: var(--bg-secondary);
    border-color: var(--bg-secondary);
    color: var(--text-black);
    font-weight: var(--weight-medium);
    border-radius: var(--radius-md);
}

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

/* ============================================
   Cards
   ============================================ */

.card {
    border: none;
    border-radius: var(--radius-lg);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

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

.card-img-top {
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

/* ============================================
   Icon System - Sprite-based
   ============================================ */

.icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    fill: currentColor;
}

.icon-brand {
    width: 40px;
    height: 40px;
}

.icon-search {
    width: 20px;
    height: 20px;
}

.icon-create {
    width: 18px;
    height: 18px;
}

.icon-profile {
    width: 24px;
    height: 24px;
}

.icon-menu {
    width: 24px;
    height: 24px;
}

/* Theme Toggle - Segmented Control (Circular Buttons) */
.theme-mode-selector {
    display: flex;
    background-color: var(--bg-fog);
    border-radius: var(--radius-pill);
    padding: 4px;
    gap: 4px;
}

.theme-mode-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background-color: transparent;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.theme-mode-btn:hover {
    background-color: rgba(255, 255, 255, 0.15);
}

.theme-mode-btn.active {
    background-color: var(--bg-primary);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.theme-mode-btn .icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    color: var(--text-tertiary);
    transition: color 0.2s ease;
}

.theme-mode-btn.active .icon {
    color: var(--text-primary);
}

.theme-mode-btn:hover .icon {
    color: var(--text-primary) !important;
}

/* Tooltip for theme buttons */
.theme-mode-btn[title]:hover::after {
    content: attr(title);
    position: absolute;
    bottom: -30px;
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--bg-dark);
    color: var(--text-white);
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Dark mode tooltip adjustment */
[data-theme="dark"] .theme-mode-btn[title]:hover::after {
    background-color: var(--bg-primary);
    color: var(--text-primary);
}

/* Language Dropdown */
.nav-link.dropdown-toggle {
    background: none;
    border: none;
    padding: 10px 16px;
    border-radius: var(--radius-pill);
    cursor: pointer;
    transition: background-color 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.nav-link.dropdown-toggle:hover {
    background-color: var(--bg-fog);
}

.dropdown-menu {
    border: 1px solid var(--border-input);
    border-radius: var(--radius-lg);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    padding: 8px;
    min-width: 160px;
}

.dropdown-item {
    padding: 10px 16px;
    border-radius: var(--radius-md);
    font-size: 14px;
    color: var(--text-primary);
    transition: background-color 0.2s ease;
}

.dropdown-item:hover {
    background-color: var(--bg-fog);
}

.dropdown-item.active {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
}

/* Mobile icon sizes */
@media (max-width: 768px) {
    .icon-brand {
        width: 36px;
        height: 36px;
    }
}

@media (max-width: 576px) {
    .icon {
        width: 18px;
        height: 18px;
    }
    
    .icon-brand {
        width: 32px;
        height: 32px;
    }
}

/* ============================================
   Navigation - Pinterest Style
   ============================================ */

.pinterest-nav {
    background-color: var(--bg-primary) !important;
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.05);
    padding: 0;
    min-height: 80px;
    transition: box-shadow 0.2s ease;
}

.pinterest-nav.scrolled {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

/* Brand Logo */
.navbar-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    padding: 12px 16px;
    border-radius: var(--radius-pill);
    transition: background-color 0.2s ease;
}

.navbar-brand:hover {
    background-color: var(--bg-fog);
}

.brand-icon {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
}

.brand-text {
    font-size: 24px;
    font-weight: 700;
    color: var(--pinterest-red);
    letter-spacing: -0.5px;
}

/* Search Bar - Desktop */
.nav-search {
    max-width: 600px;
}

.search-container {
    position: relative;
    width: 100%;
    display: flex;
    align-items: center;
}

.search-container .icon-search {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    color: var(--text-tertiary);
    pointer-events: none;
    z-index: 10;
}

.search-input {
    width: 100%;
    height: 48px;
    padding: 0 16px 0 50px !important;
    border: 2px solid var(--border-input);
    border-radius: var(--radius-pill);
    font-size: 15px;
    background-color: var(--bg-fog);
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.search-input:focus {
    outline: none;
    background-color: var(--bg-primary);
    border-color: var(--focus-blue);
    box-shadow: 0 0 0 4px rgba(67, 94, 229, 0.15);
}

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

/* Cmd+K Shortcut Indicator */
.search-shortcut {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 12px;
    color: var(--text-tertiary);
    background: var(--bg-tertiary);
    padding: 2px 6px;
    border-radius: 6px;
    pointer-events: none;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

@media (max-width: 1312px) {
    .search-shortcut {
        display: none;
    }
}

/* Search Modal */
.search-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    align-items: flex-start;
    justify-content: center;
    padding-top: 100px;
    backdrop-filter: blur(4px);
}

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

.search-modal {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 720px;
    margin: 0 20px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
    overflow: hidden;
}

/* Desktop - Larger modal */
@media (min-width: 1024px) {
    .search-modal {
        max-width: 800px;
        margin: 0 auto;
    }
    
    .search-modal-header {
        padding: 24px 28px;
    }
    
    .search-modal-input {
        font-size: 20px;
    }
    
    .search-modal-body {
        padding: 28px;
    }
}

/* Mobile - Full width with small margins */
@media (max-width: 768px) {
    .search-modal-overlay {
        padding-top: 60px;
        padding: 20px;
        align-items: flex-start;
    }
    
    .search-modal {
        max-width: 100%;
        margin: 0;
        border-radius: var(--radius-md);
    }
    
    .search-modal-header {
        padding: 16px;
    }
    
    .search-modal-input {
        font-size: 16px;  /* Prevent zoom on iOS */
    }
    
    .search-modal-body {
        padding: 20px;
        max-height: 60vh;
    }
    
    .suggestion-tag {
        font-size: 13px;
        padding: 6px 12px;
    }
}

.search-modal-header {
    display: flex;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid var(--border-disabled);
    gap: 12px;
}

.search-modal-header .icon-search {
    width: 24px;
    height: 24px;
    color: var(--text-tertiary);
    flex-shrink: 0;
}

.search-modal-input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 18px;
    background: transparent;
    color: var(--text-primary);
    padding: 8px 12px;
    margin: -8px -12px;
    border-radius: var(--radius-md);
}

.search-modal-input:focus {
    outline: none;
    background: var(--bg-fog);
}

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

.search-modal-close {
    background: var(--bg-secondary);
    border: none;
    border-radius: var(--radius-circle);
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.search-modal-close:hover {
    background: var(--bg-tertiary);
}

.search-modal-close .icon {
    width: 18px;
    height: 18px;
    color: var(--text-secondary);
}

.search-modal-body {
    padding: 20px;
    max-height: 400px;
    overflow-y: auto;
}

.search-suggestions {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.suggestion-category {
    display: flex;
    flex-direction: column;
}

.suggestion-category h4 {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-secondary);
    margin-bottom: 16px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.suggestion-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.suggestion-item {
    text-decoration: none;
    color: var(--text-primary);
    transition: all 0.2s ease;
}

.suggestion-tag {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    text-decoration: none;
    color: var(--text-primary);
    font-size: 15px;
    transition: all 0.2s ease;
}

.suggestion-tag .icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.suggestion-tag .icon-sm {
    width: 18px;
    height: 18px;
}

.suggestion-link .icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.suggestion-tag:hover {
    background: var(--bg-fog);
    color: var(--pinterest-red);
    transform: translateX(4px);
}

/* Desktop - Show suggestions in columns */
@media (min-width: 768px) {
    .search-suggestions {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 28px;
    }
}



.suggestion-links {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.suggestion-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    text-decoration: none;
    color: var(--text-primary);
    font-size: 15px;
    transition: all 0.2s ease;
}

.suggestion-link:hover {
    background: var(--bg-fog);
    color: var(--pinterest-red);
    transform: translateX(4px);
}

/* Selected state for keyboard navigation */
.suggestion-tag.selected,
.suggestion-link.selected {
    background: var(--bg-fog) !important;
    color: var(--pinterest-red) !important;
    outline: 2px solid var(--focus-blue);
    outline-offset: -2px;
}

/* Search Modal Footer */
.search-modal-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    border-top: 1px solid var(--border-disabled);
    background: var(--bg-fog);
    font-size: 12px;
    color: var(--text-secondary);
}

.keyboard-hints {
    display: flex;
    gap: 16px;
}

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

kbd {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    font-size: 11px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-weight: 500;
    color: var(--text-secondary);
    background: var(--bg-primary);
    border: 1px solid var(--border-disabled);
    border-radius: 4px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.search-attribution {
    display: flex;
    align-items: center;
    gap: 4px;
}

.sphinx-link {
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s ease;
}

.sphinx-link:hover {
    color: var(--pinterest-red);
    text-decoration: underline;
}

/* Mobile footer */
@media (max-width: 768px) {
    .search-modal-footer {
        flex-direction: column;
        gap: 8px;
        padding: 10px 16px;
    }
    
    .keyboard-hints {
        gap: 12px;
    }
    
    .search-attribution {
        font-size: 11px;
    }
}

/* Dark mode adjustments */
[data-theme="dark"] .search-modal-overlay {
    background: rgba(0, 0, 0, 0.7);
}

/* Mobile Search Button */
.mobile-search-btn {
    background: none;
    border: none;
    padding: 8px;
    margin-right: 8px;
    cursor: pointer;
    border-radius: var(--radius-pill);
    transition: background-color 0.2s ease;
}

.mobile-search-btn:hover {
    background-color: var(--bg-fog);
}

.mobile-search-btn svg {
    width: 24px;
    height: 24px;
    color: var(--text-primary);
}

/* Navigation Links */
.navbar-nav {
    gap: 4px;
}

.nav-item {
    list-style: none;
}

/* Nav links inside pinterest-nav - Increased specificity */
.pinterest-nav .navbar-nav .nav-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px !important;  /* !important to override Bootstrap */
    font-size: 15px;
    font-weight: 500;
    color: var(--text-primary) !important;
    text-decoration: none;
    border-radius: var(--radius-pill);
    transition: all 0.2s ease;
    white-space: nowrap;
}

.nav-link:hover {
    background-color: var(--bg-fog);
    color: var(--text-primary) !important;
}

.nav-link.active {
    background-color: var(--bg-secondary);
    color: var(--text-primary) !important;
}

/* Create Button */
/* Create button - Increased specificity */
.pinterest-nav .btn-create {
    display: flex;
    align-items: center;
    gap: 8px;
    background-color: var(--pinterest-red);
    color: var(--text-black) !important;
    padding: 10px 24px !important;  /* !important to override Bootstrap */
    border-radius: var(--radius-pill);
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    min-height: 44px;
    white-space: nowrap;
}

.btn-create:hover {
    background-color: var(--pinterest-red-hover);
    color: var(--text-white) !important;
    transform: translateY(-1px);
}

.btn-create .nav-icon {
    width: 18px;
    height: 18px;
}

/* Profile Avatar */
.profile-link {
    padding: 4px !important;
    border-radius: var(--radius-circle);
}

.profile-link:hover {
    background-color: var(--bg-fog) !important;
}

/* Profile Avatar - Circular Button Style */
.profile-link {
    padding: 10px !important;
    border-radius: var(--radius-pill) !important;
    transition: background-color 0.2s ease;
}

.profile-link:hover {
    background-color: var(--bg-fog) !important;
}

.profile-avatar {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-circle);
    background-color: var(--bg-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    transition: all 0.2s ease;
    font-weight: 700;
    font-size: 18px;
    color: var(--text-primary);
    text-transform: uppercase;
}

.profile-avatar.user-avatar {
    background: linear-gradient(135deg, #e60023 0%, #ad081b 100%);
    color: #ffffff;
}

.username-text {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary);
    margin-left: 8px;
}

.profile-link:hover .profile-avatar {
    background-color: var(--bg-fog);
}

.profile-link:hover .profile-avatar.user-avatar {
    background: linear-gradient(135deg, #ad081b 0%, #8f0617 100%);
}

.profile-avatar svg {
    width: 20px;
    height: 20px;
    color: var(--text-tertiary);
    transition: color 0.2s ease;
}

.profile-link:hover .profile-avatar svg {
    color: var(--text-primary);
}

/* Navbar Toggler (Mobile) */
.navbar-toggler {
    border: none;
    padding: 8px 12px;
    border-radius: var(--radius-md);
    background-color: transparent;
    transition: background-color 0.2s ease;
}

.navbar-toggler:hover {
    background-color: var(--bg-fog);
}

.navbar-toggler:focus {
    box-shadow: 0 0 0 3px rgba(67, 94, 229, 0.3);
}

.navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba(33, 25, 34, 1)' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
    width: 24px;
    height: 24px;
}

/* Mobile Navigation Styles */
@media (max-width: 768px) {
    .pinterest-nav {
        min-height: 64px;
    }
    
    .navbar-brand {
        padding: 8px 12px;
    }
    
    .brand-icon {
        width: 36px;
        height: 36px;
    }
    
    .brand-text {
        font-size: 20px;
    }
    
    .nav-search {
        display: none !important;
    }
    
    .mobile-search-btn {
        display: block !important;
    }
    
    .navbar-collapse {
        background-color: var(--bg-primary);
        padding: 16px;
        margin-top: 8px;
        border-radius: var(--radius-lg);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    }
    
    .navbar-nav {
        flex-direction: column;
        gap: 8px;
    }
    
    .nav-link {
        padding: 12px 20px;
        font-size: 16px;
    }
    
    .btn-create {
        width: 100%;
        justify-content: center;
        margin-top: 8px;
        padding: 12px 24px;
    }
    
    .profile-link {
        align-self: flex-start;
        margin-top: 8px;
    }
    
    .nav-item.ms-md-2 {
        margin-left: 0 !important;
    }
}

/* Small Mobile */
@media (max-width: 576px) {
    .pinterest-nav {
        min-height: 56px;
    }
    
    .brand-icon {
        width: 32px;
        height: 32px;
    }
    
    .brand-text {
        font-size: 18px;
    }
    
    .nav-link span,
    .btn-create span {
        display: none;
    }
    
    .nav-link {
        justify-content: center;
        padding: 10px;
    }
    
    .btn-create {
        padding: 10px 16px;
        min-width: 44px;
    }
    
    .profile-avatar {
        width: 36px;
        height: 36px;
    }
}

/* ============================================
   Forms
   ============================================ */

.form-control {
    border-radius: var(--radius-md);
    border: 1px solid var(--border-input);
    padding: 11px 15px;
}

.form-control:focus {
    border-color: var(--focus-blue);
    box-shadow: 0 0 0 4px rgba(67, 94, 229, 0.2);
}

/* ============================================
   Masonry Grid
   ============================================ */

.masonry-grid {
    column-count: 5;
    column-gap: 16px;
}

@media (max-width: 1680px) { .masonry-grid { column-count: 4; } }
@media (max-width: 1312px) { .masonry-grid { column-count: 3; } }
@media (max-width: 890px) { .masonry-grid { column-count: 2; } }
@media (max-width: 576px) { .masonry-grid { column-count: 1; } }

.masonry-item {
    break-inside: avoid;
    margin-bottom: 16px;
}

/* ============================================
   Footer - Pinterest Style
   ============================================ */

.footer {
    background-color: var(--bg-dark);
    color: var(--text-tertiary);
    padding: 64px 0 32px;
    width: 100%;
    margin: 0;
}

/* Footer Main Content */
.footer-main {
    margin-bottom: 48px;
}

/* Footer Brand */
.footer-brand {
    max-width: 320px;
}

.footer-logo {
    margin-bottom: 20px;
}

.footer-logo .icon-brand {
    width: 64px;
    height: 64px;
}

.footer-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-white);
    margin-bottom: 16px;
    letter-spacing: -0.5px;
}

.footer-description {
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-tertiary);
    margin-bottom: 24px;
}

/* Footer Social Links */
.footer-social {
    display: flex;
    gap: 12px;
}

.social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    color: var(--text-tertiary);
    transition: all 0.2s ease;
}

.social-link:hover {
    background-color: var(--pinterest-red);
    color: var(--text-white);
    transform: translateY(-2px);
}

.social-link svg {
    width: 20px;
    height: 20px;
}

/* Footer Headings */
.footer-heading {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-white);
    margin-bottom: 20px;
    letter-spacing: -0.3px;
}

/* Footer Links */
.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-links li {
    margin-bottom: 12px;
}

.footer-links a {
    color: var(--text-tertiary);
    text-decoration: none;
    font-size: 14px;
    transition: color 0.2s ease;
    display: inline-block;
}

.footer-links a:hover {
    color: var(--text-white);
}

/* Footer Divider */
.footer-divider {
    height: 1px;
    background-color: rgba(255, 255, 255, 0.1);
    margin: 0 0 32px;
}

/* Footer Bottom */
.footer-bottom {
    font-size: 13px;
}

.footer-copyright {
    margin: 0;
    color: var(--text-tertiary);
}

.footer-made-with {
    margin: 0;
    color: var(--text-tertiary);
}

/* Responsive Footer */
@media (max-width: 992px) {
    .footer {
        padding: 48px 0 24px;
        margin-top: 64px;
    }
    
    .footer-brand {
        max-width: 100%;
    }
}

@media (max-width: 768px) {
    .footer {
        padding: 40px 0 20px;
        margin-top: 48px;
    }
    
    .footer-logo .icon-brand {
        width: 56px;
        height: 56px;
    }
    
    .footer-title {
        font-size: 20px;
    }
    
    .footer-main {
        margin-bottom: 32px;
    }
    
    .footer-heading {
        font-size: 15px;
    }
}

@media (max-width: 576px) {
    .footer {
        padding: 32px 0 16px;
        margin-top: 40px;
    }
    
    .footer-logo .icon-brand {
        width: 48px;
        height: 48px;
    }
    
    .footer-title {
        font-size: 18px;
    }
    
    .footer-description {
        font-size: 13px;
    }
    
    .footer-social {
        gap: 8px;
    }
    
    .social-link {
        width: 36px;
        height: 36px;
    }
    
    .footer-bottom {
        text-align: center !important;
    }
    
    .footer-copyright,
    .footer-made-with {
        text-align: center !important;
    }
}

/* ============================================
   Utilities
   ============================================ */

.text-pinterest { color: var(--pinterest-red) !important; }
.bg-pinterest { background-color: var(--pinterest-red) !important; }
.rounded-pinterest { border-radius: var(--radius-lg); }

/* ============================================
   Pinterest Mobile Responsive Breakpoints
   Based on awesome-design-md/pinterest/DESIGN.md
   ============================================ */

/* Ultra-wide (>1680px) - Maximum grid density */
@media (min-width: 1681px) {
    .masonry-grid {
        column-count: 6;
    }
}

/* Large Desktop (1440-1680px) */
@media (min-width: 1440px) and (max-width: 1680px) {
    .masonry-grid {
        column-count: 5;
    }
}

/* Desktop (1312-1440px) */
@media (min-width: 1312px) and (max-width: 1440px) {
    .masonry-grid {
        column-count: 5;
    }
}

/* Desktop Small (890-1312px) */
@media (min-width: 890px) and (max-width: 1312px) {
    .masonry-grid {
        column-count: 4;
    }
    
    :root {
        --font-display: 64px;
        --font-section: 26px;
    }
}

/* Tablet (768-890px) */
@media (min-width: 768px) and (max-width: 890px) {
    .masonry-grid {
        column-count: 3;
    }
    
    :root {
        --font-display: 56px;
        --font-section: 24px;
    }
    
    .hero-section {
        padding: 60px 32px;
    }
    
    .container {
        padding-left: 24px;
        padding-right: 24px;
    }
}

/* Mobile Large (576-768px) */
@media (max-width: 768px) {
    .masonry-grid {
        column-count: 2;
    }
    
    :root {
        --font-display: 48px;
        --font-section: 22px;
        --font-body: 15px;
    }
    
    h1 { font-size: 48px; }
    h2 { font-size: 22px; }
    
    .hero-section {
        padding: 48px 24px;
        border-radius: 32px;
        margin-bottom: 40px;
    }
    
    .hero-title {
        font-size: 48px !important;
    }
    
    .category-title {
        font-size: 24px !important;
    }
    
    .navbar-brand {
        font-size: 20px;
    }
    
    .container {
        padding-left: 20px;
        padding-right: 20px;
    }
}

/* ============================================
   Home Page - Desktop Styles
   ============================================ */

/* Category Pills */
.category-section {
    margin-bottom: 64px;
}

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

.category-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.category-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--bg-fog);
    padding: 12px 20px;
    border-radius: var(--radius-pill);
    text-decoration: none;
    color: var(--text-primary);
    font-size: 15px;
    font-weight: 500;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.category-pill:hover {
    background: var(--bg-secondary);
    color: var(--pinterest-red);
    transform: translateY(-2px);
}

/* Recipe Cards */
.recipe-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}

.recipe-card {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all 0.3s ease;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    display: block;
}

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

.recipe-card-img {
    width: 100%;
    height: 240px;
    background: linear-gradient(135deg, #f6f6f3 0%, #e5e5e0 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 80px;
}

.recipe-card-body {
    padding: 16px;
}

.recipe-card-title {
    font-size: 17px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 12px 0;
    line-height: 1.4;
}

.recipe-card-meta {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: var(--text-secondary);
}

/* Pinterest Button */
.btn-pinterest {
    background-color: var(--pinterest-red);
    color: #000000;
    padding: 14px 32px;
    border-radius: var(--radius-pill);
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
}

.btn-pinterest:hover {
    background-color: var(--pinterest-red-hover);
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(230, 0, 35, 0.3);
}

.btn-pinterest.btn-lg {
    padding: 16px 40px;
    font-size: 18px;
}

/* Mobile (<576px) - Pinterest Mobile */
@media (max-width: 576px) {
    .masonry-grid {
        column-count: 1;
    }
    
    :root {
        --font-display: 36px;
        --font-section: 20px;
        --font-body: 14px;
        --radius-lg: 16px;
        --radius-xl: 24px;
        --radius-2xl: 28px;
        --radius-3xl: 32px;
    }
    
    body {
        font-size: 14px;
    }
    
    h1 { font-size: 36px !important; }
    h2 { font-size: 20px !important; }
    h3 { font-size: 18px; }
    
    /* Hero Section - Mobile */
    .hero-section {
        padding: 32px 16px;
        border-radius: 24px;
        margin-bottom: 32px;
    }
    
    .hero-title {
        font-size: 36px !important;
        letter-spacing: -1px;
    }
    
    .hero-subtitle {
        font-size: 15px;
        padding: 0 8px;
    }
    
    /* Search Box - Mobile */
    .search-box {
        max-width: 100%;
    }
    
    .input-group-lg .form-control {
        font-size: 14px;
        padding: 12px 16px;
    }
    
    .input-group-lg .btn {
        padding: 12px 20px;
        font-size: 13px;
    }
    
    /* Category Pills - Mobile */
    .category-pill {
        font-size: 12px;
        padding: 5px 10px;
        margin: 3px;
    }
    
    .category-title {
        font-size: 20px !important;
    }
    
    .category-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    /* Recipe Cards - Mobile */
    .recipe-card-img {
        height: 180px;
        font-size: 40px;
    }
    
    .recipe-card-title {
        font-size: 15px;
    }
    
    .recipe-card-meta {
        font-size: 12px;
        gap: 8px;
    }
    
    .recipe-card-body {
        padding: 12px;
    }
    
    /* Buttons - Mobile (Touch-friendly) */
    .btn-pinterest {
        width: 100%;
        padding: 14px 24px;
        font-size: 14px;
        min-height: 48px; /* Pinterest touch target */
    }
    
    .btn {
        padding: 10px 18px;
        font-size: 13px;
        min-height: 44px;
    }
    
    .form-control {
        padding: 11px 14px;
        font-size: 14px;
        min-height: 44px;
    }
    
    /* Navigation - Mobile */
    .navbar-brand {
        font-size: 18px;
    }
    
    /* Stats Cards - Stack on Mobile */
    .col-md-4 {
        margin-bottom: 16px !important;
    }
    
    [style*="font-size: 48px"] {
        font-size: 36px !important;
    }
    
    [style*="padding: 32px"] {
        padding: 20px !important;
    }
    
    /* Border Radius - Adjusted for Mobile */
    .card,
    .recipe-card {
        border-radius: 16px;
    }
    
    .container {
        padding-left: 16px;
        padding-right: 16px;
    }
}

/* Small Mobile (<375px) - Extra Compact */
@media (max-width: 375px) {
    :root {
        --font-display: 28px;
        --font-section: 18px;
    }
    
    h1 { font-size: 28px !important; }
    h2 { font-size: 18px !important; }
    
    .hero-section {
        padding: 24px 12px;
        border-radius: 20px;
    }
    
    .hero-title {
        font-size: 28px !important;
    }
    
    .hero-subtitle {
        font-size: 13px;
    }
    
    .recipe-card-img {
        height: 150px;
        font-size: 32px;
    }
    
    .category-pill {
        font-size: 11px;
        padding: 4px 8px;
    }
}
