/* style.css - Harvest Moon DS Complete Profit Planner with seasonal colors */

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

body {
    background: #eef4da;
    font-family: 'Segoe UI', 'Poppins', 'Roboto', system-ui, sans-serif;
    padding: 2rem 1rem;
}

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

header {
    text-align: center;
    margin-bottom: 2rem;
}

header h1 {
    background: linear-gradient(135deg, #2b5e2f, #5b8c4e);
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
    font-size: 1.9rem;
}

header p {
    color: #3a5e2b;
    font-weight: 500;
}

/* Stacked sections */
.seasons-stack {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    margin-bottom: 2rem;
}

.season-card, .special-section {
    background: #fffef5;
    border-radius: 28px;
    box-shadow: 0 12px 24px rgba(0,0,0,0.05);
    padding: 1.2rem 1rem;
    border: 1px solid #cbdca8;
    width: 100%;
}

h2 {
    font-size: 1.4rem;
    font-weight: 700;
    color: #2c6730;
    border-left: 5px solid #86b33e;
    padding-left: 12px;
    margin-bottom: 1rem;
}

/* Add form */
.add-form {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: flex-end;
    background: #f5f9ea;
    padding: 16px;
    border-radius: 32px;
    margin-bottom: 1.2rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    color: #2c5e2a;
}

.form-group label {
    font-size: 0.7rem;
    letter-spacing: 0.5px;
    margin-left: 4px;
}

.form-group select, .form-group input {
    background: white;
    border: 1px solid #bfd9a6;
    border-radius: 40px;
    padding: 8px 14px;
    font-size: 0.8rem;
    font-weight: 500;
    min-width: 110px;
}

.checkbox-group {
    flex-direction: row;
    align-items: center;
    gap: 6px;
    background: #e2efcf;
    padding: 5px 14px;
    border-radius: 40px;
}

.checkbox-group label {
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
}

.btn-add, .btn-clear {
    border: none;
    padding: 8px 18px;
    border-radius: 40px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
}

.btn-add {
    background: #5d8a3c;
    color: white;
}
.btn-add:hover {
    background: #3e6724;
    transform: scale(0.97);
}

.btn-clear {
    background: #e0a800;
    color: #2d2b1f;
}
.btn-clear:hover {
    background: #c08e00;
    transform: scale(0.97);
}

.btn-clear-all {
    background: #b33b2c;
    color: white;
    border: none;
    padding: 8px 20px;
    border-radius: 40px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-left: 1rem;
}
.btn-clear-all:hover {
    background: #8f2a1d;
    transform: scale(0.97);
}

/* Table wrapper */
.table-wrapper {
    overflow-x: auto;
    border-radius: 20px;
    margin: 1rem 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.03);
}

.timeline-table {
    min-width: 100%;
    border-collapse: collapse;
    font-size: 0.75rem;
    background: white;
    border-radius: 16px;
}

.timeline-table th, .timeline-table td {
    border: 1px solid #dde5c3;
    padding: 8px 4px;
    text-align: center;
    vertical-align: middle;
}

.timeline-table th {
    background: #cfe3a4;
    color: #2a491d;
    font-weight: 700;
    position: sticky;
    top: 0;
    background-color: #d4e6b0;
}

/* Fixed first column */
.timeline-table th:first-child,
.timeline-table td:first-child {
    position: sticky;
    left: 0;
    background-color: #fefce8;
    z-index: 1;
    font-weight: 600;
    min-width: 150px;
    text-align: left;
}

.timeline-table td:first-child {
    background-color: #fffff0;
    font-size: 0.7rem;
    line-height: 1.3;
}

/* Seasonal background colors for table cells (applied via classes) */
/* For 30-day tables (whole table) */
.spring-bg td:not(:first-child), .spring-bg th:not(:first-child) {
    background-color: #e6f3e6 !important;
}
.summer-bg td:not(:first-child), .summer-bg th:not(:first-child) {
    background-color: #fff0cc !important;
}
.autumn-bg td:not(:first-child), .autumn-bg th:not(:first-child) {
    background-color: #ffe0cc !important;
}

/* For 120-day tables: each cell gets individual season class */
.season-spring {
    background-color: #e6f3e6 !important;
}
.season-summer {
    background-color: #fff0cc !important;
}
.season-autumn {
    background-color: #ffe0cc !important;
}
.season-winter {
    background-color: #e0f0ff !important;
}

/* Keep day states visible over seasonal colors */
.day-sowing, .day-harvest, .day-regrow, .multi-event {
    position: relative;
    z-index: 2;
}

/* States (overwrites background) */
.day-sowing { background-color: #c7e9b0 !important; font-weight: bold; color: #1f5420; }
.day-harvest { background-color: #ffe3a3 !important; font-weight: bold; color: #aa6f20; }
.day-regrow { background-color: #ffefbf !important; }
.day-empty { background-color: inherit; }

.action-btns {
    display: flex;
    gap: 6px;
    justify-content: center;
}

.edit-btn, .delete-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    padding: 4px 8px;
    border-radius: 20px;
}
.edit-btn { color: #e68a2e; }
.delete-btn { color: #bc4e2c; }
.edit-btn:hover { background: #ffefe2; }
.delete-btn:hover { background: #ffe0d4; }

.season-summary {
    background: #e5f0d4;
    border-radius: 28px;
    padding: 10px 18px;
    text-align: right;
    font-weight: bold;
    font-size: 1rem;
    color: #2b6429;
    margin-top: 8px;
}

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

.global-summary-card {
    background: linear-gradient(110deg, #2b6828, #55993b);
    border-radius: 32px;
    padding: 1.4rem;
    color: white;
    margin-top: 1rem;
}

.global-summary-card h2 {
    color: #ffefb0;
    border-left-color: #ffd966;
}

.global-stats {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 0.8rem;
}

.stat-item {
    background: rgba(255,250,210,0.2);
    backdrop-filter: blur(4px);
    padding: 6px 20px;
    border-radius: 60px;
    font-weight: 600;
}

.grand-total {
    background: #f5b042;
    color: #2d451b;
}

@media (max-width: 860px) {
    .add-form {
        flex-direction: column;
        align-items: stretch;
    }
    .form-group { width: 100%; }
    .checkbox-group { justify-content: center; }
    .timeline-table th, .timeline-table td {
        padding: 5px 2px;
        font-size: 0.65rem;
    }
    .timeline-table th:first-child, .timeline-table td:first-child {
        min-width: 100px;
    }
    .global-stats {
        flex-direction: column;
        align-items: stretch;
    }
    .btn-clear-all {
        margin-left: 0;
        justify-content: center;
    }
}

.multi-event {
    padding: 0 !important;
    white-space: nowrap;
}
.multi-event span {
    display: inline-block;
    padding: 6px 4px;
    width: 28px;
    text-align: center;
}
.timeline-table td:last-child, .timeline-table th:last-child {
    min-width: 80px;
    width: 80px;
    background-color: inherit;
}
.harvest-sow .harvest-icon { background-color: #ffe3a3; }
.harvest-sow .sow-icon { background-color: #c7e9b0; }
.regrow-sow .regrow-icon { background-color: #ffefbf; }
.regrow-sow .sow-icon { background-color: #c7e9b0; }