:root {
    --primary: #6d4c41;
    --primary-light: #9c786c;
    --primary-dark: #40241a;
    --secondary: #f5f5f5;
    --text: #333;
    --error: #d32f2f;
    --success: #388e3c;
    --info: #1976d2;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

body {
    background-color: var(--secondary);
    color: var(--text);
    line-height: 1.5;
    padding: 12px;
    max-width: 100%;
    margin: 0 auto;
    font-size: 15px;
}

header {
    background-color: var(--primary);
    color: white;
    padding: 1rem;
    text-align: center;
    border-radius: 8px 8px 0 0;
}

.meal-icon {
    height: 1.8em;
    margin-right: 8px;
}

h1 {
    margin-bottom: 0.4rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    line-height: 1.3;
}

.subtitle {
    font-size: 0.75rem;
    opacity: 0.9;
}

.version-number {
    color: white;
    font-size: 0.75rem;
    opacity: 0.7;
    margin-top: 0.5rem;
    font-family: "Courier New", monospace;
}

.container {
    background-color: white;
    border-radius: 0 0 10px 10px;
    padding: 1rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.input-section {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.input-group {
    margin-bottom: 0.8rem;
}

label {
    display: block;
    margin-bottom: 0.3rem;
    font-weight: 600;
    color: var(--primary);
    font-size: 0.9rem;
}

select, input[type="number"] {
    width: 100%;
    padding: 0.7rem;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.95rem;
}

select:focus, input[type="number"]:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(109, 76, 65, 0.2);
}

.error-message {
    color: var(--error);
    font-size: 0.75rem;
    margin-top: 0.2rem;
    display: none;
}

.btn {
    background-color: var(--primary);
    color: white;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 6px;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.3s;
    display: block;
    width: 100%;
    margin-top: 1rem;
}

.btn:hover {
    background-color: var(--primary-dark);
}

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

.results {
    margin-top: 1.5rem;
    background-color: rgba(109, 76, 65, 0.1);
    padding: 1rem;
    border-radius: 8px;
    display: none;
}

.results h2 {
    color: var(--primary);
    margin-bottom: 1rem;
    text-align: center;
    font-size: 1.2rem;
}

.recipe-section {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background-color: white;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.recipe-section h3 {
    color: var(--primary-dark);
    margin-bottom: 0.8rem;
    font-size: 1.1rem;
    border-bottom: 1px solid var(--primary-light);
    padding-bottom: 0.5rem;
}

.ingredient-group {
    margin-bottom: 1rem;
    padding: 0.8rem;
    background-color: rgba(109, 76, 65, 0.05);
    border-radius: 6px;
}

.ingredient-group-title {
    font-weight: 600;
    color: var(--primary-dark);
    margin-bottom: 0.5rem;
    font-size: 1rem;
}

.ingredient-list, .instruction-list {
    list-style-type: none;
    padding-left: 0;
}

.ingredient-item, .instruction-item {
    padding: 0.5rem 0;
    border-bottom: 1px dashed #ddd;
}

.ingredient-item:last-child, .instruction-item:last-child {
    border-bottom: none;
}

.ingredient-quantity {
    font-weight: 600;
    color: var(--primary);
}

/* Complete Meal Styles */
.complete-meal-option {
    font-weight: 600;
    color: var(--primary-dark);
    background-color: rgba(56, 142, 60, 0.1);
}

.meal-category {
    font-style: italic;
    color: var(--primary-light);
    font-size: 0.8rem;
    margin-left: 0.5rem;
}

/* Style for optgroups */
optgroup {
    font-weight: 600;
    color: var(--primary-dark);
    padding: 8px 4px;
}

/* Different background for complete meals group */
optgroup[label*="Complete Meals"] {
    background-color: rgba(56, 142, 60, 0.1);
    border-top: 2px solid var(--success);
}

/* Style for individual proteins group */
optgroup[label*="Individual Proteins"] {
    background-color: rgba(109, 76, 65, 0.1);
    border-top: 2px solid var(--primary);
}

/* Style the options within each group */
optgroup[label*="Complete Meals"] option {
    padding-left: 20px;
    font-style: italic;
}

optgroup[label*="Individual Proteins"] option {
    padding-left: 20px;
}

/* Style for disabled separator options */
select option:disabled {
    background-color:white;
    color:black;
    font-weight: bold;
    text-align: center;
    font-style: italic;
    opacity: 1;
    padding: 8px 4px;
    margin: 5px 0;
}

/* Remove the default gray color for disabled options in some browsers */
select option:disabled {
    color:black !important;
}

/* Protein Info Styles */
.protein-info {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background-color: rgba(109, 76, 65, 0.1);
    border-radius: 8px;
    border-left: 4px solid var(--primary);
}

.protein-info h3 {
    color: var(--primary-dark);
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.protein-details {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

.protein-detail-item {
    padding: 0.8rem;
    background-color: white;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.protein-detail-title {
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 0.3rem;
    font-size: 0.9rem;
}

.protein-detail-content {
    font-size: 0.85rem;
    line-height: 1.4;
}

/* Protein Tip Styles */
.protein-tip-section {
    margin-top: 1rem;
    padding: 1rem;
    background-color: rgba(255, 235, 59, 0.2);
    border-left: 3px solid #ffc107;
    border-radius: 0 4px 4px 0;
}

.protein-tip-title {
    font-weight: 600;
    color: var(--primary-dark);
    margin-bottom: 0.5rem;
    font-size: 1rem;
}

.protein-tip-content {
    font-size: 0.85rem;
    line-height: 1.4;
}

@media (min-width: 768px) {
    .protein-details {
        grid-template-columns: repeat(2, 1fr);
    }
}

.instruction-step {
    font-weight: 600;
    color: var(--primary);
    margin-right: 0.5rem;
}

.instruction-time {
    display: inline-block;
    background-color: var(--primary-light);
    color: white;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
    margin-left: 0.5rem;
}

.instruction-tip {
    display: block;
    background-color: rgba(255, 235, 59, 0.2);
    border-left: 3px solid #ffc107;
    padding: 0.5rem;
    margin-top: 0.5rem;
    font-size: 0.8rem;
    border-radius: 0 4px 4px 0;
}

.instruction-detail {
    margin: 0.5rem 0;
    line-height: 1.6;
    font-size: 0.8rem;
}

/* Tips Toggle Styles */
.tips-toggle-section {
    text-align: center;
    margin-bottom: 1rem;
}

#toggleTipsBtn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    width: auto;
    padding: 0.5rem 1rem;
    margin-top: 0;
    font-size: 0.9rem;
}

.toggle-icon {
    font-size: 0.8rem;
    transition: transform 0.3s ease;
}

.tips-hidden .toggle-icon {
    transform: rotate(-90deg);
}

.instruction-tip.hidden {
    display: none;
}

.total-time {
    background-color: var(--primary);
    color: white;
    padding: 0.8rem;
    border-radius: 6px;
    text-align: center;
    margin-bottom: 1.5rem;
    font-weight: 600;
}

.variation-item {
    margin-bottom: 0.8rem;
    padding: 0.8rem;
    background-color: rgba(109, 76, 65, 0.05);
    border-radius: 6px;
}

.variation-title {
    font-weight: 600;
    color: var(--primary-dark);
    margin-bottom: 0.3rem;
}

.email-section {
    margin-top: 1.5rem;
    padding: 1rem;
    background-color: rgba(255, 255, 255, 0.8);
    border-radius: 6px;
    text-align: center;
}

#mobileEmailBtn {
    font-size: 1.1rem;
    padding: 1rem;
}

/* Cooking Notes Section Styles */
.cooking-notes {
    margin-top: 2rem;
    padding: 1rem;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.cooking-notes h2 {
    color: var(--primary);
    margin-bottom: 1.5rem;
    text-align: center;
    font-size: 1.3rem;
}

.notes-section {
    margin-bottom: 2rem;
}

.notes-section h3 {
    color: var(--primary-dark);
    margin-bottom: 1rem;
    font-size: 1.1rem;
    border-bottom: 1px solid var(--primary-light);
    padding-bottom: 0.5rem;
}

.table-scroll-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 1rem;
}

.notes-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px;
}

.notes-table th {
    background-color: var(--primary-dark);
    color: white;
    padding: 0.75rem;
    text-align: left;
    font-weight: 600;
}

.notes-table td {
    padding: 0.75rem;
    border-bottom: 1px solid #ddd;
}

.notes-table tr:nth-child(even) {
    background-color: rgba(109, 76, 65, 0.05);
}

.season-card {
    margin-bottom: 1.5rem;
    border: 1px solid #ddd;
    border-radius: 6px;
    overflow: hidden;
}

.season-header {
    padding: 0.75rem;
    color: white;
    font-weight: 600;
}

.season-body {
    padding: 1rem;
}

.season-badge {
    display: inline-block;
    background-color: rgba(255, 255, 255, 0.9);
    color: #333;
    padding: 0.3rem 0.6rem;
    border-radius: 4px;
    margin: 0.2rem;
    font-size: 0.85rem;
}

.notes-alert {
    padding: 1rem;
    border-radius: 6px;
    margin-bottom: 1rem;
    border-left: 4px solid;
}

.notes-alert-info {
    background-color: rgba(25, 118, 210, 0.1);
    border-left-color: var(--info);
}

.notes-alert-warning {
    background-color: rgba(255, 193, 7, 0.1);
    border-left-color: #ffc107;
}

.notes-alert-success {
    background-color: rgba(56, 142, 60, 0.1);
    border-left-color: var(--success);
}

/* Flavor Pairings Styles */
.flavor-pairings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.flavor-card {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.flavor-header {
    padding: 1rem;
    color: white;
    text-align: center;
}

.flavor-header h4 {
    margin: 0;
    font-size: 1.2rem;
}

.flavor-body {
    padding: 1.5rem;
}

.flavor-category {
    margin-bottom: 1.5rem;
}

.flavor-category:last-child {
    margin-bottom: 0;
}

.flavor-category h5 {
    margin-bottom: 0.5rem;
    color: var(--primary-dark);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.flavor-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.flavor-tag {
    background-color: rgba(109, 76, 65, 0.1);
    color: var(--text);
    padding: 0.3rem 0.6rem;
    border-radius: 4px;
    font-size: 0.85rem;
    display: inline-block;
}

/* Ensure complete meal options are properly styled */
select option.complete-meal-option {
    font-weight: 600;
    color: var(--primary-dark);
    background-color: rgba(56, 142, 60, 0.1);
    padding: 8px 4px;
}

/* Style disabled dropdowns */
select:disabled {
    background-color: #f5f5f5;
    color: #999;
    cursor: not-allowed;
}

/* Add some spacing between individual proteins and complete meals in dropdown */
select option[value="classic_beef_stew"] {
    border-top: 2px solid var(--primary-light);
    margin-top: 5px;
    padding-top: 8px;
}

@media (min-width: 768px) {
    .flavor-pairings-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

#flavorVariationsSection {
    display: none; /* Hidden by default, shown when content exists */
}

.flavor-profiles {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    margin-top: 1rem;
}

.flavor-profile {
    background: var(--bg-secondary);
    padding: 1rem;
    border-radius: 8px;
    border-left: 4px solid var(--accent-color);
}

.flavor-profile-name {
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.flavor-profile-details div {
    margin-bottom: 0.25rem;
    font-size: 0.9rem;
}

.recipe-overview {
    font-style: italic;
    margin-top: 0.5rem;
    color: var(--text-secondary);
}

@media (min-width: 1024px) {
    .flavor-pairings-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.app-footer {
    background-color: var(--primary-dark);
    color: white;
    padding: 1rem;
    text-align: center;
    margin-top: 1.5rem;
    border-radius: 0 0 10px 10px;
    font-size: 0.85rem;
}

.footer-content {
    max-width: 600px;
    margin: 0 auto;
}

.footer-disclaimer {
    font-size: 0.75rem;
    opacity: 0.8;
    margin: 0.4rem 0;
}

.footer-links {
    margin-top: 0.8rem;
}

.footer-links a {
    color: white;
    text-decoration: none;
    font-size: 0.8rem;
    padding: 0 0.3rem;
}

.footer-links a:hover {
    text-decoration: underline;
}

.back-to-top {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    margin-top: 0.8rem;
    cursor: pointer;
    font-size: 0.8rem;
    transition: background 0.3s;
}

/* Table of Contents Styles */
.toc-container {
    margin: 1.5rem 0;
    padding: 1.5rem;
    background-color: rgba(109, 76, 65, 0.05);
    border-radius: 8px;
    border-left: 4px solid var(--primary);
}

.toc-container h3 {
    color: var(--primary-dark);
    margin-bottom: 1rem;
    text-align: center;
    font-size: 1.2rem;
}

.toc-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 0.8rem;
}

.toc-btn {
    display: block;
    padding: 0.8rem 1rem;
    background-color: white;
    color: var(--primary-dark);
    text-decoration: none;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    text-align: center;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(109, 76, 65, 0.2);
}

.toc-btn:hover {
    background-color: var(--primary);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.ingredient-substitutes {
    font-size: 0.85rem;
    font-style: italic;
    color: var(--primary-light); /* or use a specific color like #888 or #6c757d */
    margin-top: 0.2rem;
    margin-left: 1.5rem;
    line-height: 1.3;
}

@media (max-width: 768px) {
    .toc-buttons {
        grid-template-columns: 1fr;
    }
}

@media (min-width: 500px) {
    .input-section {
        grid-template-columns: repeat(2, 1fr);
    }
    
    body {
        font-size: 16px;
    }
}

@media (min-width: 768px) {
    .input-section {
        grid-template-columns: repeat(3, 1fr);
    }
    
    body {
        padding: 16px;
    }
}

/* Flavor Profiles Styling */
.flavor-profiles {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 0.5rem;
}

.flavor-profile {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 1rem;
    border-left: 3px solid var(--primary);
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.flavor-profile-name {
    font-weight: bold;
    color: var(--primary);
    margin-bottom: 0.5rem;
    font-size: 1rem;
}

.flavor-profile-details > div {
    margin-bottom: 0.3rem;
    font-size: 0.9rem;
    line-height: 1.4;
}

.flavor-profile-details strong {
    color: var(--primary-dark);
}

.recipe-overview {
    font-style: italic;
    color: var(--text-secondary);
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px dashed var(--border-color);
    font-size: 0.85rem;
}
/* Style optgroup labels for better visibility */
optgroup {
    font-weight: bold;
    color: #333;
    font-size: 0.95em;
    padding: 8px 0;
    background-color: #f8f8f8;
}

/* Style options within optgroups */
optgroup option {
    font-weight: normal;
    color: #555;
    padding-left: 20px; /* Indent options for hierarchy */
}

/* Mobile-specific optgroup styling */
@media (max-width: 768px) {
    optgroup {
        font-size: 15px;
        background-color: #f0f0f0;
        border-bottom: 1px solid #ddd;
        margin-top: 5px;
    }
    
    optgroup option {
        font-size: 16px; /* Prevents iOS zoom */
        padding: 12px 8px 12px 25px;
    }
}

/* Highlight selected option */
select option:checked {
    background-color: #e3f2fd;
    color: #1565c0;
}
