﻿:root {
    --primary: #2d6a4f;
    --primary-light: #40916c;
    --primary-dark: #1b4332;
    --secondary: #d8f3dc;
    --accent: #fca311;
    --text-main: #2b2d42;
    --text-muted: #6c757d;
    --bg-main: #f8f9fa;
    --bg-card: #ffffff;
    --radius: 16px;
    --shadow-sm: 0 4px 6px rgba(0,0,0,0.05);
    --shadow-md: 0 10px 20px rgba(0,0,0,0.08);
    --shadow-lg: 0 20px 40px rgba(0,0,0,0.12);
    --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

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

body {
    font-family: 'Noto Sans SC', sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

/* HEADER / HERO SECTION */
.hero {
    background: linear-gradient(135deg, rgba(45, 106, 79, 0.85), rgba(27, 67, 50, 0.9)), url('images/hero_farm_bg.png') center/cover no-repeat;
    padding: 1.5rem 1.5rem 2rem;
    position: relative;
    overflow: visible;
    z-index: 10;
}

.hero-bg-wrapper {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    overflow: hidden;
    z-index: -1;
}

.hero-bg {
    width: 100%;
    height: 100%;
    background-image: linear-gradient(rgba(27, 67, 50, 0.8), rgba(45, 106, 79, 0.7)), url('https://images.unsplash.com/photo-1595856407074-ce793081e4b9?auto=format&fit=crop&w=1920&q=80');
    background-size: cover;
    background-position: center;
    animation: zoom 20s infinite alternate linear;
}

@keyframes zoom {
    from { transform: scale(1); }
    to { transform: scale(1.05); }
}

.hero-content {
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
    z-index: 1;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 15px 20px;
    border-radius: var(--radius);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: var(--shadow-lg);
}

.logo-container {
    margin-bottom: 10px;
}
.site-logo {
    max-width: 90px;
    height: auto;
    border-radius: 50%;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    border: 3px solid #fff;
    transition: transform 0.3s ease;
}
.site-logo:hover {
    transform: translateY(-5px);
}

.hero p {
    font-size: 1rem;
    margin-bottom: 1rem;
    opacity: 0.9;
}

.region-selector {
    background: rgba(255, 255, 255, 0.95);
    padding: 10px 15px;
    border-radius: var(--radius);
    color: var(--text-main);
    box-shadow: var(--shadow-md);
    transition: var(--transition);
}

.region-selector:hover {
    transform: translateY(-2px);
}

.region-selector label {
    display: block;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--primary-dark);
}

.region-selector select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--secondary);
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    color: var(--text-main);
    outline: none;
    transition: var(--transition);
    appearance: none;
    background: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e") no-repeat right 1rem center;
    background-size: 1em;
}

.region-selector select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(45, 106, 79, 0.2);
}

/* Custom Select */
.custom-select-wrapper {
    position: relative;
    user-select: none;
    width: 100%;
}
.custom-select {
    position: relative;
    font-size: 1.1rem;
    cursor: pointer;
    transition: var(--transition);
}
.select-trigger {
    background: rgba(255, 255, 255, 0.9);
    border: 2px solid #a8e6cf;
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
    padding: 0.8rem 1.2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: border-radius 0.2s;
}
.custom-select.open .select-trigger {
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    border-bottom-color: transparent;
}
.arrow {
    font-size: 0.8rem;
    color: var(--text-light);
    transition: transform 0.3s;
}
.custom-select.open .arrow {
    transform: rotate(180deg);
}
.custom-options {
    position: absolute;
    top: calc(100% + 5px);
    left: 0;
    right: auto;
    width: max-content;
    min-width: 100%;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 100;
    max-height: 300px;
    overflow-y: auto;
    overflow-x: hidden;
}
.custom-select.open .custom-options {
    display: block;
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.custom-option {
    padding: 0.6rem 1rem;
    border-bottom: 1px solid #eee;
    transition: background 0.2s;
    white-space: nowrap;
    overflow: hidden;
}
.custom-option:last-child {
    border-bottom: none;
}
.custom-option:hover {
    background: #f0fdf4;
}
.custom-option strong {
    font-weight: 800;
    color: var(--primary);
    margin-right: 8px;
    font-size: 0.85rem;
}
.custom-option span {
    font-size: 0.9rem;
    color: var(--text-light);
}

.region-desc {
    margin-top: 1rem;
    font-size: 0.95rem;
    color: var(--text-muted);
    font-style: italic;
}

.current-month-card {
    background: var(--primary);
    color: white;
    padding: 1.5rem;
    border-radius: var(--radius);
    margin-bottom: 2rem;
    text-align: center;
    box-shadow: var(--shadow-md);
}

/* Main Content */
.container {
    max-width: 1440px;
    margin: 0 auto;
    padding: 40px 20px;
}

.main-tabs {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 40px;
}

.main-tab-btn {
    padding: 15px 25px;
    border: none;
    border-radius: 16px;
    background: var(--bg-card);
    color: var(--text-muted);
    font-size: 1.2rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow-md);
    font-family: inherit;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.main-tab-btn:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

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

.filter-section {
    margin-bottom: 40px;
    display: flex;
    justify-content: center;
}

.category-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
}

.filter-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 30px;
    background: var(--bg-card);
    color: var(--text-muted);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
    font-family: inherit;
}

.filter-btn:hover {
    background: var(--secondary);
    color: var(--primary-dark);
    transform: translateY(-2px);
}

.filter-btn.active {
    background: var(--primary);
    color: white;
    box-shadow: 0 6px 12px rgba(45, 106, 79, 0.3);
}

.flat-category-filters {
    display: inline-flex;
    flex-wrap: wrap;
    background: #f1f5f9;
    border-radius: 40px;
    padding: 6px;
    box-shadow: inset 0 2px 5px rgba(0,0,0,0.04), 0 1px 2px rgba(255,255,255,0.8);
    border: 1px solid rgba(255,255,255,0.5);
    justify-content: center;
    gap: 5px;
}

.flat-filter-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 30px;
    background: transparent;
    color: #64748b;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: inherit;
}

.flat-filter-btn:hover:not(.active) {
    color: #334155;
    background: rgba(255,255,255,0.6);
}

.flat-filter-btn.active {
    background: #ffffff;
    color: var(--primary);
    box-shadow: 0 4px 15px rgba(0,0,0,0.06), 0 1px 3px rgba(0,0,0,0.03);
    transform: translateY(-1px);
}

/* Vegetable Grid */
.vegetable-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
}

.veg-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    cursor: pointer;
    position: relative;
    border: 1px solid rgba(0,0,0,0.03);
}

.veg-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
}

.veg-img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.veg-card:hover .veg-img {
    transform: scale(1.05);
}

.veg-content {
    padding: 20px;
}

.veg-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.veg-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--primary-dark);
    display: flex;
    align-items: center;
    gap: 8px;
}

.veg-category {
    font-size: 0.8rem;
    padding: 4px 10px;
    background: var(--secondary);
    color: var(--primary-dark);
    border-radius: 20px;
    font-weight: 500;
}

.veg-desc {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 15px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.veg-calendar {
    background: var(--bg-main);
    padding: 12px;
    border-radius: 8px;
    font-size: 0.9rem;
    color: var(--primary-dark);
    border-left: 4px solid var(--primary);
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.veg-calendar-icon {
    margin-top: 2px;
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    padding: 20px;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.modal {
    background: var(--bg-card);
    width: 100%;
    max-width: 800px;
    max-height: 90vh;
    border-radius: var(--radius);
    overflow-y: auto;
    position: relative;
    transform: scale(0.95) translateY(20px);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-shadow: var(--shadow-lg);
}

.modal-overlay.active .modal {
    transform: scale(1) translateY(0);
}

.close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: white;
    border: none;
    font-size: 1.5rem;
    color: var(--text-main);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--shadow-md);
    z-index: 10;
    transition: var(--transition);
}

.close-btn:hover {
    background: var(--primary);
    color: white;
    transform: rotate(90deg);
}

.modal-header {
    height: 300px;
    position: relative;
}

.modal-header img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.modal-header-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 40px 30px 20px;
    background: linear-gradient(transparent, rgba(0,0,0,0.8));
    color: white;
}

.modal-title {
    font-size: 2.5rem;
    font-weight: 900;
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-body {
    padding: 30px;
}

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

.modal-section h3 {
    color: var(--primary-dark);
    font-size: 1.3rem;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--secondary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.stage-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.stage-item {
    display: flex;
    gap: 20px;
    background: var(--bg-main);
    padding: 20px;
    border-radius: 12px;
    border-left: 4px solid var(--primary-light);
    transition: var(--transition);
}

.stage-item:hover {
    transform: translateX(5px);
    box-shadow: var(--shadow-sm);
}

.stage-icon {
    width: 50px;
    height: 50px;
    background: var(--secondary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
    color: var(--primary-dark);
}

.stage-item h4 {
    color: var(--primary);
    margin-bottom: 0.5rem;
}

/* 病虫害防治模块样式 */
.pest-section {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 2px dashed rgba(46, 125, 50, 0.2);
}

.pest-section h3 {
    color: var(--primary);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.pest-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.pest-item {
    display: flex;
    gap: 1.5rem;
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease;
    border-left: 4px solid var(--primary);
}

.pest-item:hover {
    transform: translateY(-2px);
}

.pest-img {
    width: 140px;
    height: 140px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.pest-details {
    flex: 1;
}

.pest-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.8rem;
}

.pest-header h4 {
    margin: 0;
    font-size: 1.1rem;
    color: #333;
}

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

.pest-tag {
    font-size: 0.8rem;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    font-weight: 500;
}

.pest-tag.env-greenhouse {
    background: #e3f2fd;
    color: #1976d2;
}

.pest-tag.env-open_field {
    background: #fff3e0;
    color: #f57c00;
}

.pest-tag.env-universal {
    background: #f3e5f5;
    color: #7b1fa2;
}

.pest-tag.type-disease {
    background: #fce4ec;
    color: #c2185b;
}

.pest-tag.type-pest {
    background: #e8f5e9;
    color: #388e3c;
}

.pest-cause, .pest-prevent {
    font-size: 0.95rem;
    line-height: 1.5;
    color: #555;
    margin-bottom: 0.5rem;
}

.pest-cause strong {
    color: #d32f2f;
}

.pest-prevent strong {
    color: var(--primary);
}

/* Responsive for pest */
@media (max-width: 600px) {
    .pest-item {
        flex-direction: column;
        gap: 1rem;
    }
    .pest-img {
        width: 100%;
        height: 200px;
    }
}

.stage-content h4 {
    color: var(--primary-dark);
    margin-bottom: 8px;
    font-size: 1.1rem;
}

.stage-content p {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.6;
}

footer {
    text-align: center;
    padding: 40px 20px;
    background: var(--primary-dark);
    color: rgba(255,255,255,0.7);
    margin-top: 60px;
}

/* Responsive */
@media (max-width: 768px) {
    .hero h1 { font-size: 2rem; }
    .hero p { font-size: 1rem; }
    .hero-content { padding: 20px; }
    
    .vegetable-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }
    
    .modal-title { font-size: 2rem; }
    .stage-item { flex-direction: column; gap: 10px; }
}

/* TOP LEFT NAV & SEARCH (Added for UI update) */
.top-right-nav {
    position: absolute;
    top: 15px;
    right: 20px;
    display: flex;
    align-items: center;
    z-index: 20;
}

.auth-btn {
    background: white;
    color: #333;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.95rem;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    align-items: center;
}

.auth-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.15);
}

.top-left-nav {
    position: absolute;
    top: 20px;
    left: 20px;
    z-index: 200;
    display: flex;
    align-items: center;
    gap: 5px;
    background: rgba(255, 255, 255, 0.95);
    padding: 4px 12px;
    border-radius: 30px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
}

.top-left-nav .nav-label {
    color: var(--primary-dark);
    font-weight: 700;
    font-size: 0.85rem;
    white-space: nowrap;
}

.top-left-nav .nav-select {
    width: auto;
    min-width: 110px;
}

.top-left-nav .select-trigger {
    padding: 2px 6px;
    border: none;
    background: transparent;
    box-shadow: none;
    font-size: 0.85rem;
    color: var(--primary);
    font-weight: bold;
}

.search-container {
    margin-top: 25px;
    width: 100%;
    max-width: 750px;
    margin-left: auto;
    margin-right: auto;
}

.search-input {
    width: 100%;
    padding: 16px 25px;
    font-size: 1.15rem;
    border: 2px solid rgba(255,255,255,0.2);
    border-radius: 30px;
    background: rgba(255,255,255,0.9);
    color: var(--text-main);
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    outline: none;
}

.search-input:focus {
    background: #fff;
    border-color: var(--primary-light);
    box-shadow: 0 8px 32px rgba(45, 106, 79, 0.2);
}

.search-input::placeholder {
    color: #888;
}

/* Calendar Styles */
.calendar-wrapper {
    padding: 20px;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.month-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.month-card.current-month {
    border: 2px solid #f59e0b;
    box-shadow: 0 0 15px rgba(245, 158, 11, 0.3);
    transform: scale(1.02);
}

.month-card.current-month .month-card-header {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}

.month-card.current-month .veg-count {
    background: rgba(255,255,255,0.3);
    font-weight: bold;
}

.month-card-header {
    background: var(--primary);
    color: #fff;
    padding: 12px 20px;
    font-size: 1.2rem;
    font-weight: bold;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.month-card-header .veg-count {
    font-size: 0.9rem;
    background: rgba(255,255,255,0.2);
    padding: 2px 8px;
    border-radius: 12px;
}

.month-card-body {
    padding: 15px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    min-height: 80px;
}

.calendar-veg-item {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.9rem;
    color: #166534;
    cursor: pointer;
    transition: all 0.2s;
}

.calendar-veg-item:hover {
    background: #dcfce7;
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}

.empty-month {
    color: #aaa;
    font-size: 0.9rem;
    width: 100%;
    text-align: center;
    margin-top: 20px;
}

/* My Garden Styles */
.mygarden-wrapper {
    max-width: 1200px;
    margin: 0 auto;
}

.garden-control-section {
    background: #fdfbf7;
    border: 2px dashed #d1d5db;
    border-radius: 12px;
    padding: 20px;
    margin-top: 20px;
}

.garden-control-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 15px;
    flex-wrap: wrap;
    gap: 15px;
}

.date-picker-group {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 500;
}

.date-picker-group input {
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 8px;
    font-family: inherit;
    outline: none;
}

.date-picker-group input:disabled {
    background: #e5e7eb;
    cursor: not-allowed;
}

#toggle-garden-btn, #toggle-fert-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
}

#toggle-garden-btn.add-btn, #toggle-fert-btn.add-btn {
    background: var(--primary);
    color: white;
}

#toggle-garden-btn.add-btn:hover, #toggle-fert-btn.add-btn:hover {
    background: var(--primary-dark);
}

#toggle-garden-btn.remove-btn, #toggle-fert-btn.remove-btn {
    background: #fee2e2;
    color: #b91c1c;
}

#toggle-garden-btn.remove-btn:hover, #toggle-fert-btn.remove-btn:hover {
    background: #fca5a5;
}

.mygarden-card {
    border: 2px solid var(--primary-light);
    background: #fff;
}

.plant-date {
    color: #6b7280;
    font-size: 0.9rem;
    margin-top: 5px;
}

.garden-status {
    margin-top: 15px;
    display: flex;
    align-items: center;
}

.days-badge {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: bold;
    box-shadow: 0 2px 4px rgba(16, 185, 129, 0.3);
}

/* Growth Timeline Styles */
.growth-timeline {
    display: flex;
    justify-content: space-between;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px dashed #e5e7eb;
    overflow-x: auto;
    gap: 10px;
    padding-bottom: 10px;
}

.timeline-stage {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    min-width: 60px;
    text-align: center;
}

.timeline-img {
    width: 90px;
    height: 90px;
    object-fit: contain;
    border-radius: 50%;
    border: 2px solid #e2e8f0;
    background: #f8fafc;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 5px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
}

.timeline-stage.past .timeline-img {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.1);
}

.timeline-stage.current .timeline-img {
    border-color: #f59e0b;
    box-shadow: 0 0 0 6px rgba(245, 158, 11, 0.2), 0 10px 15px -3px rgba(245, 158, 11, 0.3);
    transform: scale(1.15);
    background: #fffbeb;
}

.timeline-stage.future .timeline-img {
    filter: grayscale(100%) opacity(0.4);
    border-color: #f1f5f9;
}

.timeline-label {
    font-size: 0.9rem;
    color: #64748b;
    margin-top: 12px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.timeline-stage.current .timeline-label {
    color: #d97706;
    font-weight: 700;
    transform: translateY(4px);
}

.timeline-stage.past .timeline-label {
    color: var(--primary-dark);
}

.quick-add-btn { background: var(--primary); color: white; border: none; padding: 6px 12px; border-radius: 20px; font-size: 0.85rem; cursor: pointer; transition: all 0.2s; font-weight: 500; }
.quick-add-btn:hover { transform: scale(1.05); background: #228b22; }
.quick-add-btn.added { background: #e0e0e0; color: #666; }

#mygarden-grid, #mygarden-fert-grid, #history-grid {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.mygarden-card {
    display: flex;
    background: var(--bg-card);
    padding: 30px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    position: relative;
    border: 1px solid rgba(0,0,0,0.05);
    transition: var(--transition);
}

.mygarden-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
}

.row-number {
    position: absolute;
    top: -15px;
    left: -15px;
    background: var(--primary);
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.2rem;
    box-shadow: 0 4px 8px rgba(45, 106, 79, 0.3);
    border: 3px solid white;
}

.mygarden-card .mygarden-main-img {
    width: 140px;
    height: 140px;
    margin-right: 30px;
    border-radius: 20px;
    object-fit: cover;
    flex-shrink: 0;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0,0,0,0.05);
}

.mygarden-card .veg-info {
    flex: 1;
    min-width: 0;
}

@media (max-width: 768px) {
    .mygarden-card {
        flex-direction: column;
    }
    .mygarden-card .mygarden-main-img {
        margin-bottom: 20px;
        margin-right: 0;
        width: 100px;
        height: 100px;
    }
}

/* Operation Timeline & Modal Styles */
.operations-timeline {
    margin-top: 25px;
    padding-top: 15px;
    border-top: 2px dashed rgba(22, 101, 52, 0.2);
}

.operations-timeline-title {
    font-size: 1.2rem;
    color: #f5c542; /* Softer, paler lemon yellow */
    font-weight: 500;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.op-list {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    position: relative;
    padding-left: 0;
    margin-bottom: 24px;
}

.op-list::before {
    display: none;
}

.op-item {
    position: relative;
    background: #ffffff;
    border-radius: 100px;
    padding: 6px 16px 6px 6px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.03);
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid rgba(0,0,0,0.02);
    transition: all 0.2s ease;
}

.op-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0,0,0,0.06);
}

.op-item:not(:last-child)::after {
    display: none;
}

.op-marker {
    display: none;
}

.op-date {
    font-size: 0.8rem;
    color: #64748b;
    margin-bottom: 0;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
}

.op-type-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #f0fdf4;
    color: #15803d;
    padding: 6px 12px;
    border-radius: 100px;
    font-size: 0.85rem;
    font-weight: 600;
    box-shadow: inset 0 0 0 1px rgba(21, 128, 61, 0.1);
}

.op-remark {
    font-size: 0.85rem;
    color: #475569;
    line-height: 1.2;
    border-left: 1px solid #e2e8f0;
    padding-left: 10px;
    margin-left: 4px;
}

.op-type-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.op-type-btn {
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: 12px;
    padding: 10px 5px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.85rem;
    color: #4b5563;
}

.main-tab-btn:hover {
    background: rgba(255, 255, 255, 0.9);
}

/* Sub Tab Buttons for My Garden */
.garden-view-toggle {
    display: inline-flex;
    background: #f1f5f9;
    border-radius: 40px;
    padding: 6px;
    box-shadow: inset 0 2px 5px rgba(0,0,0,0.04), 0 1px 2px rgba(255,255,255,0.8);
    border: 1px solid rgba(255,255,255,0.5);
}
.garden-view-toggle .toggle-btn {
    border: none;
    background: transparent;
    padding: 10px 28px;
    border-radius: 34px;
    color: #64748b;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    display: flex;
    align-items: center;
    gap: 8px;
}
.garden-view-toggle .toggle-btn.active {
    background: #ffffff;
    color: var(--primary);
    box-shadow: 0 4px 15px rgba(0,0,0,0.06), 0 1px 3px rgba(0,0,0,0.03);
    transform: translateY(-1px);
}
.garden-view-toggle .toggle-btn:hover:not(.active) {
    color: #334155;
    background: rgba(255,255,255,0.6);
}

.category-filters {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.op-type-btn:hover {
    background: rgba(255, 255, 255, 0.9);
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

.op-type-btn.active {
    background: #dcfce7;
    border-color: #86efac;
    color: #166534;
    font-weight: bold;
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.2);
}

.op-icon-large {
    font-size: 1.5rem;
    display: inline-block;
    margin-bottom: 4px;
}

.add-op-btn {
    width: 100%;
    background: #f8fafc;
    color: #475569;
    border: 1px solid #e2e8f0;
    padding: 12px;
    border-radius: 16px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
}

.add-op-btn:hover {
    background: #f1f5f9;
    color: #0f172a;
    border-color: #cbd5e1;
}

.glass-modal {
    background: rgba(245, 250, 245, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

/* Redesigned Premium Modal for Operations */
.op-glass-modal {
    background: #ffffff;
    border-radius: 24px;
    border: none;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    max-width: 420px;
    padding: 0;
    overflow: hidden;
    font-family: 'Noto Sans SC', sans-serif;
}

.op-glass-modal .close-btn {
    top: 20px;
    right: 20px;
    width: 32px;
    height: 32px;
    font-size: 1.2rem;
    background: #f1f5f9;
    color: #64748b;
    border-radius: 50%;
    border: none;
    transition: all 0.2s;
    backdrop-filter: none;
}
.op-glass-modal .close-btn:hover {
    background: #e2e8f0;
    color: #0f172a;
}

.op-modal-header {
    background: #ffffff;
    padding: 30px 30px 20px;
    text-align: center;
    border-bottom: none;
}

.op-modal-header h3 {
    margin: 0;
    color: #1e293b;
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: 0;
}

.op-modal-header p {
    margin: 6px 0 0 0;
    color: #64748b;
    font-size: 0.9rem;
}

.op-form-content {
    padding: 0 30px 30px;
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.op-form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.op-form-group label {
    font-size: 0.9rem;
    font-weight: 600;
    color: #475569;
}

.op-crop-selector-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 4px;
}

.crop-select-tag {
    padding: 6px 14px;
    border-radius: 20px;
    background: #f1f5f9;
    color: #64748b;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.2s ease;
    user-select: none;
    display: flex;
    align-items: center;
    gap: 4px;
}

.crop-select-tag:hover {
    background: #e2e8f0;
    color: #475569;
}

.crop-select-tag.active {
    background: #ecfdf5;
    color: #059669;
    border-color: #34d399;
}

.crop-select-tag .checkmark {
    display: none;
    font-size: 0.8rem;
}

.crop-select-tag.active .checkmark {
    display: inline;
}

.op-input {
    padding: 14px 16px;
    border-radius: 14px;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    font-size: 1rem;
    font-family: inherit;
    color: #1e293b;
    transition: all 0.2s ease;
    box-shadow: none;
}

.op-input:focus {
    outline: none;
    border-color: #10b981;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.op-textarea {
    resize: none;
    min-height: 100px;
}

.op-glass-modal .op-type-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.op-glass-modal .op-type-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 12px 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}

.op-glass-modal .op-type-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.05);
    border-color: #cbd5e1;
}

.op-glass-modal .op-type-btn.active {
    background: #f0fdf4;
    border-color: #22c55e;
    color: #15803d;
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.15);
}

.op-glass-modal .op-type-btn.active .op-icon-large {
    transform: scale(1.1);
}

.op-glass-modal .op-type-text {
    font-size: 0.8rem;
    font-weight: 500;
    color: #475569;
}

.op-glass-modal .op-type-btn.active .op-type-text {
    color: #15803d;
    font-weight: 600;
}

.op-submit-btn {
    margin-top: 10px;
    padding: 16px;
    border-radius: 16px;
    border: none;
    background: #10b981;
    color: white;
    font-size: 1.05rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.op-submit-btn:hover {
    transform: translateY(-2px);
    background: #059669;
    box-shadow: 0 6px 16px rgba(16, 185, 129, 0.35);
}

.op-icon-img {
    width: 40px;
    height: 40px;
    object-fit: contain;
    margin-bottom: 2px;
    transition: transform 0.2s;
    display: inline-block;
}

.op-glass-modal .op-type-btn.active .op-icon-img {
    transform: scale(1.15);
}

.op-icon-small {
    width: 18px;
    height: 18px;
    object-fit: contain;
    vertical-align: middle;
    margin-right: 2px;
}

/* Image Lightbox Styling */
.pest-img {
    cursor: pointer;
    transition: transform 0.2s;
}

.pest-img:hover {
    transform: scale(1.02);
}
/* Farm Game View Styles */
.farm-scene {
    width: 100%;
    height: 400px;
    border-radius: 15px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    background: #87CEEB; /* default */
    margin: 10px 0;
}

.farm-sky {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 40%;
    transition: background 1s ease;
}

.farm-sky.time-day { background: linear-gradient(to bottom, #87CEEB, #E0F6FF); }
.farm-sky.time-sunset { background: linear-gradient(to bottom, #FF7E5F, #FEB47B); }
.farm-sky.time-night { background: linear-gradient(to bottom, #0F2027, #203A43, #2C5364); }
.farm-sky.time-dawn { background: linear-gradient(to bottom, #4CA1AF, #C4E0E5); }

.celestial-body {
    position: absolute;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    bottom: 10px;
    transition: all 1s ease;
}

.time-day .celestial-body { right: 15%; bottom: 40%; background: #FFD700; box-shadow: 0 0 20px #FFD700; }
.time-sunset .celestial-body { left: 15%; bottom: 10px; background: #FF4500; box-shadow: 0 0 20px #FF4500; }
.time-night .celestial-body { right: 20%; bottom: 50%; background: #F4F6F0; box-shadow: 0 0 15px #FFF; }
.time-dawn .celestial-body { left: 20%; bottom: 20px; background: #FFEFD5; box-shadow: 0 0 20px #FFF; }

.farm-land {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 60%;
    background: #6D4C41;
    border-top: 15px solid #4CAF50;
    box-shadow: inset 0 20px 20px rgba(0,0,0,0.1);
    
    /* Dynamically expanding horizontal layout */
    display: grid;
    grid-template-rows: repeat(2, 1fr);
    grid-auto-columns: 120px;
    grid-auto-flow: column;
    overflow-x: auto;
    overflow-y: hidden;
    gap: 15px 30px;
    padding: 20px 30px;
    align-items: center;
    justify-content: start;
}

/* Custom horizontal scrollbar for the farm land */
.farm-land::-webkit-scrollbar {
    height: 10px;
}
.farm-land::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.15);
    border-radius: 5px;
}
.farm-land::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.5);
    border-radius: 5px;
    border: 1px solid rgba(0, 0, 0, 0.1);
}
.farm-land::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.7);
}

.crop-plot {
    position: relative;
    width: 90px;
    height: 60px;
    background: rgba(0,0,0,0.2);
    border-radius: 50%;
    margin-top: 30px;
    margin-bottom: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.crop-sprite {
    position: absolute;
    bottom: 20px;
    /* random widths/heights set by JS */
    width: 50px;
    height: auto;
    object-fit: contain;
    transform-origin: bottom center;
    filter: drop-shadow(0 5px 2px rgba(0,0,0,0.3));
}

.crop-label {
    position: absolute;
    bottom: -15px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.6);
    color: white;
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 10px;
    white-space: nowrap;
    z-index: 10;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.mode-btn {
    transition: all 0.2s ease;
}
.mode-btn.active {
    background: var(--primary) !important;
    color: white !important;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}
/* Mobile Specific Optimizations */
@media (max-width: 768px) {
    /* Bottom Navigation Bar */
    .main-tabs {
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        background: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        display: flex;
        flex-wrap: nowrap;
        justify-content: space-around;
        padding: 8px 5px;
        padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px));
        margin: 0;
        box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
        z-index: 1000;
        border-top-left-radius: 20px;
        border-top-right-radius: 20px;
        overflow-x: auto;
    }
    
    .main-tab-btn {
        flex: 0 0 auto;
        padding: 5px;
        font-size: 0.75rem;
        font-weight: normal;
        border-radius: 12px;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 4px;
        background: transparent;
        color: var(--text-muted);
        min-width: 60px;
    }
    
    .main-tab-btn .tab-icon {
        font-size: 1.4rem;
    }

    .main-tab-btn.active {
        background: transparent;
        color: var(--primary);
        font-weight: bold;
        transform: none;
        box-shadow: none;
    }

    .main-tab-btn.active .tab-icon {
        background: var(--bg-hover);
        padding: 4px 12px;
        border-radius: 16px;
    }

    /* Adjust main container to prevent content from hiding behind nav bar */
    main.container {
        padding-bottom: 90px;
    }

    /* Modal Full Screen on Mobile */
    .modal-content {
        width: 100%;
        max-width: none;
        height: 85vh;
        margin-top: 15vh;
        border-radius: 24px 24px 0 0;
        overflow-y: auto;
        animation: slideUp 0.3s ease-out forwards;
        padding: 25px 20px;
    }

    @keyframes slideUp {
        from { transform: translateY(100%); }
        to { transform: translateY(0); }
    }

    .modal-close {
        top: 15px;
        right: 15px;
        background: rgba(255,255,255,0.9);
        box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    }

    /* Touch Targets & Spacing */
    .btn, .primary-btn, .secondary-btn, .op-submit-btn, .auth-btn {
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    input, select, textarea {
        min-height: 44px;
        font-size: 16px; /* Prevents auto-zoom on iOS */
    }

    /* Card Layouts */
    .vegetable-card, .mygarden-card {
        padding: 15px;
    }
    
    .stage-item {
        padding: 12px;
    }
}

/* Hover fixes: only apply hover effects on devices that support hover */
@media (hover: hover) {
    .main-tab-btn:hover {
        background: var(--bg-hover);
        transform: translateY(-2px);
    }
    .vegetable-card:hover, .mygarden-card:hover {
        transform: translateY(-4px);
        box-shadow: 0 12px 24px rgba(0, 0, 0, 0.1);
    }
    .btn:hover, .primary-btn:hover, .secondary-btn:hover {
        transform: translateY(-2px);
        box-shadow: 0 6px 15px rgba(0, 0, 0, 0.15);
    }
}

/* Remove default hovers that were outside media query */
.main-tab-btn {
    transition: all 0.3s ease;
}
.vegetable-card, .mygarden-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.btn, .primary-btn, .secondary-btn {
    transition: all 0.3s ease;
}
/* Mobile Hover Override to prevent sticky hovers */
@media (max-width: 768px) {
    .vegetable-card:hover, .mygarden-card:hover, .btn:hover, .primary-btn:hover, .secondary-btn:hover {
        transform: none !important;
    }
    .main-tab-btn:hover:not(.active) {
        background: transparent !important;
        transform: none !important;
    }
    /* Touch active state instead */
    .vegetable-card:active, .mygarden-card:active {
        background-color: var(--bg-hover);
        opacity: 0.9;
    }
    .btn:active, .primary-btn:active, .secondary-btn:active {
        opacity: 0.8;
    }
}
@media (max-width: 768px) {
    .main-tabs {
        overflow-x: visible !important;
        flex-wrap: nowrap !important;
        justify-content: space-between !important;
        padding: 5px 2px !important;
        padding-bottom: calc(5px + env(safe-area-inset-bottom, 0px)) !important;
    }
    .main-tab-btn {
        flex: 1 1 0 !important;
        min-width: 0 !important;
        padding: 2px !important;
    }
    .main-tab-btn .tab-text {
        font-size: 0.65rem !important;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 100%;
    }
    .main-tab-btn .tab-icon {
        font-size: 1.2rem !important;
    }
}
@media (max-width: 768px) {
    .mygarden-card {
        box-sizing: border-box;
        max-width: 100%;
        overflow-x: hidden;
        padding: 15px;
    }
    .veg-info {
        width: 100%;
        min-width: 0;
        box-sizing: border-box;
    }
    .growth-timeline {
        justify-content: flex-start;
        padding-bottom: 15px;
    }
    .timeline-img {
        width: 55px !important;
        height: 55px !important;
    }
    .timeline-stage {
        min-width: 70px !important;
        flex: 0 0 auto !important;
    }
    .timeline-label {
        font-size: 0.75rem !important;
    }
    .operations-timeline .op-item {
        max-width: 100%;
    }
}
@media (max-width: 768px) {
    /* Fix top nav overlap */
    .top-left-nav {
        top: 10px !important;
        left: 10px !important;
        padding: 4px 8px !important;
    }
    .top-left-nav .nav-label {
        font-size: 0 !important;
    }
    .top-left-nav .nav-label::before {
        content: '📍';
        font-size: 1rem;
        display: inline-block;
        line-height: 1;
    }
    .top-left-nav .select-trigger {
        font-size: 0.75rem !important;
        padding: 2px 4px !important;
    }
    .top-right-nav {
        top: 10px !important;
        right: 10px !important;
    }
    .auth-btn {
        padding: 6px 10px !important;
        font-size: 0.8rem !important;
    }

    /* Enhance bottom nav bar */
    .main-tabs {
        background: #ffffff !important;
        box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1) !important;
        border-top: 1px solid rgba(0, 0, 0, 0.05) !important;
        padding-top: 8px !important;
    }
    .main-tab-btn {
        padding: 8px 2px !important;
        border-radius: 16px !important;
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    }
    .main-tab-btn.active {
        background: #f0fdf4 !important;
        color: #15803d !important;
        box-shadow: inset 0 0 0 1px rgba(22, 163, 74, 0.1) !important;
        transform: translateY(-2px) !important;
    }
    .main-tab-btn .tab-icon {
        font-size: 1.35rem !important;
        margin-bottom: 3px;
        filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
    }
    .main-tab-btn.active .tab-icon {
        transform: scale(1.15) !important;
    }
    .main-tab-btn .tab-text {
        font-size: 0.7rem !important;
        font-weight: 500 !important;
    }
    .main-tab-btn.active .tab-text {
        font-weight: 700 !important;
    }
}
@media (max-width: 768px) {
    .hero {
        padding-top: 65px !important;
    }
}
@media (max-width: 768px) {
    .op-item {
        flex-wrap: wrap !important;
        border-radius: 12px !important;
    }
    .op-remark {
        width: 100% !important;
        margin-top: 0 !important;
        margin-left: 12px !important;
    }
}
