/* Nordic/Scandinavian Design - Minimal, Clean, Functional */
:root {
    --primary: #2C3E50;
    --secondary: #E63946;
    --accent: #E63946;
    --background: #FFFFFF;
    --surface: #F8F9FA;
    --border: #E9ECEF;
    --text-primary: #2C3E50;
    --text-secondary: #7F8C8D;
    --success: #27AE60;
    --danger: #E74C3C;
    --shadow: rgba(0, 0, 0, 0.08);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-color: var(--background);
    color: var(--text-primary);
    line-height: 1.6;
    font-weight: 400;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 500;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-logo {
    display: flex;
    align-items: center;
}

.header-logo svg {
    display: block;
}

/* Header - Minimal and Clean */
.header {
    background: #2d3436;
    border-bottom: 1px solid #2d3436;
    padding: 12px 0;
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

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

.logo {
    font-size: 24px;
    font-weight: 500;
    color: #ffffff;
    letter-spacing: -0.02em;
}

.nav {
    display: flex;
    gap: 8px;
}

.nav-btn {
    background: transparent;
    color: #ffffff;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 15px;
    transition: all 0.2s ease;
    font-weight: 400;
}

.nav-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    background: transparent;
    border: none;
    color: #ffffff;
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
    transition: background 0.2s ease;
}

.mobile-menu-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
}

.mobile-menu-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 998;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mobile-menu-overlay.active {
    display: block;
    opacity: 1;
}

.nav-btn.active {
    background: #E63946;
    color: white;
}

/* Main Content */
.main-content {
    padding: 48px 0;
    min-height: calc(100vh - 200px);
}

.section-title {
    font-size: 32px;
    font-weight: 500;
    margin-bottom: 32px;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

/* Views */
.view {
    display: none;
}

.view.active {
    display: block;
}

/* Search and Filter Bar */
.search-filter-bar {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 24px;
}

.search-box-container {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 16px;
}

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

.toggle-filters-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
    min-width: 44px;
    transition: all 0.2s ease;
}

.toggle-filters-btn:hover {
    background: var(--border);
}

.toggle-filters-btn.active {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

.toggle-filters-btn svg {
    flex-shrink: 0;
}

.search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
}

.search-box input {
    width: 100%;
    padding: 12px 40px 12px 44px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 15px;
    font-family: 'Inter', sans-serif;
    transition: border-color 0.2s ease;
    background: var(--background);
}

.search-box input:focus {
    outline: none;
    border-color: var(--accent);
}

.clear-search-btn {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 24px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.clear-search-btn:hover {
    background: var(--border);
    color: var(--text-primary);
}

.filter-controls {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    align-items: end;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.filter-group label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
}

.filter-group input,
.filter-group select {
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 14px;
    font-family: 'Inter', sans-serif;
    background: var(--background);
    transition: border-color 0.2s ease;
}

.filter-group input:focus,
.filter-group select:focus {
    outline: none;
    border-color: var(--accent);
}

#reset-filters {
    padding: 10px 16px;
    font-size: 14px;
    white-space: nowrap;
}

.filter-summary {
    background: var(--accent);
    color: white;
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 16px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-summary strong {
    font-weight: 600;
}

/* Recipes Grid - Clean Card Layout */
.recipes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
    margin-top: 32px;
}

.recipe-card {
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.2s ease;
    cursor: pointer;
}

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

.recipe-card-image {
    width: 100%;
    height: 220px;
    object-fit: cover;
    background: var(--surface);
}

.recipe-card-content {
    padding: 20px;
}

.recipe-card-title {
    font-size: 20px;
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.recipe-card-description {
    color: var(--text-secondary);
    margin-bottom: 16px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: 14px;
    line-height: 1.5;
}

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

.recipe-card-actions {
    display: flex;
    gap: 8px;
}

/* Recipe Form - Clean and Spacious */
.recipe-form {
    background: var(--background);
    padding: 32px;
    border: 1px solid var(--border);
    border-radius: 8px;
    max-width: 800px;
    margin: 0 auto;
}

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

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-primary);
    font-size: 14px;
}

.form-group input[type="text"],
.form-group input[type="number"],
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 15px;
    font-family: 'Inter', sans-serif;
    transition: border-color 0.2s ease;
    background: var(--background);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent);
}

.form-group input[type="file"] {
    padding: 8px;
    font-size: 14px;
}

/* Ingredients List with Autocomplete */
.ingredients-list {
    margin-bottom: 16px;
}

.ingredient-item {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr auto;
    gap: 8px;
    margin-bottom: 8px;
    align-items: center;
}

.ingredient-item input,
.ingredient-item select {
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 14px;
    background: var(--background);
    font-family: 'Inter', sans-serif;
}

.ingredient-item select {
    cursor: pointer;
}

.ingredient-item button {
    padding: 10px;
    background: transparent;
    color: var(--danger);
    border: 1px solid var(--border);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 18px;
    line-height: 1;
}

.ingredient-item button:hover {
    background: var(--danger);
    color: white;
    border-color: var(--danger);
}

/* Buttons - Minimal Nordic Style */
.btn-primary,
.btn-secondary,
.btn-danger,
.btn-back {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
    font-family: 'Inter', sans-serif;
}

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

.btn-primary:hover {
    background: #1a252f;
}

.btn-secondary {
    background: var(--surface);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

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

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-danger:hover {
    background: #c0392b;
}

.btn-back {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border);
    margin-bottom: 24px;
}

.btn-back:hover {
    background: var(--surface);
}

.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 32px;
}

/* Recipe Detail - Clean Layout */
.recipe-detail {
    background: var(--background);
    padding: 32px;
    border: 1px solid var(--border);
    border-radius: 8px;
}

.recipe-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 24px;
    gap: 16px;
}

.recipe-detail-title {
    font-size: 36px;
    font-weight: 500;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.recipe-detail-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.recipe-detail-image {
    width: 100%;
    max-height: 400px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 32px;
}

.recipe-detail-meta {
    display: flex;
    gap: 32px;
    margin-bottom: 32px;
    padding: 20px;
    background: var(--surface);
    border-radius: 8px;
}

.meta-item {
    display: flex;
    flex-direction: column;
}

.meta-label {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.meta-value {
    font-size: 20px;
    font-weight: 500;
    color: var(--text-primary);
}

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

.recipe-section h3 {
    font-size: 24px;
    font-weight: 500;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.ingredients-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 8px;
}

.ingredient-line {
    padding: 12px;
    background: var(--surface);
    border-radius: 6px;
    font-size: 15px;
}

.instructions-text {
    white-space: pre-wrap;
    line-height: 1.8;
    font-size: 15px;
}

.story-text {
    font-style: italic;
    background: var(--surface);
    padding: 20px;
    border-radius: 8px;
    border-left: 3px solid var(--accent);
    line-height: 1.8;
    color: var(--text-secondary);
}

/* Shopping List - Clean and Functional */
.add-shopping-item-form {
    background: var(--surface);
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 24px;
    border: 1px solid var(--border);
}

.add-shopping-item-form h3 {
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.add-shopping-item-form .form-row {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.add-shopping-item-form .form-group {
    position: relative;
}

.add-shopping-item-form input,
.add-shopping-item-form select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    background: var(--background);
    transition: border-color 0.2s;
}

.add-shopping-item-form input:focus,
.add-shopping-item-form select:focus {
    outline: none;
    border-color: var(--accent);
}

.add-shopping-item-form select {
    cursor: pointer;
}

.shopping-list-actions {
    margin-bottom: 16px;
    text-align: right;
}

.shopping-list {
    background: var(--background);
    padding: 24px;
    border: 1px solid var(--border);
    border-radius: 8px;
}

.shopping-list-empty {
    text-align: center;
    padding: 48px;
    color: var(--text-secondary);
}

.shopping-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 0;
    border-bottom: 1px solid var(--border);
}

.shopping-item:last-child {
    border-bottom: none;
}

.shopping-item-info {
    flex: 1;
}

.shopping-item-name {
    font-weight: 500;
    color: var(--text-primary);
    font-size: 15px;
    margin-bottom: 4px;
}

.shopping-item-amount {
    color: var(--text-secondary);
    font-size: 14px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.shopping-item-amount:hover {
    background-color: var(--surface);
}

.shopping-item-recipe {
    font-size: 13px;
    color: var(--accent);
    margin-top: 4px;
}

/* Old shopping-item-remove styles removed - using icon button styles instead */

/* Image Preview */
.image-preview {
    margin-top: 16px;
}

.image-preview img {
    max-width: 300px;
    border-radius: 8px;
    border: 1px solid var(--border);
}

/* Footer - Minimal */
.footer {
    background: var(--surface);
    border-top: 1px solid var(--border);
    text-align: center;
    padding: 32px 0;
    margin-top: 64px;
    color: var(--text-secondary);
    font-size: 14px;
}

/* Responsive Design */
@media (max-width: 900px) {
    /* Remove old desktop nav styles on mobile */
    .header .container {
        flex-direction: row;
    }

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

    .ingredient-item {
        grid-template-columns: 1fr;
    }

    .recipe-detail-header {
        flex-direction: column;
    }

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

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

    .form-actions button {
        width: 100%;
    }

    .recipe-form {
        padding: 24px;
    }

    .section-title {
        font-size: 28px;
        padding-left: 16px;
        padding-right: 16px;
    }
    
    /* Mobile Header */
    .header-container {
        position: relative;
    }
    
    .header-right {
        gap: 0;
    }
    
    .mobile-menu-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .nav {
        position: fixed;
        top: 0;
        right: -280px;
        width: 280px;
        height: 100vh;
        background: url('tablecloth.jpeg') repeat top left;
        background-size: 850px auto;
        display: flex;
        flex-direction: column;
        gap: 0;
        padding: 80px 0 0 0;
        box-shadow: -4px 0 12px rgba(0, 0, 0, 0.1);
        z-index: 999;
        transition: right 0.3s ease;
        overflow-y: auto;
    }
    
    .nav.active {
        right: 0;
    }
    
    .nav-btn {
        width: 100%;
        text-align: left;
        padding: 16px 24px;
        border-radius: 0;
        font-size: 16px;
        border-bottom: 1px solid var(--border);
        background: white;
        color: var(--text-primary);
    }
    
    .nav-btn.active {
        background: #E63946;
        color: white;
        font-weight: 500;
        border-bottom-color: #D62839;
    }
    
    .nav-btn:hover {
        background: rgba(255, 255, 255, 0.9);
    }
    
    /* Mobile User Profile - Move to bottom of hamburger menu */
    .header-right > .user-profile {
        display: none !important; /* Hide desktop profile on mobile */
    }
    
    .mobile-user-profile {
        display: block;
        margin-top: auto; /* Push to bottom */
        border-top: 2px solid var(--border);
        padding: 0;
        background: white;
    }
    
    .mobile-user-profile-header {
        padding: 16px 24px;
        border-bottom: 1px solid var(--border);
        background: white;
    }
    
    .mobile-user-profile-name {
        font-weight: 500;
        color: var(--text-primary);
        font-size: 16px;
        margin-bottom: 4px;
    }
    
    .mobile-user-profile-role {
        font-size: 14px;
        color: var(--text-secondary);
        text-transform: capitalize;
    }
    
    .mobile-user-profile-item {
        width: 100%;
        text-align: left;
        padding: 16px 24px;
        border: none;
        background: white;
        color: var(--text-primary);
        font-size: 16px;
        cursor: pointer;
        transition: background 0.2s ease;
        display: flex;
        align-items: center;
        gap: 12px;
        border-bottom: 1px solid var(--border);
    }
    
    .mobile-user-profile-item:hover {
        background: rgba(255, 255, 255, 0.9);
    }
    
    .mobile-user-profile-item svg {
        flex-shrink: 0;
    }
}

/* Mobile responsive for search/filter bar */
@media (max-width: 768px) {
    .search-filter-bar {
        padding: 16px;
    }
    
    .search-box-container {
        gap: 8px;
    }
    
    .filter-controls {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    #reset-filters {
        width: 100%;
    }
}

/* Hide mobile profile on desktop */
@media (min-width: 901px) {
    .mobile-user-profile {
        display: none !important;
    }
    
    /* Mobile Content Padding */
    .main-content {
        padding-top: 24px;
    }
    
    .view {
        padding: 0 16px;
    }
    
    /* Mobile Recipe Cards */
    .recipe-card {
        padding: 16px;
    }
    
    .recipe-card-title {
        font-size: 18px;
    }
    
    /* Mobile Buttons - Larger Touch Targets */
    .btn-primary, .btn-secondary, .btn-danger {
        min-height: 44px;
        font-size: 16px;
    }
    
    /* Mobile Form Inputs */
    input, textarea, select {
        font-size: 16px !important; /* Prevents zoom on iOS */
        min-height: 44px;
    }

/* Dropzone Styling */
.dropzone {
    border: 2px dashed var(--border);
    border-radius: 8px;
    padding: 48px 24px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    background: var(--surface);
}

.dropzone:hover {
    border-color: var(--accent);
    background: var(--background);
}

.dropzone.dragover {
    border-color: var(--accent);
    background: var(--light-blue);
}

.dropzone-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    color: var(--text-secondary);
}

.dropzone-content svg {
    color: var(--text-secondary);
}

.dropzone-content p {
    font-size: 15px;
    font-weight: 500;
    color: var(--text-primary);
    margin: 0;
}

.dropzone-hint {
    font-size: 13px;
    color: var(--text-secondary);
}

    .recipe-detail-title {
        font-size: 28px;
    }
}

/* Autocomplete Styling */
input[list]::-webkit-calendar-picker-indicator {
    display: none;
}

/* Made with Bob */

/* AI Import Styles */
.import-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
    margin: 32px 0;
}

.import-option-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 24px;
    text-align: center;
}

.import-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.import-option-card h3 {
    font-size: 20px;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.import-option-card p {
    color: var(--text-secondary);
    margin-bottom: 20px;
    font-size: 14px;
}

.import-input {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-family: inherit;
    font-size: 14px;
    margin-bottom: 12px;
    transition: border-color 0.2s;
}

.import-input:focus {
    outline: none;
    border-color: var(--accent);
}

.import-status {
    margin: 24px 0;
    padding: 16px;
    border-radius: 6px;
    display: none;
}

.import-status.loading {
    display: block;
    background: #E3F2FD;
    color: #1976D2;
    border: 1px solid #BBDEFB;
}

.import-status.success {
    display: block;
    background: #E8F5E9;
    color: #2E7D32;
    border: 1px solid #C8E6C9;
}

.import-status.error {
    display: block;
    background: #FFEBEE;
    color: #C62828;
    border: 1px solid #FFCDD2;
}

.import-preview {
    display: none;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 24px;
    margin-top: 24px;
}

.import-preview.active {
    display: block;
}

.import-preview h3 {
    margin-bottom: 16px;
    color: var(--text-primary);
}

.import-preview-section {
    margin-bottom: 20px;
}

.import-preview-section h4 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 8px;
}

.import-preview-ingredients {
    list-style: none;
    padding: 0;
}

.import-preview-ingredients li {
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
}

.import-preview-ingredients li:last-child {
    border-bottom: none;
}

.import-preview-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}

.photo-preview {
    margin-top: 12px;
    display: none;
    gap: 12px;
}

.photo-preview.active {
    display: flex;
    flex-wrap: wrap;
}

.photo-preview-item {
    position: relative;
    flex: 0 0 calc(50% - 6px);
    max-width: calc(50% - 6px);
}

.photo-preview-item img {
    width: 100%;
    max-height: 200px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid var(--border);
}

.photo-number {
    position: absolute;
    top: 8px;
    right: 8px;
    background: var(--primary);
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.photo-remove-btn {
    position: absolute;
    top: 8px;
    left: 8px;
    background: var(--danger);
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: background 0.2s ease;
    line-height: 1;
    padding: 0;
}

.photo-remove-btn:hover {
    background: #c0392b;
}

/* Single image - full width */
.photo-preview-item:only-child {
    flex: 0 0 100%;
    max-width: 100%;
}

.photo-preview-item:only-child img {
    max-height: 300px;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.loading-spinner {
    background: white;
    padding: 40px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.spinner {
    width: 50px;
    height: 50px;
    margin: 0 auto 20px;
    border: 4px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-spinner p {
    margin: 0;
    color: var(--text-primary);
    font-size: 16px;
    font-weight: 500;
}

/* Image Gallery Styles */
.image-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
    margin-top: 16px;
}

.gallery-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid var(--border);
    cursor: pointer;
    transition: all 0.2s ease;
}

.gallery-item:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--shadow);
}

.gallery-item.display-image {
    border-color: var(--success);
    border-width: 3px;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gallery-item-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    opacity: 0;
    transition: opacity 0.2s ease;
    padding: 8px;
}

.gallery-item:hover .gallery-item-overlay {
    opacity: 1;
}

.gallery-item-btn {
    background: white;
    border: none;
    border-radius: 4px;
    padding: 8px 12px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
    max-width: 120px;
}

.gallery-item-btn:hover:not(:disabled) {
    transform: scale(1.05);
}

.gallery-item-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.gallery-item-btn.set-display {
    background: var(--success);
    color: white;
}

.gallery-item-btn.set-display:disabled {
    background: var(--secondary);
}

.gallery-item-btn.delete {
    background: var(--danger);
    color: white;
}

.display-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    background: var(--success);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
    z-index: 1;
}

.recipe-detail-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    margin: 24px 0;
}

.recipe-detail-gallery img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.recipe-detail-gallery img:hover {
    transform: scale(1.02);
}


/* Image Modal Styles */
.image-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s ease;
}

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

.image-modal-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.image-modal-img {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    animation: zoomIn 0.3s ease;
}

@keyframes zoomIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.image-modal-close {
    position: absolute;
    top: -40px;
    right: 0;
    color: white;
    font-size: 40px;
    font-weight: 300;
    cursor: pointer;
    transition: color 0.2s ease;
    line-height: 1;
    user-select: none;
}

.image-modal-close:hover,
.image-modal-close:focus {
    color: #ccc;
}

/* Make recipe detail gallery images clickable */
.recipe-detail-gallery img {
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.recipe-detail-gallery img:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}


/* Unit Conversion Modal Styles */
.conversion-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s ease;
}

.conversion-modal-content {
    background: white;
    border-radius: 12px;
    padding: 24px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    animation: slideUp 0.3s ease;
}

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

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

.conversion-modal-header h3 {
    margin: 0;
    font-size: 20px;
    color: var(--text-primary);
}

.conversion-modal-close {
    font-size: 28px;
    font-weight: 300;
    color: var(--text-secondary);
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s ease;
    user-select: none;
}

.conversion-modal-close:hover {
    color: var(--text-primary);
}

.conversion-current {
    background: var(--surface);
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 16px;
    font-weight: 500;
    color: var(--text-primary);
    text-align: center;
}

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

.conversion-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    background: white;
    border: 2px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.conversion-option:hover {
    border-color: var(--accent);
    background: var(--surface);
    transform: translateX(4px);
}

.conversion-amount {
    font-size: 16px;
    font-weight: 500;
    color: var(--text-primary);
}

.conversion-arrow {
    font-size: 20px;
    color: var(--accent);
}

/* Shopping List Item Actions */
.shopping-item-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.shopping-item-icon-btn {
    background: transparent;
    border: none;
    padding: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    color: var(--text-secondary);
    opacity: 0.5;
}

.shopping-item-icon-btn:hover {
    opacity: 1;
    transform: scale(1.15);
    color: var(--text-primary);
}


/* Pig Notification System Styles */
.pig-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    padding: 20px;
    max-width: 400px;
    z-index: 10001;
    transform: translateX(450px);
    transition: transform 0.3s ease;
}

.pig-notification-show {
    transform: translateX(0);
}

.pig-notification-content {
    display: flex;
    align-items: flex-start;
    gap: 16px;
}

.pig-notification-pig {
    flex-shrink: 0;
}

.pig-notification-icon {
    width: 60px;
    height: 60px;
    animation: pigBounce 0.6s ease;
}

@keyframes pigBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.pig-notification-text {
    flex: 1;
}

.pig-notification-pun {
    font-size: 16px;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 8px;
    font-style: italic;
}

.pig-notification-message {
    font-size: 14px;
    color: var(--text-secondary);
}

.pig-notification-close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-secondary);
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 24px;
    height: 24px;
    transition: color 0.2s ease;
}

.pig-notification-close:hover {
    color: var(--text-primary);
}

.pig-notification-error .pig-notification-pun {
    color: var(--danger);
}

/* Pig Confirmation Dialog Styles */
.pig-confirm-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10002;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.pig-confirm-show {
    opacity: 1;
}

.pig-confirm-dialog {
    background: white;
    border-radius: 20px;
    padding: 32px;
    max-width: 450px;
    width: 90%;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.2);
    text-align: center;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.pig-confirm-show .pig-confirm-dialog {
    transform: scale(1);
}

.pig-confirm-pig {
    margin-bottom: 20px;
}

.pig-confirm-icon {
    width: 100px;
    height: 100px;
    animation: pigWiggle 0.5s ease infinite alternate;
}

@keyframes pigWiggle {
    0% { transform: rotate(-5deg); }
    100% { transform: rotate(5deg); }
}

.pig-confirm-pun {
    font-size: 20px;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 16px;
    font-style: italic;
}

.pig-confirm-message {
    font-size: 16px;
    color: var(--text-secondary);
    margin-bottom: 24px;
    line-height: 1.5;
}

.pig-confirm-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.pig-confirm-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.pig-confirm-yes {
    background: var(--accent);
    color: white;
}

.pig-confirm-yes:hover {
    background: #2980B9;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

.pig-confirm-no {
    background: var(--surface);
    color: var(--text-primary);
}

.pig-confirm-no:hover {
    background: var(--border);
    transform: translateY(-2px);
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .pig-notification {
        right: 10px;
        left: 10px;
        max-width: none;
        transform: translateY(-120%);
    }
    
    .pig-notification-show {
        transform: translateY(0);
    }
    
    .pig-confirm-dialog {
        padding: 24px;
    }
    
    .pig-confirm-icon {
        width: 80px;
        height: 80px;
    }
}


/* Enhanced Shopping List Styles */
.shopping-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: white;
    border: 2px solid var(--border);
    border-radius: 12px;
    margin-bottom: 12px;
    transition: all 0.3s ease;
}

.shopping-item:hover {
    border-color: var(--accent);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

/* Checkbox Styles */
.shopping-item-checkbox-wrapper {
    position: relative;
    flex-shrink: 0;
}

.shopping-item-checkbox {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.shopping-item-checkbox-label {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: 3px solid var(--accent);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: white;
}

.checkbox-icon {
    fill: white;
    transform: scale(0);
    transition: transform 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.shopping-item-checkbox:checked + .shopping-item-checkbox-label {
    background: var(--accent);
    border-color: var(--accent);
    animation: checkboxPop 0.3s ease;
}

.shopping-item-checkbox:checked + .shopping-item-checkbox-label .checkbox-icon {
    transform: scale(1);
}

@keyframes checkboxPop {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

/* Checked Item Styles */
.shopping-item-checked {
    opacity: 0.6;
    background: var(--surface);
}

.shopping-item-checked .shopping-item-name {
    text-decoration: line-through;
    color: var(--text-secondary);
}

.shopping-item-checked .shopping-item-amount {
    text-decoration: line-through;
    color: var(--text-secondary);
}

/* Celebration Animation */
.shopping-item-celebrate {
    animation: celebrate 0.6s ease;
}

@keyframes celebrate {
    0%, 100% { transform: scale(1) rotate(0deg); }
    25% { transform: scale(1.05) rotate(-2deg); }
    50% { transform: scale(1.1) rotate(2deg); }
    75% { transform: scale(1.05) rotate(-1deg); }
}

/* Shopping Item Info */
.shopping-item-info {
    flex: 1;
    min-width: 0;
}

.shopping-item-name {
    font-size: 16px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.shopping-item-amount {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.shopping-item-recipe {
    font-size: 12px;
    color: var(--text-secondary);
    font-style: italic;
}

/* Icon Button Styles - REMOVED (using styles from line 1167 instead) */

/* Mobile Responsiveness */
@media (max-width: 768px) {
    /* Stack add shopping item form on two rows */
    .add-shopping-item-form .form-row {
        flex-wrap: wrap !important;
    }
    
    .add-shopping-item-form .form-row .form-group:first-child {
        flex: 1 1 100% !important;
        margin-bottom: 12px;
    }
    
    .add-shopping-item-form .form-row .form-group:nth-child(2),
    .add-shopping-item-form .form-row .form-group:nth-child(3) {
        flex: 1 !important;
    }
    
    .add-shopping-item-form .form-row button {
        flex: 0 0 auto !important;
        min-width: 80px;
    }
    
    .shopping-item {
        padding: 12px;
        gap: 12px;
    }
    
    .shopping-item-checkbox-label {
        width: 28px;
        height: 28px;
    }
    
    .shopping-item-icon-btn {
        width: 36px;
        height: 36px;
    }
    
    .shopping-item-icon-btn svg {
        width: 18px;
        height: 18px;
    }
    
    .shopping-item-name {
        font-size: 14px;
    }
    
    .shopping-item-amount {
        font-size: 13px;
    }
}


/* Authentication Modals */
.auth-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    animation: fadeIn 0.3s ease;
}

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

.auth-modal-content {
    background: var(--background);
    border-radius: 12px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
}

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

.auth-modal-header h2 {
    margin: 0;
    font-size: 24px;
    font-weight: 500;
}

.auth-modal-close {
    background: none;
    border: none;
    font-size: 32px;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
}

.auth-modal-close:hover {
    color: var(--text-primary);
}

.auth-form {
    padding: 24px;
}

.auth-form .form-group {
    margin-bottom: 20px;
}

.auth-form label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-primary);
}

.auth-form input,
.auth-form select {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 15px;
    font-family: 'Inter', sans-serif;
    transition: border-color 0.2s ease;
}

.auth-form input:focus,
.auth-form select:focus {
    outline: none;
    border-color: var(--accent);
}

.auth-error {
    color: var(--danger);
    font-size: 14px;
    margin-bottom: 16px;
    display: none;
}

.auth-error.active {
    display: block;
}

.auth-success {
    color: var(--success);
    font-size: 14px;
    margin-bottom: 16px;
    display: none;
}

.auth-success.active {
    display: block;
}

.auth-form button[type="submit"] {
    width: 100%;
    padding: 12px;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s ease;
}

.auth-form button[type="submit"]:hover {
    background: #2980b9;
}

/* User Management Modal */
.user-management-content {
    padding: 24px;
}

.user-management-section {
    margin-bottom: 32px;
}

.user-management-section:last-child {
    margin-bottom: 0;
}

.user-management-section h3 {
    margin-bottom: 16px;
    font-size: 18px;
    font-weight: 500;
}

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

.user-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    background: var(--surface);
    border-radius: 8px;
    border: 1px solid var(--border);
}

.user-info {
    flex: 1;
}

.user-info .user-name {
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.user-info .user-details {
    font-size: 14px;
    color: var(--text-secondary);
}

.user-role-badge {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
}

.user-role-badge.admin {
    background: #e3f2fd;
    color: #1976d2;
}

.user-role-badge.user {
    background: #f3e5f5;
    color: #7b1fa2;
}

/* User Profile Dropdown */
.user-profile {
    position: relative;
    display: none;
}

.user-profile.active {
    display: block;
}

.user-profile-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 14px;
    background: transparent;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #ffffff;
    font-family: inherit;
    font-size: 14px;
}

.user-profile-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.user-profile-btn svg {
    color: #ffffff;
    flex-shrink: 0;
}

.user-profile-btn span {
    font-weight: 500;
    color: #ffffff;
}

.user-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 4px 12px var(--shadow);
    min-width: 200px;
    display: none;
    z-index: 1000;
}

.user-dropdown.active {
    display: block;
    animation: slideDown 0.2s ease;
}

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

.user-dropdown-header {
    padding: 16px;
    border-bottom: 1px solid var(--border);
}

.user-dropdown-name {
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.user-dropdown-role {
    font-size: 12px;
    color: var(--text-secondary);
    text-transform: uppercase;
}

.user-dropdown-menu {
    padding: 8px;
}

.user-dropdown-item {
    display: block;
    width: 100%;
    padding: 12px;
    background: none;
    border: none;
    text-align: left;
    color: var(--text-primary);
    cursor: pointer;
    border-radius: 6px;
    transition: background 0.2s ease;
    font-size: 15px;
}

.user-dropdown-item:hover {
    background: var(--surface);
}

.user-dropdown-item.danger {
    color: var(--danger);
}

.user-dropdown-item.danger:hover {
    background: #ffebee;

/* Star Rating Styles */
.stars-container {
    display: inline-flex;
    gap: 2px;
    align-items: center;
}

.star {
    font-size: 20px;
    line-height: 1;
    transition: all 0.2s ease;
    color: inherit; /* Don't inherit text color */
}

.star.filled {
    color: #FFD700 !important;
}

.star.half {
    color: #FFD700 !important;
    opacity: 0.5;
}

.star.empty {
    color: #E0E0E0 !important;
}

.star.interactive {
    cursor: pointer;
    transition: color 0.15s ease, transform 0.15s ease;
}

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

.star.interactive.filled {
    color: #FFD700 !important;
}

.star.interactive.empty {
    color: #E0E0E0 !important;
}

.stars-small .star {
    font-size: 16px;
}

.stars-blue .star.filled {
    color: #4A90E2;
}

.stars-blue .star.half {
    color: #4A90E2;
}

.stars-blue .star.empty {
    color: #D3D3D3;
}

.recipe-card-rating {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 8px 0;
}

.recipe-card-rating-inline {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-left: 8px;
}

.rating-count {
    font-size: 13px;
    color: var(--text-secondary);
}

.rating-count-inline {
    font-size: 12px;
    color: #4A90E2;
    font-weight: 500;
}

.recipe-rating-section {
    padding: 16px;
    background: var(--surface);
    border-radius: 8px;
    border: 1px solid var(--border);
}

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

.rating-text {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 500;
}

.user-rating {
    display: flex;
    align-items: center;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

.interactive-stars {
    display: inline-flex;
}

.interactive-stars .star {
    font-size: 24px;
}
}
