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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    margin-bottom: 40px;
    color: white;
}

header h1 {
    font-size: 3rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

header p {
    font-size: 1.2rem;
    opacity: 0.9;
}

main {
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    overflow: hidden;
}

.input-section {
    padding: 40px;
}

.input-section h2 {
    margin-bottom: 30px;
    color: #4a5568;
    font-size: 1.8rem;
}

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

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #2d3748;
}

input, select, textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s ease;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

textarea {
    resize: vertical;
    min-height: 100px;
}

button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 15px 30px;
    font-size: 18px;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    width: 100%;
    font-weight: 600;
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

button:active {
    transform: translateY(0);
}

/* Mood Selection */
.mood-options {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.preset-moods {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 10px;
    margin-bottom: 10px;
}

.mood-button {
    background: #f7fafc;
    border: 2px solid #e2e8f0;
    padding: 12px 16px;
    border-radius: 25px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    white-space: nowrap;
    color: #4a5568;
}

.mood-button:hover {
    background: rgba(102, 126, 234, 0.1);
    border-color: #667eea;
    transform: translateY(-1px);
    color: #667eea;
}

.mood-button.selected {
    background: #667eea;
    color: white;
    border-color: #667eea;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
    text-shadow: 0 1px 2px rgba(0,0,0,0.1);
    animation: selectPulse 0.3s ease-out;
}

@keyframes selectPulse {
    0% {
        transform: translateY(-1px) scale(1);
    }
    50% {
        transform: translateY(-2px) scale(1.05);
    }
    100% {
        transform: translateY(-1px) scale(1);
    }
}

.mood-button.selected:hover {
    background: #5a67d8;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.4);
}

.results-section {
    border-top: 2px solid #e2e8f0;
    padding: 40px;
    background: #f7fafc;
}

.results-section h2 {
    margin-bottom: 30px;
    color: #4a5568;
    font-size: 1.8rem;
}

.loading {
    text-align: center;
    padding: 40px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e2e8f0;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.recommendations {
    display: grid;
    gap: 20px;
}

.recommendation-card {
    background: white;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    border-left: 4px solid #667eea;
    overflow: hidden;
}

.image-container {
    position: relative;
    width: 100%;
    height: 200px;
    overflow: hidden;
    border-radius: 10px 10px 0 0;
}

.food-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: brightness(0.7);
}

.food-image.ai-generated {
    filter: none;
}

.food-image.real-food-image {
    filter: none;
}

.image-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, rgba(102, 126, 234, 0.8), rgba(118, 75, 162, 0.8));
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.9;
}

.image-description {
    color: white;
    text-align: center;
    padding: 15px;
    font-size: 0.9rem;
    line-height: 1.4;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

.ai-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.real-food-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: linear-gradient(45deg, #28a745, #20c997);
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.card-content {
    padding: 25px;
}

/* Video Section in Recommendation Cards */
.video-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
}

.video-section h4 {
    color: #2d3748;
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
}

.video-card {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer;
    background: white;
}

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

.video-thumbnail {
    width: 100%;
    height: 100px;
    object-fit: cover;
}

.video-info {
    padding: 10px;
}

.video-info h5 {
    color: #2d3748;
    margin-bottom: 6px;
    font-size: 0.85rem;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.video-meta {
    display: flex;
    justify-content: space-between;
    color: #4a5568;
    font-size: 0.75rem;
}

.video-meta span:first-child {
    font-weight: 600;
}

/* Tab Navigation */
.feature-tabs {
    display: flex;
    margin-bottom: 30px;
    border-bottom: 2px solid #e2e8f0;
}

.tab-button {
    background: none;
    border: none;
    padding: 15px 30px;
    font-size: 1.1rem;
    font-weight: 600;
    color: #4a5568;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
}

.tab-button:hover {
    color: #667eea;
    background: rgba(102, 126, 234, 0.1);
}

.tab-button.active {
    color: #667eea;
    border-bottom-color: #667eea;
    background: rgba(102, 126, 234, 0.1);
}

.tab-content {
    display: none;
}

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

/* Upload Area */
.upload-area {
    border: 3px dashed #e2e8f0;
    border-radius: 15px;
    padding: 40px;
    text-align: center;
    margin-bottom: 25px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.upload-area:hover {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.05);
}

.upload-area.dragover {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.1);
}

.upload-content .upload-icon {
    font-size: 3rem;
    margin-bottom: 15px;
}

.upload-content p {
    margin-bottom: 20px;
    color: #4a5568;
    font-size: 1.1rem;
}

#browse-button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease;
}

#browse-button:hover {
    transform: translateY(-2px);
}

.preview-container {
    position: relative;
}

#photo-preview {
    max-width: 100%;
    max-height: 300px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

#remove-photo {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #e53e3e;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 20px;
    font-size: 0.9rem;
    cursor: pointer;
}

#analyze-food {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 15px 30px;
    font-size: 18px;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    width: 100%;
    font-weight: 600;
}

#analyze-food:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

#analyze-food:disabled {
    background: #cbd5e0;
    cursor: not-allowed;
    transform: none;
}

/* Food Analysis Results */
.food-analysis {
    display: grid;
    gap: 25px;
}

.recipe-card {
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    border-left: 5px solid #667eea;
}

.recipe-header {
    margin-bottom: 20px;
}

.recipe-header h3 {
    color: #2d3748;
    font-size: 1.5rem;
    margin-bottom: 10px;
}

.recipe-meta {
    display: flex;
    gap: 20px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.meta-item {
    background: #f7fafc;
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    color: #4a5568;
}

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

.recipe-section h4 {
    color: #2d3748;
    margin-bottom: 15px;
    font-size: 1.2rem;
}

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

.ingredients-list li {
    padding: 8px 0;
    border-bottom: 1px solid #e2e8f0;
    position: relative;
    padding-left: 25px;
}

.ingredients-list li:before {
    content: "•";
    color: #667eea;
    font-weight: bold;
    position: absolute;
    left: 0;
}

.instructions-list li {
    padding: 12px 0;
    border-bottom: 1px solid #e2e8f0;
    position: relative;
    padding-left: 35px;
    counter-increment: step-counter;
}

.instructions-list {
    counter-reset: step-counter;
}

.instructions-list li:before {
    content: counter(step-counter);
    background: #667eea;
    color: white;
    font-weight: bold;
    border-radius: 50%;
    width: 25px;
    height: 25px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    left: 0;
    top: 10px;
    font-size: 0.8rem;
}

.tips-list li {
    padding: 8px 0;
    color: #4a5568;
    font-style: italic;
    position: relative;
    padding-left: 25px;
}

.tips-list li:before {
    content: "💡";
    position: absolute;
    left: 0;
}

/* Video Section */
.videos-section {
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.videos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.video-card {
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer;
}

.video-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.video-thumbnail {
    width: 100%;
    height: 180px;
    object-fit: cover;
}

.video-info {
    padding: 15px;
}

.video-info h4 {
    color: #2d3748;
    margin-bottom: 8px;
    font-size: 1rem;
    line-height: 1.4;
}

.video-meta {
    display: flex;
    justify-content: space-between;
    color: #4a5568;
    font-size: 0.9rem;
}

@media (max-width: 768px) {
    .feature-tabs {
        flex-direction: column;
    }
    
    .tab-button {
        padding: 12px 20px;
    }
    
    .upload-area {
        padding: 25px;
    }
    
    .recipe-meta {
        flex-direction: column;
        gap: 10px;
    }
    
    .videos-grid {
        grid-template-columns: 1fr;
    }
}

.recommendation-card h3 {
    color: #2d3748;
    margin-bottom: 10px;
    font-size: 1.3rem;
}

.recommendation-card p {
    color: #4a5568;
    line-height: 1.6;
    margin-bottom: 15px;
}

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

.tag {
    background: #e2e8f0;
    color: #4a5568;
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 0.9rem;
    font-weight: 500;
}

@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .input-section, .results-section {
        padding: 20px;
    }
    
    .input-section h2, .results-section h2 {
        font-size: 1.5rem;
    }
    
    .preset-moods {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
        gap: 8px;
    }
    
    .mood-button {
        padding: 10px 12px;
        font-size: 0.8rem;
    }
}