﻿/* Modern CSS Reset and Variables */
:root {
    --primary: #3b82f6;
    --primary-dark: #1d4ed8;
    --success: #10b981;
    --success-dark: #059669;
    --warning: #f59e0b;
    --warning-light: #fef3c7;
    --danger: #ef4444;
    --danger-light: #fef2f2;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    --radius: 0.75rem;
    --radius-sm: 0.5rem;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}



/* Container and Layout */
.recipe-import-container {
    max-width: 1900px;
    margin: 0 auto;
    padding: 1rem;
}

.import-header {
    text-align: center;
    margin-bottom: 2rem;
    padding: 1.5rem 0;
}

.import-title {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
}

.import-subtitle {
    font-size: 1.125rem;
    color: var(--gray-600);
    max-width: 600px;
    margin: 0 auto;
}

/* Flexible Layout System */
.import-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    max-width: 1900px;
    margin: 0 auto;
}

@media (min-width: 1024px) {
    .import-layout {
        max-width: 1900px;
        grid-template-columns: 1fr 320px;
        gap: 2rem;
    }
}

/* Modern Card Design */
.import-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid rgba(255, 255, 255, 0.2);
    overflow: hidden;
    transition: var(--transition);
}

    .import-card:hover {
        box-shadow: var(--shadow-lg);
        transform: translateY(-1px);
    }

.import-card-header {
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, var(--gray-50) 0%, rgba(255, 255, 255, 0.8) 100%);
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

    .import-card-header h3 {
        display: flex;
        align-items: center;
        gap: 0.5rem;
        font-weight: 600;
        color: var(--gray-800);
        font-size: 1.125rem;
    }

.import-card-body {
    padding: 1.5rem;
}

.import-card-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Compact Alert System */
.import-alert {
    padding: 1rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    position: relative;
    border: 1px solid;
}

.import-alert-success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success-dark);
    border-color: var(--success);
}

.import-alert-danger {
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
    border-color: var(--danger);
}

.import-alert-warning {
    background: rgba(245, 158, 11, 0.1);
    color: #d97706;
    border-color: var(--warning);
}

.alert-icon {
    font-size: 1.25rem;
    flex-shrink: 0;
}

.alert-content {
    flex: 1;
    font-size: 0.875rem;
}

    .alert-content strong {
        font-weight: 600;
    }

.alert-details {
    font-size: 0.8rem;
    margin-top: 0.5rem;
    opacity: 0.8;
}

.alert-actions {
    margin-top: 0.75rem;
}

.alert-dismiss {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: inherit;
    opacity: 0.6;
    cursor: pointer;
    padding: 0.25rem;
    line-height: 1;
    border-radius: 50%;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

    .alert-dismiss:hover {
        opacity: 1;
        background: rgba(0, 0, 0, 0.1);
    }

/* Streamlined Upload Section */
.upload-section {
    border: 2px dashed var(--gray-300);
    border-radius: var(--radius);
    padding: 2rem;
    text-align: center;
    background: linear-gradient(135deg, var(--gray-50) 0%, rgba(255, 255, 255, 0.8) 100%);
    transition: var(--transition);
    position: relative;
}

    .upload-section:hover, .upload-section.dragover {
        border-color: var(--primary);
        background: linear-gradient(135deg, rgba(59, 130, 246, 0.05) 0%, rgba(255, 255, 255, 0.9) 100%);
        transform: scale(1.01);
    }

.upload-icon {
    font-size: 3rem;
    color: var(--gray-400);
    margin-bottom: 1rem;
    display: block;
}

.upload-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 0.5rem;
}

.upload-subtitle {
    color: var(--gray-600);
    margin-bottom: 1.5rem;
    font-size: 0.875rem;
}

.file-input-wrapper {
    position: relative;
    display: inline-block;
}

.file-input {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.file-input-label {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 2rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    border-radius: var(--radius-sm);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow);
}

    .file-input-label:hover {
        transform: translateY(-1px);
        box-shadow: var(--shadow-lg);
    }

.upload-constraints {
    margin-top: 1rem;
    font-size: 0.8rem;
    color: var(--gray-500);
}

/* Compact Page Selection */
.page-selection-section .import-card-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
}

.page-count-badge {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.8rem;
    font-weight: 500;
}

.page-selection-info {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: rgba(59, 130, 246, 0.05);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
}

.page-selector-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.page-option {
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-sm);
    overflow: hidden;
    transition: var(--transition);
    background: white;
    cursor: pointer;
}

    .page-option:hover {
        border-color: var(--primary);
        box-shadow: var(--shadow);
        transform: translateY(-1px);
    }

    .page-option.selected {
        border-color: var(--primary);
        background: rgba(59, 130, 246, 0.05);
        box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    }

.page-option-label {
    display: block;
    padding: 1rem;
    cursor: pointer;
}

.page-radio {
    display: none;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.page-number {
    font-weight: 600;
    color: var(--gray-800);
}

.selected-indicator {
    color: var(--primary);
    font-weight: bold;
    font-size: 1.2rem;
}



.page-preview {
    font-size: 0.8rem;
    color: var(--gray-600);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Streamlined Preview Section */
.preview-section .import-card-header {
    background: linear-gradient(135deg, var(--success) 0%, var(--success-dark) 100%);
    color: white;
}

.preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 15px;
}


.recipe-header-info {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 1rem;
    align-items: start;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--gray-200);
}

.recipe-meta {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.recipe-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 0.5rem;
}

.recipe-detail {
    font-size: 0.875rem;
    color: var(--gray-600);
}

    .recipe-detail strong {
        color: var(--gray-800);
        font-weight: 600;
    }

.recipe-badges {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    align-items: flex-end;
}

.recipe-badge {
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 500;
}

.recipe-badge-secondary {
    background: var(--gray-100);
    color: var(--gray-700);
}

.recipe-badge-warning {
    background: var(--warning-light);
    color: #92400e;
}

/* Compact Warning Section */
.existing-warning {
    background: var(--warning-light);
    border: 1px solid var(--warning);
    border-radius: var(--radius-sm);
    padding: 1rem;
    margin-bottom: 1.5rem;
}

.warning-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    color: #92400e;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
}

.existing-recipe-link {
    display: block;
    padding: 0.75rem;
    background: rgba(245, 158, 11, 0.1);
    border-radius: var(--radius-sm);
    text-decoration: none;
    color: #92400e;
    margin-top: 0.5rem;
    transition: var(--transition);
    font-size: 0.875rem;
}

    .existing-recipe-link:hover {
        background: rgba(245, 158, 11, 0.2);
    }

/* Responsive Preview Content */
.preview-content {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

@media (min-width: 768px) {
    .preview-content {
        grid-template-columns: 1fr 1fr;
    }
}

.preview-section-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.count-badge {
    background: var(--gray-100);
    color: var(--gray-700);
    padding: 0.125rem 0.5rem;
    border-radius: 1rem;
    font-size: 0.75rem;
    font-weight: 500;
}

/* Compact Lists */
.preview-list {
    max-height: 250px;
    overflow-y: auto;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-sm);
    background: white;
}

.preview-item {
    padding: 0.75rem;
    border-bottom: 1px solid var(--gray-100);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.75rem;
}

    .preview-item:last-child {
        border-bottom: none;
    }

    .preview-item:hover {
        background: var(--gray-50);
    }

.ingredient-info {
    flex: 1;
}

.ingredient-quantity {
    font-weight: 600;
    color: var(--gray-900);
    font-size: 0.875rem;
}

.ingredient-name {
    color: var(--gray-600);
    font-size: 0.875rem;
}

.item-number {
    font-size: 0.7rem;
    color: var(--gray-500);
    background: var(--gray-100);
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    white-space: nowrap;
}

.step-item {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
    padding: 0.75rem;
    border-bottom: 1px solid var(--gray-100);
}

    .step-item:hover {
        background: var(--gray-50);
    }

.step-number {
    background: var(--primary);
    color: white;
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
    flex-shrink: 0;
}

.step-text {
    flex: 1;
    font-size: 0.875rem;
    line-height: 1.5;
    color: var(--gray-700);
}

.more-items {
    padding: 0.75rem;
    text-align: center;
    color: var(--gray-500);
    font-style: italic;
    font-size: 0.8rem;
    background: var(--gray-50);
}

/* Compact Nutrition Grid */
.nutrition-section {
    grid-column: 1 / -1;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--gray-200);
}

.nutrition-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 0.75rem;
    margin-top: 0.75rem;
}

.nutrition-item {
    background: var(--gray-50);
    padding: 0.75rem;
    border-radius: var(--radius-sm);
    text-align: center;
    border: 1px solid var(--gray-200);
    transition: var(--transition);
}

    .nutrition-item:hover {
        background: white;
        box-shadow: var(--shadow);
    }

.nutrition-label {
    font-size: 0.7rem;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.25rem;
    font-weight: 500;
}

.nutrition-value {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--gray-900);
}

/* Modern Button System */
.action-buttons {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--gray-200);
    flex-wrap: wrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 1.5rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.875rem;
    text-decoration: none;
    border: 2px solid transparent;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

    .btn:hover {
        transform: translateY(-1px);
        box-shadow: var(--shadow-lg);
    }

.btn-primary, .btn-preview {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
}

    .btn-primary:hover, .btn-preview:hover {
        background: linear-gradient(135deg, var(--primary-dark) 0%, #1e40af 100%);
    }

.btn-success {
    background: linear-gradient(135deg, var(--success) 0%, var(--success-dark) 100%);
    color: white;
}

    .btn-success:hover {
        background: linear-gradient(135deg, var(--success-dark) 0%, #047857 100%);
    }

.btn-outline-secondary {
    background: transparent;
    color: var(--gray-600);
    border-color: var(--gray-300);
}

    .btn-outline-secondary:hover {
        background: var(--gray-50);
        border-color: var(--gray-400);
    }

.btn-outline-success {
    background: transparent;
    color: var(--success-dark);
    border-color: var(--success);
}

    .btn-outline-success:hover {
        background: rgba(16, 185, 129, 0.05);
    }

.btn-outline-warning {
    background: transparent;
    color: #d97706;
    border-color: var(--warning);
}

    .btn-outline-warning:hover {
        background: var(--warning-light);
    }

/* Compact Sidebar */
.import-sidebar {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

@media (max-width: 1023px) {
    .import-sidebar {
        order: -1;
    }
}

.recent-imports-list {
    display: flex;
    flex-direction: column;
}

.recent-import-item {
    padding: 0.75rem;
    border-bottom: 1px solid var(--gray-100);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.75rem;
    transition: var(--transition);
}

    .recent-import-item:last-child {
        border-bottom: none;
    }

    .recent-import-item:hover {
        background: var(--gray-50);
    }

.recent-import-info {
    flex: 1;
}

.recent-import-link {
    text-decoration: none;
    color: inherit;
}

.recent-import-title {
    font-weight: 600;
    color: var(--gray-800);
    font-size: 0.875rem;
    margin-bottom: 0.25rem;
    transition: var(--transition);
}

.recent-import-link:hover .recent-import-title {
    color: var(--primary);
}

.recent-import-number {
    font-size: 0.75rem;
    color: var(--gray-500);
}

.recent-import-date {
    font-size: 0.75rem;
    color: var(--gray-400);
    white-space: nowrap;
}

.empty-state {
    text-align: center;
    color: var(--gray-500);
    font-size: 0.875rem;
    padding: 2rem 1rem;
}

/* Compact Help Section */
.help-list {
    list-style: none;
}

.help-item {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    font-size: 0.8rem;
}

    .help-item:last-child {
        margin-bottom: 0;
    }

.help-icon {
    color: var(--success);
    margin-top: 0.125rem;
    flex-shrink: 0;
}

.help-text {
    color: var(--gray-600);
    line-height: 1.4;
}

/* Simple Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1050;
}

.loading-content {
    text-align: center;
    color: white;
}

.loading-spinner {
    width: 1.5rem;
    height: 1.5rem;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 0.5rem auto;
}

.loading-text {
    font-size: 0.8rem;
    font-weight: 500;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Compact Debug Section */
.debug-section {
    margin-top: 0.75rem;
    background: var(--gray-50);
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--gray-200);
}

.debug-header {
    padding: 0.375rem 0.5rem;
    background: var(--gray-100);
    font-weight: 600;
    color: var(--gray-700);
    font-size: 0.75rem;
}

.debug-content {
    padding: 0.5rem;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.65rem;
    max-height: 150px;
    overflow: auto;
    background: var(--gray-800);
    color: #e2e8f0;
    white-space: pre-wrap;
    line-height: 1.2;
}

/* Compact Mobile Optimizations */
@media (max-width: 768px) {
    .recipe-import-container {
        padding: 0.375rem;
    }

    .import-header {
        margin-bottom: 0.5rem;
    }

    .import-card-body {
        padding: 0.5rem;
    }

    .upload-section {
        padding: 0.75rem;
    }

    .recipe-header-info {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }

    .recipe-badges {
        align-items: flex-start;
        flex-direction: row;
        flex-wrap: wrap;
    }

    .preview-content {
        grid-template-columns: 1fr;
    }

    .nutrition-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .action-buttons {
        flex-direction: column;
    }

    .btn {
        justify-content: center;
        width: 100%;
    }

    .page-selector-grid {
        grid-template-columns: 1fr;
    }

    .import-card-header h3 {
        font-size: 0.75rem;
    }

    .import-layout {
        gap: 0.5rem;
    }
}

@media (max-width: 480px) {
    .import-card-body {
        padding: 0.375rem;
    }

    .upload-section {
        padding: 0.5rem;
    }

    .nutrition-grid {
        grid-template-columns: 1fr;
        gap: 0.25rem;
    }

    .action-buttons {
        gap: 0.25rem;
    }

    .recipe-title {
        font-size: 0.9rem;
    }

    .import-title {
        font-size: 1.25rem;
    }

    .import-card-header {
        padding: 0.375rem 0.5rem;
    }
}

/* Utility Classes */
.hidden {
    display: none !important;
}

.text-center {
    text-align: center;
}

.flex-grow-1 {
    flex-grow: 1;
}

.d-flex {
    display: flex;
}

.align-items-center {
    align-items: center;
}

.justify-content-between {
    justify-content: space-between;
}

.gap-2 {
    gap: 0.5rem;
}

.mb-0 {
    margin-bottom: 0;
}

.mt-2 {
    margin-top: 0.5rem;
}

.me-2 {
    margin-right: 0.5rem;
}

/* Tab System Styles */
.import-tabs {
    display: flex;
    border-bottom: 1px solid #e0e0e0;
    margin-bottom: 2rem;
}

.tab-button {
    background: none;
    border: none;
    padding: 1rem 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border-bottom: 3px solid transparent;
    color: #666;
    font-weight: 500;
    transition: all 0.2s ease;
}

    .tab-button:hover {
        background-color: #f5f5f5;
        color: #333;
    }

    .tab-button.active {
        color: #007bff;
        border-bottom-color: #007bff;
        background-color: #f8f9fa;
    }

.tab-content {
    display: none;
}

    .tab-content.active {
        display: block;
    }

/* URL Input Styles */
.url-input-wrapper {
    position: relative;
    margin: 1.5rem 0;
}

.url-input {
    width: 100%;
    padding: 0.875rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.2s ease;
}

    .url-input:focus {
        outline: none;
        border-color: #007bff;
        box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
    }

.url-input-help {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
    font-size: 0.875rem;
    color: #666;
}

    .url-input-help svg {
        flex-shrink: 0;
        opacity: 0.7;
    }

/* Preview enhancements */
.source-badge {
    background-color: #17a2b8;
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: 500;
}

.source-link {
    color: #007bff;
    text-decoration: none;
    word-break: break-all;
}

    .source-link:hover {
        text-decoration: underline;
    }

/* Loading text updates */
.loading-text {
    margin-top: 1rem;
    font-size: 1.1rem;
}

/* Manual Text Input Styles */
.manual-input-group {
    margin: 1.5rem 0;
}

.manual-input-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: #333;
    font-size: 0.95rem;
}

.manual-input-label svg {
    opacity: 0.7;
}

.required-indicator {
    color: #dc3545;
    font-weight: 600;
}

.manual-url-input {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 0.95rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.manual-url-input:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.15);
}

.manual-text-input {
    width: 100%;
    padding: 1rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 0.95rem;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    line-height: 1.5;
    resize: vertical;
    min-height: 400px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.manual-text-input:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.15);
}

.manual-text-input::placeholder {
    color: #999;
    font-style: italic;
    line-height: 1.4;
}

.manual-input-help {
    font-size: 0.85rem;
    color: #666;
    margin-top: 0.5rem;
}

.character-counter {
    text-align: right;
    font-size: 0.8rem;
    color: #666;
    margin-top: 0.5rem;
}

.constraint-item {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: #555;
    margin: 0.5rem 0;
}

.constraint-item svg {
    flex-shrink: 0;
    margin-top: 0.1rem;
    color: #28a745;
}

#manual-tab .upload-section {
    text-align: left;
}

#manual-tab .upload-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    text-align: center;
}

#manual-tab .upload-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    text-align: center;
}

#manual-tab .upload-subtitle {
    color: #666;
    margin-bottom: 2rem;
    text-align: center;
}

.source-badge.manual-import {
    background-color: #6f42c1;
    color: white;
}

.source-badge.pdf-import {
    background-color: #dc3545;
    color: white;
}

.source-badge.web-import {
    background-color: #17a2b8;
    color: white;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.nutrition-additional {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #e5e7eb;
}

.nutrition-additional-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: #6b7280;
    margin-bottom: 0.5rem;
}

.nutrition-additional-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.nutrition-item-small {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nutrition-label-small {
    font-size: 0.75rem;
    color: #6b7280;
}

.nutrition-value-small {
    font-size: 0.75rem;
    font-weight: 500;
    color: #374151;
}

.nutrition-section-empty {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e5e7eb;
}

.nutrition-empty {
    text-align: center;
    padding: 2rem;
    color: #6b7280;
}

.empty-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.empty-text {
    font-size: 0.875rem;
}