/* Clean, Minimal Design - 4 Column Layout */

/* Variables */
:root {
    --primary: #c5976a;
    --secondary: #F5DEB3;
    --accent: #FFF8DC;
    --bg: #FFF8DC;
    --border: #BC8F8F;
    --text: #0000CD;
    --text-light: #DAA520;
    --success: #4682B4;
    --danger: #FF4500;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #E1C16E;
    color: var(--text);
    line-height: 1.5;
    font-size: 14px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1rem;
}

/* Header */
header {
    background: var(--primary);
    color: white;
    padding: 1rem 2rem;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid var(--secondary);
}

header h1 {
    font-size: 1.25rem;
    font-weight: 600;
}

.cloud-badge {
    font-size: 0.5em;
    background: rgba(255,255,255,0.2);
    padding: 0.2rem 0.5rem;
    border-radius: 3px;
}

.mode-toggle {
    margin-top: 0.75rem;
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.user-display {
    color: white;
    font-size: 0.8rem;
    padding: 0.3rem 0.7rem;
    background: rgba(255,255,255,0.15);
    border-radius: 3px;
}

/* Buttons */
.btn, .mode-btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    background: BDB76B;
    color: var(--primary);
    transition: opacity 0.2s;
}

.btn:hover, .mode-btn:hover { opacity: 0.9; }
.btn-primary { background: var(--primary); color: var(--text); }
.btn-secondary { background: var(--border); color: var(--text); }
.btn-large { padding: 0.7rem 1.5rem; font-size: 0.9rem; }
.btn-small { padding: 0.3rem 0.7rem; font-size: 0.8rem; }

/* Input Section Headers */
.input-section-header {
    margin: 2rem 0 1rem 0;
    padding: 0.75rem 1rem;
    background: var(--primary);
    color: red;
    border-radius: 3px;
}

.input-section-header h2 {
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
}

/* 4 Column Grid */
.input-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

/* Sections */
.accordion-section {
    background: #F5DEB3;
    border: 1px solid var(--border);
    border-radius: 3px;
}

.accordion-header {
    padding: 0.6rem 1rem;
    background: var(--accent);
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    border-bottom: 1px solid var(--border);
}

.accordion-content {
    padding: 1rem;
}

.accordion-section.collapsed .accordion-content {
    display: none;
}

/* Inputs */
.input-group {
    margin-bottom: 0.75rem;
}

.input-group label {
    display: block;
    margin-bottom: 0.25rem;
    font-size: 0.8rem;
    font-weight: 500;
}

.input-group input,
.input-group select {
    width: 100%;
    padding: 0.4rem;
    border: 1px solid var(--border);
    border-radius: 3px;
    font-size: 0.85rem;
}

.input-group input:focus,
.input-group select:focus {
    outline: red;
    border-color: var(--primary);
}

.input-group small {
    display: block;
    margin-top: 0.2rem;
    font-size: 0.7rem;
    color: var(--text-light);
}

/* Presets */
.preset-section {
    background: #F5DEB3;
    border: 1px solid var(--border);
    border-radius: 3px;
    padding: 1rem;
    margin-bottom: 1.5rem;
}

.preset-section h2 {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.preset-controls {
    display: flex;
    gap: 0.5rem;
}

.preset-controls select {
    flex: 1;
    padding: 0.4rem;
    border: 1px solid var(--border);
    border-radius: 3px;
    font-size: 0.85rem;
}

/* Calculate */
.calculate-section {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    margin-bottom: 1.5rem;
}

/* Results - 4 Column Grid */
.results-section {
    margin-bottom: 1.5rem;
}

.results-section h2 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.5rem;
}

.results-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}

.result-card {
    background: #F5DEB3;
    border: 1px solid var(--border);
    border-radius: 3px;
    padding: 1rem;
}

.result-card h3 {
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.4rem;
}

.result-item {
    display: flex;
    justify-content: space-between;
    padding: 0.3rem 0;
    font-size: 0.8rem;
    border-bottom: 1px solid #F5DEB3;
    
}

.result-item:last-child {
    border-bottom: none;
}

/* Timeline */
.timeline-section,
.checklist-section,
.history-section {
    background: #F5DEB3;
    border: 1px solid var(--border);
    border-radius: 3px;
    padding: 1rem;
    margin-bottom: 1.5rem;
}

.timeline-section h2,
.checklist-section h2,
.history-section h2 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.timeline-stage {
    padding: 0.6rem;
    background: var(--accent);
    border-left: 2px solid var(--primary);
    margin-bottom: 0.4rem;
    font-size: 0.85rem;
}

.stage-header {
    display: flex;
    justify-content: space-between;
}

.stage-details {
    font-size: 0.75rem;
    color: var(--text-light);
    margin-top: 0.2rem;
}

/* Checklist */
.checklist-item {
    padding: 0.4rem;
    display: flex;
    gap: 0.6rem;
    border-bottom: 1px solid var(--border);
    font-size: 0.85rem;
}

.checklist-item input[type="checkbox"] {
    width: 16px;
    height: 16px;
}

/* History */
.history-item {
    background: var(--accent);
    border: 1px solid var(--border);
    border-radius: 3px;
    padding: 1rem;
    margin-bottom: 0.75rem;
}

.history-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.4rem;
}

.history-title {
    font-weight: 600;
    font-size: 0.9rem;
}

.history-date {
    font-size: 0.75rem;
    color: var(--text-light);
}

.history-details {
    font-size: 0.8rem;
    color: var(--text-light);
}

.history-actions {
    display: flex;
    gap: 0.4rem;
}

.history-full-details {
    margin-top: 1rem;
    padding: 1rem;
    background: #FFE4B5;
    border: 1px solid var(--border);
    border-radius: 3px;
}

.history-full-details h4 {
    font-size: 0.85rem;
    font-weight: 600;
    margin: 0.75rem 0 0.4rem 0;
}

.history-full-details h4:first-child {
    margin-top: 0;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    border-radius: 3px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
}

.modal-header {
    padding: 1rem;
    background: var(--primary);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    font-size: 1rem;
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    width: 28px;
    height: 28px;
}

.modal-body {
    padding: 1rem;
}

.auth-tabs {
    display: flex;
    background: var(--border);
}

.auth-tab {
    flex: 1;
    padding: 0.6rem;
    background: var(--border);
    border: none;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
}

.auth-tab.active {
    background: white;
    color: var(--primary);
}

.auth-form {
    display: none;
    padding: 1rem;
}

.auth-form.active {
    display: block;
}

.auth-form h2 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    text-align: center;
}

.settings-section {
    margin-bottom: 1rem;
}

.settings-section h3 {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.3rem;
}

.settings-note {
    font-size: 0.75rem;
    color: var(--text-light);
    margin-top: 0.3rem;
}

.recipe-manager-item {
    display: flex;
    justify-content: space-between;
    padding: 0.6rem;
    background: var(--accent);
    border: 1px solid var(--border);
    border-radius: 3px;
    margin-bottom: 0.4rem;
}

.recipe-manager-name {
    font-weight: 500;
    font-size: 0.85rem;
}

.recipe-manager-details {
    font-size: 0.75rem;
    color: var(--text-light);
}

.recipe-manager-actions {
    display: flex;
    gap: 0.4rem;
}

/* Warnings */
.warning {
    padding: 0.4rem;
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
    border-radius: 3px;
    font-size: 1.9rem;
    margin-top: 0.4rem;
}

.error-message {
    color: var(--danger);
    background: #fee;
    padding: 0.6rem;
    border-radius: 3px;
    margin: 0.8rem 0;
    display: none;
    font-size: 0.8rem;
}

.error-message.active {
    display: block;
}

/* Expert Mode */
.expert-only {
    display: none;
}

body.expert-mode .expert-only {
    display: block;
}

/* Responsive */
@media (max-width: 1200px) {
    .input-grid,
    .results-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 900px) {
    .input-grid,
    .results-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .input-grid,
    .results-grid {
        grid-template-columns: 1fr;
    }
}

/* Print */
@media print {
    .btn, .mode-btn, button, .timeline-controls, .history-controls {
        display: none;
    }
}
