/* Plated Recipe Generator Styles */
/* Color Palette: Warm, food-inspired tones */

:root {
    --cream: #FFF8F0;
    --sage: #8B9D83;
    --sage-dark: #6B7D63;
    --terracotta: #E07A5F;
    --terracotta-dark: #C96548;
    --charcoal: #3D405B;
    --white: #FFFFFF;
    --gray-light: #F4F1EE;
    --gray-medium: #D4D0CC;
    --shadow: rgba(61, 64, 91, 0.1);
    --shadow-heavy: rgba(61, 64, 91, 0.2);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, var(--cream) 0%, var(--gray-light) 100%);
    color: var(--charcoal);
    line-height: 1.6;
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 900px;
    margin: 0 auto;
}

/* Header */
header {
    text-align: center;
    margin-bottom: 40px;
    padding: 40px 20px 20px;
}

h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--charcoal);
    margin-bottom: 10px;
    font-family: Georgia, 'Times New Roman', serif;
}

.subtitle {
    font-size: 1.1rem;
    color: var(--sage-dark);
    font-weight: 400;
}

/* Cards */
.input-card,
.recipe-card,
.error-card {
    background: var(--white);
    border-radius: 16px;
    padding: 32px;
    box-shadow: 0 4px 20px var(--shadow);
    margin-bottom: 24px;
}

/* Input Section */
.input-section label {
    display: block;
    margin-bottom: 12px;
    color: var(--charcoal);
}

.hint {
    display: block;
    font-size: 0.9rem;
    font-weight: normal;
    color: var(--sage-dark);
    margin-top: 4px;
}

textarea {
    width: 100%;
    padding: 16px;
    border: 2px solid var(--gray-medium);
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    resize: vertical;
    transition: border-color 0.3s ease;
    min-height: 120px;
}

textarea:focus {
    outline: none;
    border-color: var(--sage);
}

textarea::placeholder {
    color: var(--gray-medium);
}

/* Buttons */
.button-group {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}

.btn {
    padding: 14px 28px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
}

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

.btn-primary:hover:not(:disabled) {
    background: var(--terracotta-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--shadow-heavy);
}

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

.btn-secondary {
    background: var(--gray-light);
    color: var(--charcoal);
}

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

.btn-text {
    background: none;
    color: var(--sage-dark);
    padding: 8px 16px;
}

.btn-text:hover {
    background: var(--gray-light);
}

/* Loading State */
.spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-right: 8px;
}

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

/* Suggestions */
.suggestions {
    margin-top: 24px;
    padding: 20px;
    background: var(--gray-light);
    border-radius: 12px;
}

.suggestions p {
    margin-bottom: 12px;
    color: var(--charcoal);
    font-size: 0.95rem;
}

.suggestion-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.chip {
    padding: 8px 16px;
    background: var(--white);
    border: 2px solid var(--sage);
    border-radius: 20px;
    font-size: 0.9rem;
    color: var(--sage-dark);
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.chip:hover {
    background: var(--sage);
    color: var(--white);
    transform: translateY(-2px);
}

/* Recipe Display */
.recipe-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--gray-light);
}

.recipe-content {
    line-height: 1.8;
    color: var(--charcoal);
}

.recipe-content h2 {
    font-family: Georgia, 'Times New Roman', serif;
    color: var(--charcoal);
    font-size: 1.8rem;
    margin-bottom: 8px;
    margin-top: 24px;
}

.recipe-content h2:first-child {
    margin-top: 0;
}

.recipe-content h3 {
    color: var(--sage-dark);
    font-size: 1.3rem;
    margin-top: 20px;
    margin-bottom: 12px;
    font-weight: 600;
}

.recipe-content p {
    margin-bottom: 16px;
}

.recipe-content ul,
.recipe-content ol {
    margin-left: 24px;
    margin-bottom: 16px;
}

.recipe-content li {
    margin-bottom: 8px;
}

.recipe-content strong {
    color: var(--charcoal);
    font-weight: 600;
}

.recipe-content em {
    color: var(--sage-dark);
    font-style: italic;
}

.recipe-content code {
    background: var(--gray-light);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.9em;
}

.recipe-footer {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 2px solid var(--gray-light);
    text-align: center;
}

/* Error Section */
.error-section {
    text-align: center;
}

.error-card {
    text-align: center;
    padding: 48px 32px;
}

.error-icon {
    font-size: 3rem;
    margin-bottom: 16px;
    display: block;
}

#error-message {
    font-size: 1.1rem;
    color: var(--charcoal);
    margin-bottom: 24px;
}

/* Footer */
footer {
    text-align: center;
    padding: 32px 20px;
    color: var(--sage-dark);
    font-size: 0.9rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    h1 {
        font-size: 2rem;
    }

    .input-card,
    .recipe-card,
    .error-card {
        padding: 24px;
    }

    .button-group {
        flex-direction: column;
    }

    .btn {
        width: 100%;
    }

    .suggestion-chips {
        flex-direction: column;
    }

    .chip {
        width: 100%;
        text-align: center;
    }

    .recipe-header {
        flex-direction: column;
        gap: 12px;
    }

    .recipe-header .btn {
        width: 100%;
    }
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.input-section,
.output-section,
.error-section {
    animation: fadeIn 0.5s ease;
}

/* Copy Confirmation */
.btn-copied {
    background: var(--sage) !important;
    color: var(--white) !important;
}

/* Print Styles */
@media print {
    body {
        background: white;
    }

    header,
    .recipe-header,
    .recipe-footer,
    footer,
    .suggestions {
        display: none;
    }

    .recipe-card {
        box-shadow: none;
        padding: 0;
    }
}
