/**
 * AI Gluten-Free Dessert Creator - Frontend Styles
 * Version: 2.0.0
 */

/* Import Fonts */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@600;700;800&family=Inter:wght@400;500;600;700&display=swap');

/* Container */
.aigfd-container {
    max-width: 900px;
    margin: 3rem auto;
    padding: 0 1.5rem;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.aigfd-creator {
    background: white;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

/* Header */
.aigfd-header {
    background: linear-gradient(135deg, #FFF5ED 0%, #FFE8D6 100%);
    padding: 3rem 2.5rem 2.5rem;
    text-align: center;
    border-bottom: 3px solid #FFDDC1;
}

.aigfd-title {
    font-family: 'Playfair Display', serif;
    font-size: 2.5rem;
    font-weight: 800;
    color: #2D1B12;
    margin: 0 0 1rem 0;
    line-height: 1.2;
}

.aigfd-subtitle {
    font-size: 1.15rem;
    color: #5D4037;
    margin: 0;
    line-height: 1.6;
}

/* Form */
.aigfd-form {
    padding: 2.5rem;
}

.aigfd-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.aigfd-form-group {
    margin-bottom: 1.5rem;
}

.aigfd-form-group label {
    display: block;
    font-weight: 600;
    font-size: 1rem;
    color: #2D1B12;
    margin-bottom: 0.5rem;
}

.aigfd-form-group input[type="text"],
.aigfd-form-group input[type="number"],
.aigfd-form-group select {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid #E0E0E0;
    border-radius: 10px;
    font-size: 1rem;
    font-family: 'Inter', sans-serif;
    transition: all 0.3s ease;
    background: white;
}

.aigfd-form-group input[type="text"]:focus,
.aigfd-form-group input[type="number"]:focus,
.aigfd-form-group select:focus {
    outline: none;
    border-color: #D97941;
    box-shadow: 0 0 0 3px rgba(217, 121, 65, 0.1);
}

.aigfd-form-group input::placeholder {
    color: #9E9E9E;
}

/* Checkbox Group */
.aigfd-checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-top: 0.75rem;
}

.aigfd-checkbox-group label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
    cursor: pointer;
    margin-bottom: 0;
}

.aigfd-checkbox-group input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: #D97941;
}

/* Buttons */
.aigfd-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 1.125rem 2.5rem;
    border: none;
    border-radius: 50px;
    font-size: 1.125rem;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

.aigfd-button-primary {
    background: linear-gradient(135deg, #D97941 0%, #E8936B 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(217, 121, 65, 0.3);
    width: 100%;
    margin-top: 1rem;
}

.aigfd-button-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(217, 121, 65, 0.4);
}

.aigfd-button-primary:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.aigfd-button-secondary {
    background: white;
    color: #D97941;
    border: 2px solid #D97941;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
}

.aigfd-button-secondary:hover {
    background: #FFF9F5;
    transform: translateY(-2px);
}

.aigfd-spinner {
    display: inline-block;
}

/* Results */
.aigfd-results {
    padding: 2.5rem;
    background: #FFF9F5;
}

.aigfd-results-header {
    text-align: center;
    margin-bottom: 3rem;
    padding-bottom: 2rem;
    border-bottom: 2px solid #FFDDC1;
}

.aigfd-badge {
    display: inline-block;
    padding: 0.5rem 1.5rem;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
}

.aigfd-badge-success {
    background: rgba(76, 175, 80, 0.15);
    color: #4CAF50;
}

.aigfd-recipe-title {
    font-family: 'Playfair Display', serif;
    font-size: 2.5rem;
    font-weight: 700;
    color: #2D1B12;
    margin: 0 0 1rem 0;
    line-height: 1.2;
}

.aigfd-recipe-blurb {
    font-size: 1.2rem;
    color: #5D4037;
    margin: 0 0 2rem 0;
    line-height: 1.6;
}

.aigfd-recipe-meta {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
    margin-bottom: 2rem;
}

.aigfd-meta-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.1rem;
    color: #2D1B12;
}

.aigfd-actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

/* Recipe Content */
.aigfd-recipe-content {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    margin-bottom: 3rem;
}

/* Top section - Ingredients and Nutrition side by side */
.aigfd-top-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.aigfd-section {
    background: white;
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

/* Full width sections */
.aigfd-section.full-width {
    width: 100%;
}

.aigfd-section h3 {
    font-family: 'Playfair Display', serif;
    font-size: 1.75rem;
    color: #2D1B12;
    margin: 0 0 1.5rem 0;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid #FFDDC1;
}

/* Ingredients List */
.aigfd-ingredients-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.aigfd-ingredients-list li {
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    background: #FFF9F5;
    border-radius: 8px;
    transition: background 0.2s;
}

.aigfd-ingredients-list li:hover {
    background: #FFDDC1;
}

/* Instructions List */
.aigfd-instructions-list {
    list-style: none;
    padding: 0;
    margin: 0;
    counter-reset: instruction-counter;
}

.aigfd-instructions-list li {
    counter-increment: instruction-counter;
    padding-left: 3rem;
    margin-bottom: 1.5rem;
    position: relative;
    line-height: 1.7;
}

.aigfd-instructions-list li::before {
    content: counter(instruction-counter);
    position: absolute;
    left: 0;
    top: 0;
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #D97941 0%, #E8936B 100%);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
}

/* Nutrition Grid */
.aigfd-nutrition-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 1rem;
}

.aigfd-nutrition-item {
    text-align: center;
    padding: 1rem;
    background: #FFF9F5;
    border-radius: 10px;
}

.aigfd-nutrition-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #D97941;
    margin-bottom: 0.25rem;
}

.aigfd-nutrition-label {
    font-size: 0.85rem;
    color: #5D4037;
    text-transform: capitalize;
}

/* Tips List */
.aigfd-tips-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.aigfd-tips-list li {
    padding: 1rem;
    margin-bottom: 0.75rem;
    background: white;
    border-left: 4px solid #D97941;
    border-radius: 8px;
}

/* CTA Section */
.aigfd-cta {
    text-align: center;
    padding: 2rem 0;
}

/* Notice */
.aigfd-notice {
    padding: 1.5rem;
    border-radius: 10px;
    margin-bottom: 2rem;
}

.aigfd-notice-warning {
    background: #FFF3CD;
    border-left: 4px solid #FFC107;
    color: #856404;
}

/* Responsive */
@media (max-width: 768px) {
    .aigfd-container {
        margin: 1.5rem auto;
        padding: 0 1rem;
    }
    
    .aigfd-header {
        padding: 2rem 1.5rem 1.5rem;
    }
    
    .aigfd-title {
        font-size: 2rem;
    }
    
    .aigfd-subtitle {
        font-size: 1rem;
    }
    
    .aigfd-form {
        padding: 1.5rem;
    }
    
    .aigfd-form-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .aigfd-results {
        padding: 1.5rem;
    }
    
    .aigfd-recipe-title {
        font-size: 2rem;
    }
    
    .aigfd-top-section {
        grid-template-columns: 1fr;
    }
    
    .aigfd-recipe-meta {
        gap: 1rem;
    }
    
    .aigfd-actions {
        flex-direction: column;
    }
    
    .aigfd-button-secondary {
        width: 100%;
    }
}

/* Print Styles */
@media print {
    .aigfd-header,
    .aigfd-form,
    .aigfd-actions,
    .aigfd-cta {
        display: none;
    }
    
    .aigfd-results {
        padding: 0;
        background: white;
    }
    
    .aigfd-section {
        page-break-inside: avoid;
    }
}