/* Reset and Base Styles */
:root {
    --bg-color: #F8F5E6; /* Pale yellow from image */
    --card-bg: #FFFFFF;
    --text-main: #2D2D2A;
    --text-muted: #7A7A75;
    --primary-orange: #E67E22;
    --primary-dark: #D35400;
    --gradient-orange: linear-gradient(135deg, #F39C12, #D35400);
    --border-radius: 20px;
    --shadow-soft: 0 4px 15px rgba(0, 0, 0, 0.05);
    --shadow-hover: 0 8px 25px rgba(211, 84, 0, 0.2);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.6;
    padding-top: 80px; /* Space for fixed header */
}

/* Utilities */
.text-center { text-align: center; }
.hidden { display: none !important; }
.card {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 24px;
    box-shadow: var(--shadow-soft);
}

.gradient-orange {
    background: var(--gradient-orange);
    color: white;
}

/* Header */
.main-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: var(--bg-color);
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0,0,0,0.03);
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: contain;
    background-color: #333; /* match image bg if needed */
}

.brand-name {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--text-main);
}

.btn-favorites {
    background: transparent;
    border: 2px solid var(--primary-orange);
    color: var(--primary-orange);
    padding: 8px 16px;
    border-radius: 30px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-favorites:hover {
    background: var(--primary-orange);
    color: white;
}

/* Container */
.container {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
}

/* Hero Section */
.hero-section {
    margin-bottom: 30px;
}

.badge {
    display: inline-block;
    background: rgba(230, 126, 34, 0.15);
    color: var(--primary-dark);
    padding: 6px 16px;
    border-radius: 30px;
    font-weight: 700;
    font-size: 0.8rem;
    letter-spacing: 1px;
    margin-bottom: 15px;
}

.main-title {
    font-size: 2.2rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 15px;
    color: #2c2d28;
}

.slogan {
    font-size: 1.1rem;
    color: var(--text-muted);
    font-style: italic;
}

/* Input Section */
.input-section {
    margin-bottom: 30px;
}

.input-section h2 {
    font-size: 1.3rem;
    margin-bottom: 5px;
}

.suggestions-section {
    margin-bottom: 30px;
}

.btn-suggestions {
    display: inline-block;
    background: rgba(230, 126, 34, 0.15);
    color: var(--primary-dark);
    padding: 8px 20px;
    border-radius: 30px;
    font-weight: 700;
    font-size: 0.8rem;
    letter-spacing: 1px;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    text-transform: uppercase;
}

.btn-suggestions:hover {
    background: rgba(230, 126, 34, 0.25);
    transform: scale(1.02);
}

.suggestions-cloud {
    margin-top: 30px;
    animation: fadeInDown 0.3s ease;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.suggestion-tag {
    background-color: #F2F2F2;
    color: #666;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: calc(0.9rem - 2px);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    user-select: none;
}

.suggestion-tag:hover {
    background-color: #e2e2e2;
}

.suggestion-tag.selected {
    background-color: rgba(230, 126, 34, 0.15);
    color: var(--primary-dark);
    border: 1px solid rgba(230, 126, 34, 0.3);
}

.subtitle {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin-bottom: 20px;
}

.input-group {
    margin-bottom: 20px;
}

textarea {
    width: 100%;
    border: 2px solid #EBE9DF;
    border-radius: 15px;
    padding: 15px;
    font-size: 1rem;
    resize: vertical;
    outline: none;
    transition: border-color 0.3s ease;
    background-color: #FAFAFA;
}

textarea:focus {
    border-color: var(--primary-orange);
    background-color: #FFF;
}

.btn-primary {
    width: 100%;
    background: var(--gradient-orange);
    color: white;
    border: none;
    padding: 16px;
    border-radius: 15px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: var(--shadow-soft);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-primary:active {
    transform: scale(0.98);
}

.btn-primary:hover {
    box-shadow: var(--shadow-hover);
}

.btn-primary:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Microphone Button */
.btn-mic {
    position: absolute;
    bottom: 12px;
    right: 12px;
    background: var(--bg-color);
    color: var(--primary-orange);
    border: 1px solid #EBE9DF;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 5;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.btn-mic:hover {
    background: var(--primary-orange);
    color: white;
    transform: scale(1.05);
}

.btn-mic.recording {
    background: #E74C3C;
    color: white;
    border-color: #E74C3C;
    animation: micPulse 1.5s infinite;
}

@keyframes micPulse {
    0% { box-shadow: 0 0 0 0 rgba(231, 76, 60, 0.4); }
    70% { box-shadow: 0 0 0 15px rgba(231, 76, 60, 0); }
    100% { box-shadow: 0 0 0 0 rgba(231, 76, 60, 0); }
}

/* Loading State */
.loading-section {
    text-align: center;
    padding: 40px 0;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(230, 126, 34, 0.2);
    border-top-color: var(--primary-orange);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

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

.loading-section p {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--primary-dark);
}

.loading-subtext {
    font-size: 0.9rem;
    font-weight: 400 !important;
    color: var(--text-muted) !important;
    margin-top: 5px;
}

/* Result Section */
.recipe-card {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-soft);
}

.recipe-header {
    padding: 25px 25px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top-left-radius: var(--border-radius);
    border-top-right-radius: var(--border-radius);
}

.recipe-label {
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    background: rgba(255, 255, 255, 0.2);
    padding: 4px 12px;
    border-radius: 20px;
}

.actions-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.share-tooltip {
    position: absolute;
    bottom: calc(100% + 15px);
    right: -10px;
    background-color: #0CB7D6;
    color: white;
    padding: 12px 18px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 700;
    text-align: center;
    line-height: 1.4;
    white-space: nowrap;
    box-shadow: 0 5px 15px rgba(12, 183, 214, 0.3);
    z-index: 10;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.share-tooltip.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.share-tooltip::after {
    content: '';
    position: absolute;
    bottom: -8px;
    right: 52px;
    border-width: 8px 8px 0;
    border-style: solid;
    border-color: #0CB7D6 transparent transparent transparent;
}

.action-buttons {
    display: flex;
    gap: 10px;
}

.action-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.2s;
}

.share-copy { background: rgba(255, 255, 255, 0.9); color: #333; }
.share-whatsapp { background: #25D366; color: white; }
.save-favorite { background: rgba(255, 255, 255, 0.9); color: #333; }
.save-favorite.active { color: #E74C3C; }

.recipe-content {
    padding: 25px;
}

/* Markdown styling within recipe */
.recipe-content h1, .recipe-content h2, .recipe-content h3 {
    color: var(--primary-dark);
    margin: 25px 0 15px;
    position: relative;
    padding-bottom: 5px;
}

.recipe-content h1 { font-size: 1.8rem; margin-top: 0; }
.recipe-content h2 { font-size: 1.3rem; border-bottom: 2px solid #f0f0f0; display: inline-block; padding-bottom: 5px; }

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

.recipe-content ul, .recipe-content ol {
    margin: 0 0 20px 20px;
}

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

.recipe-content strong {
    color: #444;
}

/* Format specifically lists or blockquotes generated in the markdown */
.recipe-content ol {
    list-style-type: none;
    counter-reset: step-counter;
    margin-left: 0;
}

.recipe-content ol li {
    counter-increment: step-counter;
    position: relative;
    padding-left: 45px;
    margin-bottom: 20px;
    min-height: 30px;
}

.recipe-content ol li::before {
    content: counter(step-counter);
    position: absolute;
    left: 0;
    top: -2px;
    width: 30px;
    height: 30px;
    background-color: var(--primary-orange);
    color: white;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: bold;
    font-size: 0.9rem;
    box-shadow: 0 3px 8px rgba(230, 126, 34, 0.3);
}

/* Recipe Footer & Back Button */
.recipe-footer {
    padding: 0 25px 25px;
    text-align: center;
}

.btn-outline {
    background: transparent;
    color: var(--primary-dark);
    border: 2px solid var(--primary-orange);
    padding: 12px 24px;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    justify-content: center;
}

.btn-outline:hover {
    background: rgba(230, 126, 34, 0.1);
}

/* Dynamic HTML elements from Gemini API */
.rendimento-card {
    background-color: #FDFBF0;
    border: 1px solid #F0ECE1;
    border-radius: 15px;
    padding: 20px;
    margin: 30px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.rendimento-info {
    flex: 1;
}

.rendimento-label {
    display: block;
    color: #CBA052;
    font-size: 0.8rem;
    font-weight: 800;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-bottom: 5px;
}

.rendimento-texto {
    font-size: 1.2rem;
    color: #333;
    font-weight: 500;
    margin-bottom: 0 !important;
}

.ingredientes-rodape {
    text-align: center;
    margin-top: 20px;
    margin-bottom: 10px;
}

.ingredientes-label {
    color: #A0A09C;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-bottom: 15px !important;
}

.tags-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
}

.tag {
    background-color: #F2F2F2;
    color: #666;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    display: flex;
    justify-content: flex-end; /* Slide from right */
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(3px);
}

.modal-content {
    position: relative;
    width: 90%;
    max-width: 400px;
    height: 100%;
    background: var(--bg-color);
    box-shadow: -5px 0 25px rgba(0,0,0,0.1);
    animation: slideIn 0.3s ease forwards;
    display: flex;
    flex-direction: column;
}

@keyframes slideIn {
    from { transform: translateX(100%); }
    to { transform: translateX(0); }
}

.modal.hidden .modal-content {
    animation: slideOut 0.3s ease forwards;
}

.modal-header {
    padding: 20px;
    background: var(--card-bg);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #ebebeb;
}

.modal-header h2 {
    font-size: 1.2rem;
}

.btn-close {
    background: transparent;
    border: none;
    font-size: 1.5rem;
    color: var(--text-muted);
    cursor: pointer;
}

.modal-body {
    padding: 20px;
    overflow-y: auto;
    flex-grow: 1;
}

.favorite-item {
    background: var(--card-bg);
    border-radius: 15px;
    padding: 15px;
    margin-bottom: 15px;
    box-shadow: var(--shadow-soft);
    position: relative;
}

.favorite-title {
    font-weight: 700;
    color: var(--primary-dark);
    margin-bottom: 10px;
    font-size: 1.1rem;
    padding-right: 30px;
}

.favorite-date {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.btn-delete-fav {
    position: absolute;
    top: 15px;
    right: 15px;
    color: #aaa;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.1rem;
}

.btn-delete-fav:hover {
    color: #e74c3c;
}

.btn-view-fav {
    width: 100%;
    background: rgba(230, 126, 34, 0.1);
    color: var(--primary-dark);
    border: none;
    padding: 10px;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-view-fav:hover {
    background: rgba(230, 126, 34, 0.2);
}

.empty-state {
    text-align: center;
    color: var(--text-muted);
    margin-top: 40px;
}

.empty-state i {
    font-size: 3rem;
    color: #ddd;
    margin-bottom: 15px;
}
