/* CleanPlate Styles - Modern Minimalist Design */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;500;600&family=Inter:wght@400;500;600&display=swap');

/* CSS Variables for theming */
:root {
    --color-background: #fafafa;
    --color-paper: #ffffff;
    --color-text-primary: #101828;
    --color-text-secondary: #4a5565;
    --color-text-muted: #6a7282;
    --color-accent: #101828;
    --color-accent-hover: #1e2939;
    --color-error: #e40014;
    --color-success: #34c759;
    --color-shadow: rgba(0, 0, 0, 0.1);
    --color-shadow-hover: rgba(0, 0, 0, 0.15);
    --color-border: #d1d5dc;
    --color-border-light: #e5e7eb;
    
    /* Confidence badge colors */
    --color-amber-50: #fffbeb;
    --color-amber-600: #dd7400;
    --color-red-50: #fef2f2;
    --color-red-600: #e40014;
    --color-orange-50: #fff7ed;
    --color-orange-600: #f05100;
    
    /* Primary brand color */
    --primary-color: #8b5cf6;
    
    --font-serif: 'Playfair Display', 'Georgia', 'Times New Roman', serif;
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica', 'Arial', sans-serif;
}

/* Global Resets and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-sans);
    font-size: 16px;
    line-height: 1.5;
    color: var(--color-text-primary);
    background-color: var(--color-background);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Container */
.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 3rem 1.5rem;
    width: 100%;
}

/* Typography - Serif for headings, Sans-serif for content */
h1, h2, h3 {
    font-family: var(--font-serif);
    font-weight: 600;
    color: var(--color-text-primary);
    line-height: 1.3;
}

h1 {
    font-size: 3.75rem;
    margin-bottom: 1rem;
    font-weight: 400;
    letter-spacing: -0.025em;
    line-height: 1;
}

@media (min-width: 768px) {
    h1 {
        font-size: 4.5rem;
    }
}

h2 {
    font-size: 3rem;
    margin-bottom: 1rem;
    line-height: 1;
}

@media (min-width: 768px) {
    h2 {
        font-size: 3.75rem;
    }
}

h3 {
    font-size: 1.875rem;
    margin-bottom: 0.75rem;
    line-height: 1.2;
}

/* View Management */
.landing-view {
    display: block;
}

.recipe-view {
    display: none;
}

/* Header */
header {
    text-align: center;
    margin-bottom: 3rem;
    padding-top: 2rem;
}

.landing-view header {
    margin-bottom: 3rem;
}

.recipe-view header {
    display: none;
}

.tagline {
    font-size: 1.125rem;
    color: var(--color-text-secondary);
    font-style: normal;
    margin: 0.5rem auto;
    line-height: 1.625;
    max-width: 36rem;
}

/* Input Section */
.input-section {
    margin-bottom: 2rem;
    max-width: 42rem;
    margin-left: auto;
    margin-right: auto;
}

#parse-form {
    width: 100%;
}

.input-group {
    position: relative;
    width: 100%;
}

#url-input {
    width: 100%;
    padding: 1.25rem 10rem 1.25rem 1.5rem;
    font-size: 1.125rem;
    font-family: var(--font-sans);
    border: 2px solid var(--color-border);
    border-radius: 0.75rem;
    background-color: var(--color-paper);
    color: var(--color-text-primary);
    transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 3px 0 rgba(0,0,0,0.1), 0 1px 2px -1px rgba(0,0,0,0.1);
}

#url-input:focus {
    outline: none;
    border-color: var(--color-accent);
    box-shadow: 0 1px 3px 0 rgba(0,0,0,0.1), 0 1px 2px -1px rgba(0,0,0,0.1);
}

#parse-btn {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-family: var(--font-sans);
    font-weight: 500;
    color: white;
    background-color: var(--color-accent);
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

#parse-btn .search-icon {
    width: 20px;
    height: 20px;
}

#parse-btn:hover {
    background-color: var(--color-accent-hover);
}

#parse-btn:active {
    transform: translateY(-50%) scale(0.98);
}

#parse-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background-color: #99a1af;
}

/* Popular Recipe Sites Section */
.popular-sites {
    margin-top: 2.5rem;
    text-align: center;
}

.popular-label {
    font-size: 0.875rem;
    color: var(--color-text-muted);
    margin-bottom: 1rem;
}

.site-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: center;
}

.site-badge {
    padding: 0.5rem 1rem;
    font-size: 0.75rem;
    font-family: var(--font-sans);
    font-weight: 400;
    color: var(--color-text-secondary);
    background-color: var(--color-paper);
    border: 1px solid var(--color-border-light);
    border-radius: 9999px;
    white-space: nowrap;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.site-badge:hover {
    color: var(--color-text);
    background-color: var(--color-bg);
    border-color: var(--color-border);
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Error Container */
.error-container {
    background-color: #fff5f5;
    border: 1px solid var(--color-error);
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 2px 8px rgba(255, 59, 48, 0.1);
}

.error-container .error {
    color: var(--color-error);
}

.error-container .error p {
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.error-container .suggestions {
    list-style: none;
    margin-top: 1rem;
    padding-left: 0;
}

.error-container .suggestions li {
    padding: 0.5rem 0;
    padding-left: 1.5rem;
    position: relative;
    color: var(--color-text-secondary);
}

.error-container .suggestions li::before {
    content: "→";
    position: absolute;
    left: 0;
    color: var(--color-error);
    font-weight: bold;
}

/* Back Button */
.recipe-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2rem;
    gap: 1rem;
    flex-wrap: wrap;
}

.toolbar-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.back-button {
    color: var(--color-text-secondary);
    background: none;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--font-sans);
    font-size: 1rem;
    transition: color 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 0;
}

.back-button:hover {
    color: var(--color-text-primary);
}

.back-button .arrow {
    font-size: 1.25rem;
}

/* View Switcher Compact */
.view-selector-dropdown {
    position: relative;
}

.view-selector-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    font-size: 0.8125rem;
    font-family: var(--font-sans);
    font-weight: 500;
    color: var(--color-text-secondary);
    background-color: var(--color-background);
    border: 1px solid var(--color-border-light);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.view-selector-btn:hover {
    color: var(--color-text-primary);
    border-color: var(--color-border);
}

.view-selector-btn svg {
    width: 14px;
    height: 14px;
    transition: transform 0.2s ease;
}

.view-selector-btn.open svg {
    transform: rotate(180deg);
}

.view-dropdown-menu {
    position: absolute;
    top: calc(100% + 0.25rem);
    right: 0;
    min-width: 150px;
    background-color: var(--color-paper);
    border: 1px solid var(--color-border-light);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    padding: 0.25rem;
    z-index: 100;
}

.view-dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    font-family: var(--font-sans);
    font-weight: 500;
    color: var(--color-text-secondary);
    background: transparent;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
    text-align: left;
}

.view-dropdown-item:hover {
    color: var(--color-text-primary);
    background-color: var(--color-background);
}

.view-dropdown-item svg {
    width: 16px;
    height: 16px;
}

/* Print Button Compact */
.print-btn-compact {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    font-size: 0.8125rem;
    font-family: var(--font-sans);
    font-weight: 500;
    background: transparent;
    border: 1px solid var(--color-border-light);
    border-radius: 6px;
    color: var(--color-text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
}

.print-btn-compact:hover {
    background-color: var(--color-background);
    border-color: var(--color-border);
    color: var(--color-text-secondary);
}

.print-btn-compact svg {
    width: 18px;
    height: 18px;
}

/* Confidence Badge */
.confidence-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.confidence-badge {
    font-size: 0.75rem;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    display: inline-block;
}

.confidence-badge.high {
    background-color: #d1fae5;
    color: #065f46;
}

.confidence-badge.medium {
    background-color: var(--color-amber-50);
    color: var(--color-amber-600);
}

.confidence-badge.low {
    background-color: var(--color-red-50);
    color: var(--color-red-600);
}

.confidence-toggle {
    background: none;
    border: none;
    padding: 0.25rem;
    cursor: pointer;
    color: var(--color-text-secondary);
    transition: transform 0.2s ease;
    display: flex;
    align-items: center;
}

.confidence-toggle:hover {
    color: var(--color-text-primary);
}

.confidence-toggle.open {
    transform: rotate(180deg);
}

/* Confidence Details Panel */
.confidence-details {
    background-color: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    padding: 1rem;
    margin: 1rem auto 1.5rem auto;
    max-width: 600px;
}

.confidence-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.confidence-table th,
.confidence-table td {
    text-align: left;
    padding: 0.5rem;
    border-bottom: 1px solid #e5e7eb;
}

.confidence-table th {
    font-weight: 600;
    color: var(--color-text-secondary);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.confidence-table tbody tr:last-child td {
    border-bottom: none;
}

.confidence-table td:nth-child(2) {
    font-weight: 500;
    color: var(--color-text-primary);
}

.confidence-table .status-icon {
    display: inline-block;
    font-size: 1rem;
}

/* Toast Notification */
.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background-color: var(--color-accent);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    font-family: var(--font-sans);
    font-size: 0.95rem;
    z-index: 1000;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Recipe Container */
.recipe-view {
    margin-top: 0;
}

.recipe-view.active {
    display: block;
    animation: unfold 0.6s ease-out forwards;
}

@keyframes unfold {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.recipe-card {
    background-color: var(--color-paper);
    border-radius: 12px;
    padding: 2.5rem;
    box-shadow: 0 2px 8px var(--color-shadow);
    border: 1px solid var(--color-border);
    max-width: 900px;
    margin: 0 auto;
}

.recipe-header {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--color-border);
    text-align: center;
}

.recipe-title-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.recipe-title-container:hover .title-edit-btn {
    opacity: 1;
}

.recipe-title-editable {
    text-align: center;
    margin: 0;
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem;
    transition: background-color 0.2s ease;
}

.recipe-title-editable.editing {
    background: #f3f4f6;
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.title-edit-btn {
    background: none;
    border: none;
    padding: 0.375rem;
    cursor: pointer;
    opacity: 0;
    transition: all 0.2s ease;
    color: #6b7280;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.375rem;
}

.title-edit-btn:hover {
    background: #f3f4f6;
    color: var(--primary-color);
}

.title-edit-btn:active {
    transform: scale(0.95);
}

.recipe-source {
    margin-top: 1rem;
    font-size: 0.875rem;
    color: var(--color-text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.recipe-source .source-label {
    font-weight: 500;
}

.recipe-source a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s ease;
}

.recipe-source a:hover {
    color: #6d28d9;
    text-decoration: underline;
}

.recipe-source a:hover {
    text-decoration: underline;
}

#recipe-author {
    color: var(--color-text-secondary);
    font-weight: 400;
}

/* Video Link */
.video-link {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    color: var(--primary-color);
    font-weight: 600;
    cursor: pointer;
    transition: color 0.2s ease;
    border-left: 1px solid var(--color-border-light);
    padding-left: 0.5rem;
    margin-left: 0.5rem;
}

.video-link:hover {
    color: #6d28d9;
    text-decoration: underline;
}

.video-link svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

/* Recipe Description */
.recipe-description {
    margin: 1rem 0;
    text-align: center;
    color: var(--color-text-secondary);
    font-size: 0.938rem;
    line-height: 1.6;
    font-style: italic;
}

.description-text {
    display: block;
}

.description-text.truncated {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.read-more-btn {
    margin-top: 0.5rem;
    background: none;
    border: none;
    color: var(--primary-color);
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 600;
    padding: 0.25rem 0.5rem;
    transition: color 0.2s ease;
}

.read-more-btn:hover {
    color: #6d28d9;
    text-decoration: underline;
}

/* Dietary Badges */
.dietary-badges {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
    margin: 1rem 0 1.5rem 0;
}

.dietary-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.813rem;
    font-weight: 600;
    color: #fff;
    background-color: var(--color-text-secondary);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.dietary-badge:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.badge-emoji {
    font-size: 1rem;
    line-height: 1;
}

.badge-text {
    line-height: 1;
}

/* Dietary badge color variants */
.badge-vegan {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
}

.badge-vegetarian {
    background: linear-gradient(135deg, #84cc16 0%, #65a30d 100%);
}

.badge-gluten-free {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.badge-dairy-free {
    background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
}

.badge-keto {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
}

.badge-paleo {
    background: linear-gradient(135deg, #d946ef 0%, #c026d3 100%);
}

.badge-low-carb {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
}

.badge-low-sodium {
    background: linear-gradient(135deg, #14b8a6 0%, #0d9488 100%);
}

.badge-kosher {
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
}

.badge-halal {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

/* Difficulty Badge */
.recipe-difficulty {
    display: flex;
    justify-content: center;
    margin: 0.75rem 0 1rem 0;
}

.difficulty-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.813rem;
    font-weight: 600;
    color: #fff;
    transition: transform 0.2s ease;
}

.difficulty-badge:hover {
    transform: translateY(-1px);
}

.difficulty-emoji {
    font-size: 1rem;
    line-height: 1;
}

.difficulty-text {
    line-height: 1;
}

.difficulty-easy {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
}

.difficulty-medium {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.difficulty-hard {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

/* Recipe Metadata */
.recipe-metadata {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.5rem;
    margin: 1.5rem 0;
}

.metadata-item {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.875rem;
    color: var(--color-text-secondary);
}

.metadata-item svg {
    width: 16px;
    height: 16px;
}

.metadata-value {
    color: var(--color-text-secondary);
}

/* Recipe Taxonomy */
.recipe-taxonomy {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem;
    margin: 1rem 0;
}

.taxonomy-item {
    display: inline-block;
    padding: 0.375rem 0.875rem;
    background-color: var(--color-bg-secondary);
    border-radius: 16px;
    font-size: 0.813rem;
    color: var(--color-text-secondary);
    line-height: 1.4;
}

.taxonomy-label {
    font-weight: 600;
    color: var(--color-text-primary);
}

/* Recipe Rating */
.recipe-rating {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin: 1rem 0;
    font-size: 0.938rem;
}

.recipe-rating .stars {
    color: #f59e0b;
    font-size: 1.25rem;
    line-height: 1;
    letter-spacing: 2px;
}

.recipe-rating .rating-value {
    font-weight: 600;
    color: var(--color-text-primary);
}

.recipe-rating .rating-count {
    color: var(--color-text-secondary);
    font-size: 0.875rem;
}

/* Recipe Content Sections */
.recipe-content {
    display: grid;
    grid-template-columns: 1fr;
    gap: 3rem;
}

@media (min-width: 768px) {
    .recipe-content {
        grid-template-columns: 1fr 1fr;
        gap: 4rem;
    }
}

.recipe-section {
    padding: 0;
}

.section-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--color-border-light);
}

.recipe-section h3 {
    font-size: 1.875rem;
    margin-bottom: 0;
    padding-bottom: 0;
    color: var(--color-text-primary);
    border-bottom: none;
}

.copy-section-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.375rem;
    background: transparent;
    border: 1px solid var(--color-border-light);
    border-radius: 6px;
    color: var(--color-text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
    opacity: 0.6;
}

.copy-section-btn:hover {
    opacity: 1;
    background-color: var(--color-background);
    border-color: var(--color-border);
    color: var(--color-text-secondary);
    transform: translateY(-1px);
}

.copy-section-btn:active {
    transform: translateY(0);
}

.copy-section-btn svg {
    width: 16px;
    height: 16px;
}

/* Lists - Sans-serif for modern readability */
.ingredients-list {
    font-family: var(--font-sans);
    list-style: none;
    padding-left: 0;
}

.ingredients-list li {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    line-height: 1.625;
    color: var(--color-text-secondary);
}

.ingredient-bullet {
    flex-shrink: 0;
    width: 1.25rem;
    height: 1.25rem;
    margin-top: 0.125rem;
    border: 2px solid var(--color-border);
    border-radius: 0.25rem;
    background: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ingredient-checkbox {
    flex-shrink: 0;
    width: 1.25rem;
    height: 1.25rem;
    margin-top: 0.125rem;
    border: 2px solid var(--color-border);
    border-radius: 0.25rem;
    background: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ingredient-text {
    flex: 1;
}

.instructions-list {
    font-family: var(--font-sans);
    list-style: none;
    padding-left: 0;
    counter-reset: instruction-counter;
}

.instructions-list li {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    line-height: 1.625;
    color: var(--color-text-secondary);
    counter-increment: instruction-counter;
}

.instruction-number {
    flex-shrink: 0;
    width: 2rem;
    height: 2rem;
    background-color: var(--color-accent);
    color: white;
    border-radius: 9999px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    font-weight: 500;
}

.instruction-number::before {
    content: counter(instruction-counter);
}

.instruction-text {
    flex: 1;
    padding-top: 0.25rem;
}

/* Footer */
footer {
    margin-top: auto;
    padding-top: 3rem;
    padding-bottom: 2rem;
    text-align: center;
    color: var(--color-text-secondary);
    font-size: 0.875rem;
}

main:has(.recipe-view.active) ~ footer .footer-creator {
    display: none;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 1.5rem 1rem;
    }

    h1 {
        font-size: 3rem;
    }

    h2 {
        font-size: 2.5rem;
    }

    #url-input {
        padding-right: 1.5rem;
        font-size: 1rem;
    }

    #parse-btn {
        position: static;
        transform: none;
        width: 100%;
        margin-top: 0.75rem;
        justify-content: center;
    }

    #parse-btn:active {
        transform: scale(0.98);
    }

    .site-badge {
        font-size: 0.65rem;
        padding: 0.4rem 0.85rem;
    }

    .recipe-title-container {
        gap: 0.5rem;
    }

    .title-edit-btn {
        opacity: 1;
    }

    .recipe-toolbar {
        flex-direction: column;
        align-items: flex-start;
    }

    .toolbar-right {
        width: 100%;
        justify-content: space-between;
    }

    .view-selector-dropdown {
        flex: 1;
    }

    .view-selector-btn {
        width: 100%;
    }

    .recipe-card {
        padding: 1.5rem;
    }

    .toast {
        right: 1rem;
        left: 1rem;
        bottom: 1rem;
    }

    /* Carousel mobile adjustments */
    .image-carousel {
        padding: 1.5rem 1rem;
        margin-top: 2rem;
    }

    .carousel-header h4 {
        font-size: 1.125rem;
    }

    .carousel-hint {
        font-size: 0.8125rem;
    }

    .carousel-content {
        gap: 0.5rem;
    }

    .carousel-nav {
        width: 2.5rem;
        height: 2.5rem;
    }

    .carousel-nav svg {
        width: 20px;
        height: 20px;
    }

    .carousel-image {
        max-height: 300px;
    }

    .carousel-actions {
        flex-direction: column;
        gap: 0.75rem;
    }

    .carousel-confirm,
    .carousel-hide {
        width: 100%;
        padding: 0.875rem;
    }

    /* Image selector button mobile adjustment */
    .image-selector-btn {
        width: 2.5rem;
        height: 2.5rem;
        bottom: 0.75rem;
        right: 0.75rem;
        opacity: 1;
    }

    .image-selector-btn svg {
        width: 18px;
        height: 18px;
    }

    /* Image hidden banner mobile adjustment */
    .image-hidden-banner {
        margin-top: 2rem;
        padding: 0.875rem 1rem;
        font-size: 0.875rem;
        gap: 0.5rem;
    }

    .image-hidden-banner svg {
        width: 16px;
        height: 16px;
    }
}

/* Recipe Image */
.recipe-image-container {
    position: relative;
    margin-top: 4rem;
    border-radius: 0.5rem;
    overflow: hidden;
    box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -4px rgba(0,0,0,0.1);
}

.recipe-image {
    width: 100%;
    height: auto;
    max-height: 500px;
    object-fit: cover;
    display: block;
}

.image-selector-btn {
    position: absolute;
    bottom: 1rem;
    right: 1rem;
    background: rgba(0, 0, 0, 0.5);
    border: none;
    border-radius: 0.5rem;
    width: 3rem;
    height: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    backdrop-filter: blur(8px);
    z-index: 10;
    opacity: 0;
}

.recipe-image-container:hover .image-selector-btn {
    opacity: 1;
}

.image-selector-btn:hover {
    background: rgba(0, 0, 0, 0.7);
    transform: scale(1.05);
}

.image-selector-btn:active {
    transform: scale(0.95);
}

.image-selector-btn svg {
    color: #ffffff;
}

.image-hidden-banner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-top: 4rem;
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
    border-radius: 0.5rem;
    border: 2px dashed #d1d5db;
    color: #6b7280;
    font-size: 0.9375rem;
}

.image-hidden-banner svg {
    flex-shrink: 0;
}

.image-hidden-banner span {
    font-weight: 500;
}

.image-hidden-change {
    background: var(--primary-color);
    color: #ffffff;
    border: none;
    padding: 0.375rem 1rem;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.image-hidden-change:hover {
    background: #6d28d9;
    transform: translateY(-1px);
}

.image-hidden-change:active {
    transform: translateY(0);
}

/* Image Carousel Styles */
.image-carousel {
    margin-top: 4rem;
    padding: 2rem;
    background: linear-gradient(135deg, var(--primary-color) 0%, #6366f1 100%);
    border-radius: 0.75rem;
    box-shadow: 0 10px 15px -3px rgba(0,0,0,0.15), 0 4px 6px -4px rgba(0,0,0,0.1);
}

.carousel-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.carousel-header h4 {
    color: #ffffff;
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0 0 0.5rem 0;
}

.carousel-hint {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.875rem;
    margin: 0;
}

.carousel-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.carousel-image-container {
    position: relative;
    flex: 1;
    max-width: 600px;
    border-radius: 0.5rem;
    overflow: hidden;
    box-shadow: 0 20px 25px -5px rgba(0,0,0,0.2), 0 8px 10px -6px rgba(0,0,0,0.1);
}

.carousel-image {
    width: 100%;
    height: auto;
    max-height: 400px;
    object-fit: cover;
    display: block;
}

.carousel-counter {
    position: absolute;
    bottom: 1rem;
    right: 1rem;
    background: rgba(0, 0, 0, 0.75);
    color: #ffffff;
    padding: 0.375rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.875rem;
    font-weight: 600;
    backdrop-filter: blur(4px);
}

.carousel-nav {
    background: rgba(255, 255, 255, 0.95);
    border: none;
    border-radius: 50%;
    width: 3rem;
    height: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
}

.carousel-nav:hover:not(:disabled) {
    background: #ffffff;
    transform: scale(1.1);
    box-shadow: 0 10px 15px -3px rgba(0,0,0,0.15), 0 4px 6px -2px rgba(0,0,0,0.1);
}

.carousel-nav:active:not(:disabled) {
    transform: scale(1.05);
}

.carousel-nav:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.carousel-nav svg {
    color: var(--primary-color);
}

.carousel-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    align-items: center;
}

.carousel-confirm,
.carousel-hide {
    background: #ffffff;
    color: var(--primary-color);
    border: none;
    padding: 0.75rem 2rem;
    border-radius: 0.5rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
}

.carousel-hide {
    background: rgba(255, 255, 255, 0.85);
    color: #6b7280;
}

.carousel-confirm:hover,
.carousel-hide:hover {
    background: #f9fafb;
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0,0,0,0.15), 0 4px 6px -2px rgba(0,0,0,0.1);
}

.carousel-hide:hover {
    background: rgba(255, 255, 255, 1);
    color: #4b5563;
}

.carousel-confirm:active,
.carousel-hide:active {
    transform: translateY(0);
}

/* ========================================
   VIDEO MODAL
   ======================================== */

.video-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
}

.video-modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(4px);
}

.video-modal-content {
    position: relative;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90vw;
    max-width: 1200px;
    z-index: 10001;
}

.video-modal-close {
    position: absolute;
    top: -3rem;
    right: 0;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 10002;
}

.video-modal-close:hover {
    background: #ffffff;
    transform: scale(1.1);
}

.video-modal-close svg {
    color: #374151;
}

.video-modal-player {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    background: #000;
    border-radius: 0.5rem;
    overflow: hidden;
}

.video-modal-player iframe,
.video-modal-player video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .video-modal-content {
        width: 95vw;
    }
    
    .video-modal-close {
        top: -2.5rem;
        width: 2rem;
        height: 2rem;
    }
}

/* ========================================
   VIEW MODES
   ======================================== */

/* Clean View - Hide taxonomy and rating by default */
body[data-view="clean"] .recipe-taxonomy,
body[data-view="clean"] .recipe-rating,
body[data-view="clean"] .recipe-description {
    display: none !important;
}

/* Text-Only View */
body[data-view="text-only"] .recipe-image-container,
body[data-view="text-only"] .image-hidden-banner,
body[data-view="text-only"] .image-carousel,
body[data-view="text-only"] .confidence-container,
body[data-view="text-only"] .confidence-details,
body[data-view="text-only"] .title-edit-btn,
body[data-view="text-only"] .image-selector-btn,
body[data-view="text-only"] .image-hidden-change,
body[data-view="text-only"] .recipe-description,
body[data-view="text-only"] .dietary-badges,
body[data-view="text-only"] .recipe-difficulty,
body[data-view="text-only"] .recipe-taxonomy,
body[data-view="text-only"] .recipe-rating,
body[data-view="text-only"] .recipe-metadata,
body[data-view="text-only"] .video-link {
    display: none !important;
}

body[data-view="text-only"] .section-header {
    margin-bottom: 0.75rem;
    padding-bottom: 0;
    border-bottom: none;
}

body[data-view="text-only"] .recipe-section h3 {
    font-family: 'Courier New', Courier, monospace;
    font-size: 1.125rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
    padding-bottom: 0;
    border-bottom: none;
}

body[data-view="text-only"] .ingredients-list,
body[data-view="text-only"] .instructions-list {
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.875rem;
    line-height: 1.6;
    margin-left: 0;
    padding-left: 2rem;
}

body[data-view="text-only"] .ingredients-list {
    list-style-type: disc !important;
    list-style-position: outside;
}

body[data-view="text-only"] .instructions-list {
    list-style-type: decimal !important;
    list-style-position: outside;
    counter-reset: none;
}

body[data-view="text-only"] .ingredients-list li,
body[data-view="text-only"] .instructions-list li {
    display: list-item !important;
    padding: 0.25rem 0;
    margin: 0;
    margin-bottom: 0.25rem;
    border-bottom: none;
    position: static;
}

body[data-view="text-only"] .ingredients-list li::before {
    display: none;
}

body[data-view="text-only"] .instruction-number {
    display: none;
}

body[data-view="text-only"] .ingredient-checkbox,
body[data-view="text-only"] .ingredient-bullet {
    display: none;
}

/* Extra Info View - Shows additional metadata */
body[data-view="extra-info"] .recipe-taxonomy,
body[data-view="extra-info"] .recipe-rating {
    display: flex !important;
}

/* Hide elements in Extra Info view (same as Clean) */
body[data-view="extra-info"] .confidence-container,
body[data-view="extra-info"] .confidence-details {
    display: none !important;
}

/* Print View */
body[data-view="print"] .copy-btn,
body[data-view="print"] .recipe-difficulty,
body[data-view="print"] .recipe-taxonomy,
body[data-view="print"] .recipe-rating,
body[data-view="print"] .video-link {
    display: none !important;
}

body[data-view="print"] .recipe-card {
    display: flex;
    flex-wrap: wrap;
    padding: 1.5rem;
    align-items: flex-start;
}

body[data-view="print"] .recipe-source {
    order: 4;
    width: 100%;
    text-align: center;
    margin: 0.75rem 0 0.75rem 0;
    font-size: 0.875rem;
    page-break-after: avoid;
}

body[data-view="print"] .recipe-description {
    display: none !important;
}

body[data-view="print"] .dietary-badges {
    order: 3;
    width: 100%;
    justify-content: center;
    margin: 0.5rem 0;
    gap: 0.375rem;
    page-break-after: avoid;
}

body[data-view="print"] .dietary-badge {
    padding: 0.25rem 0.5rem;
    font-size: 0.688rem;
    background: #6b7280 !important;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
}

body[data-view="print"] .badge-emoji {
    font-size: 0.75rem;
}

body[data-view="print"] .recipe-taxonomy {
    order: 0;
    width: 100%;
    justify-content: center;
    margin: 0 0 0.5rem 0;
    font-size: 0.688rem;
    gap: 0.5rem;
    page-break-after: avoid;
}

body[data-view="print"] .recipe-rating {
    order: 0;
    width: 100%;
    justify-content: center;
    margin: 0 0 0.5rem 0;
    font-size: 0.75rem;
    page-break-after: avoid;
}

body[data-view="print"] .recipe-image-container {
    display: block !important;
    order: 1;
    width: 120px;
    height: 120px;
    margin: 0 1rem 0 0;
    padding: 0;
    overflow: hidden;
    border-radius: 8px;
    flex-shrink: 0;
}

body[data-view="print"] .recipe-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    border-radius: 8px;
}

body[data-view="print"] .recipe-header {
    order: 2;
    width: 100%;
    display: contents;
}

body[data-view="print"] .recipe-title-container {
    order: 2;
    flex: 1;
    text-align: left;
    align-self: center;
}

body[data-view="print"] .recipe-title {
    font-size: 0.875rem;
    margin-bottom: 0;
    text-align: left;
}

body[data-view="print"] .recipe-metadata {
    display: flex !important;
    order: 3;
    width: 100%;
    justify-content: center;
    text-align: center;
    margin: 0.75rem 0 0.25rem 0;
    padding: 0.5rem 0;
    border-top: 1px solid var(--color-border-light);
    border-bottom: 1px solid var(--color-border-light);
    font-size: 0.75rem;
    page-break-after: avoid;
    page-break-inside: avoid;
}

body[data-view="print"] .recipe-content {
    display: block !important;
    order: 5;
    width: 100%;
    margin-top: 0.5rem;
    page-break-before: avoid;
}

body[data-view="print"] .image-selector-btn,
body[data-view="print"] .title-edit-btn,
body[data-view="print"] .image-hidden-change {
    display: none !important;
}

body[data-view="print"] .recipe-section {
    page-break-inside: auto;
    page-break-before: avoid;
}

body[data-view="print"] .section-header {
    margin-top: 1rem;
    margin-bottom: 0.5rem;
}

body[data-view="print"] .recipe-section h3 {
    font-size: 0.875rem;
    margin-top: 0;
    margin-bottom: 0.375rem;
    page-break-after: avoid;
    font-weight: bold;
}

body[data-view="print"] .ingredients-list {
    column-count: 3;
    column-gap: 1rem;
    font-size: 0.75rem;
    line-height: 1.4;
    list-style: disc !important;
    list-style-position: outside;
    margin-left: 0;
    padding-left: 1.25rem;
}

body[data-view="print"] .ingredients-list li {
    display: list-item !important;
    padding: 0.125rem 0;
    margin: 0;
    break-inside: avoid;
    border-bottom: none;
}

body[data-view="print"] .ingredients-list li::before {
    display: none;
}

body[data-view="print"] .ingredient-checkbox,
body[data-view="print"] .ingredient-bullet {
    display: none;
}

body[data-view="print"] .instructions-list {
    column-count: 2;
    column-gap: 1rem;
    font-size: 0.8125rem;
    line-height: 1.5;
    list-style: decimal !important;
    list-style-position: outside;
    margin-left: 0;
    padding-left: 1.25rem;
    counter-reset: none;
}

body[data-view="print"] .instructions-list li {
    display: list-item !important;
    padding: 0.25rem 0;
    margin: 0;
    break-inside: avoid;
}

body[data-view="print"] .instruction-number {
    display: none;
}

body[data-view="print"] .confidence-container,
body[data-view="print"] .confidence-details,
body[data-view="print"] .image-carousel {
    display: none !important;
}

/* Print Styles */
@media print {
    body {
        background: #fff;
    }

    .no-print,
    .recipe-toolbar {
        display: none !important;
    }

    body[data-view="print"] .recipe-card {
        box-shadow: none;
        border: none;
    }

    body:not([data-view="print"]) .recipe-card {
        box-shadow: none;
        border: none;
        padding: 1rem;
    }

    body:not([data-view="print"]) .recipe-image-container {
        box-shadow: none;
        page-break-inside: avoid;
    }

    .ingredient-checkbox,
    .ingredient-bullet {
        border: 1px solid #000;
    }

    .instruction-number {
        background-color: #000;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
}
