*{
    margin:0;
    padding:0;
    box-sizing:border-box;
    font-family:'Prompt', sans-serif;
}

body{
    background: var(--bg-main);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: background-color 0.4s ease, color 0.4s ease;
}

.page {
    display: none;
}

.page.active {
    display: flex;
    flex-direction: column;
}

/* App Layout Structure */
.app-layout {
    display: flex;
    min-height: 100vh;
    width: 100%;
    position: relative;
}

/* Sidebar Styles */
.sidebar {
    width: 280px;
    background: var(--card-bg);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease, width 0.3s ease, background-color 0.4s ease, border-color 0.4s ease;
    z-index: 40;
    flex-shrink: 0;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
}

.sidebar.collapsed {
    width: 0;
    transform: translateX(-280px);
    overflow: hidden;
    border-right: none;
}

.main-content-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    transition: margin-left 0.3s ease;
}

/* Header Navbar */
header {
    background: var(--card-bg);
    padding: 15px 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 30;
    box-shadow: 0 2px 10px rgba(0,0,0,0.04);
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.4s ease, border-color 0.4s ease;
    gap: 10px;
}

.logo-container {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.brand-logo-img {
    height: 40px;
    width: auto;
    object-fit: contain;
    border-radius: 10px;
}

/* Navigation System: Right-aligned PC Text, Mobile Icons */
nav {
    display: flex;
    align-items: center;
    justify-content: flex-end; /* Sticks everything to the right */
    flex: 1;
    gap: 12px; /* Space between icons on mobile */
}

.nav-link {
    text-decoration: none;
    color: var(--text-main);
    font-weight: 600;
    transition: .3s;
    cursor: pointer;
    display: flex;
    align-items: center;
}

.nav-link:hover {
    color: #ff5a83;
}

.nav-text {
    display: none; /* Hidden by default on mobile */
}

.nav-icon {
    display: block; /* Visible by default on mobile */
    width: 22px;
    height: 22px;
    color: var(--text-main);
    transition: 0.3s;
}

.nav-link:hover .nav-icon {
    color: #ff5a83;
}

/* Responsive PC overrides */
@media (min-width: 768px) {
    nav {
        gap: 25px; /* Wider spacing for text */
    }
    .nav-text {
        display: block; /* Show text on PC */
        font-size: 15px;
    }
    .nav-icon {
        display: none; /* Hide icons on PC */
    }
}

/* Hero Section */
.hero{
    display:flex;
    justify-content:space-between;
    align-items:center;
    padding:70px 8%;
    flex-wrap:wrap;
    background: var(--home-bg);
    transition: background-color 0.4s ease;
}

.hero-text{
    max-width:580px;
}

.badge{
    display: inline-block;
    padding: 6px 16px;
    background: #e2f3e9;
    border: 1px solid #b2dec3;
    border-radius: 30px;
    color: #174229;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1px;
    margin-bottom: 20px;
}

.hero-text h1{
    font-size:46px;
    font-weight: 800;
    color: var(--text-main);
    margin-bottom:15px;
    line-height: 1.2;
}

.hero-text h1 span.rose-text {
    color: #ff5a83;
}

.hero-text p{
    font-size:18px;
    color: var(--text-muted);
    margin-bottom:35px;
    line-height: 1.6;
}

.btn{
    display:inline-block;
    padding:14px 32px;
    background:#174229;
    color:white;
    border-radius:16px;
    text-decoration:none;
    font-weight: 600;
    font-size: 16px;
    margin-right:12px;
    transition:.3s;
    box-shadow: 0 8px 20px rgba(23, 66, 41, 0.2);
    cursor: pointer;
    border: none;
}

.btn:hover{
    background:#0f2e1c;
    transform:translateY(-3px);
}

.btn-secondary{
    background: var(--card-bg);
    color: var(--text-main);
    border: 1px solid var(--border-color);
    box-shadow: none;
}

.hero-img-box{
    width:380px;
    height: 380px;
    max-width:100%;
    background: var(--card-bg);
    border-radius: 36px;
    padding: 35px;
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.08);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.4s ease, border-color 0.4s ease;
}

.hero-img-box img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 20px;
}

/* Feature Cards Section */
.features{
    padding:80px 8%;
    background: var(--card-bg);
    transition: background-color 0.4s ease;
}

.title{
    text-align:center;
    font-size:36px;
    font-weight: 800;
    color: var(--text-main);
    margin-bottom:12px;
}

.subtitle{
    text-align: center;
    font-size: 16px;
    color: var(--text-muted);
    margin-bottom: 50px;
}

.grid{
    display:grid;
    grid-template-columns:repeat(auto-fit,minmax(240px,1fr));
    gap:25px;
}

.card{
    background: var(--card-bg);
    padding:30px;
    border-radius:20px;
    border: 1px solid var(--border-color);
    box-shadow:0 10px 20px rgba(0,0,0,.02);
    transition: transform 0.3s, border-color 0.3s, background-color 0.4s ease, color 0.4s ease;
}

.card:hover{
    transform:translateY(-8px);
    border-color: #ff5a83;
    box-shadow:0 15px 30px rgba(255, 90, 131, 0.12);
}

.card h3{
    color: var(--text-main);
    font-size: 18px;
    margin-bottom:10px;
    font-weight: 700;
}

.card p{
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.6;
}

/* --- SLIDER SECTION STYLES --- */
.rose-slider-section {
    padding: 60px 8%;
    background: var(--bg-main);
    transition: background-color 0.4s ease;
}

.rose-slider-container {
    max-width: 1000px;
    margin: 0 auto;
    border-radius: 30px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 20px 40px rgba(0,0,0,0.08);
    border: 1px solid var(--border-color);
    background: var(--card-bg);
}

.rose-slider-track {
    display: flex;
    transition: transform 0.5s ease-in-out;
    width: 100%;
}

.rose-slide {
    min-width: 100%;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 40px 20px;
    text-align: center;
}

.rose-slide img {
    width: 100%;
    max-height: 400px;
    object-fit: cover;
    border-radius: 20px;
    margin-bottom: 25px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}

.rose-slide-caption {
    font-size: 24px;
    font-weight: 800;
    color: var(--text-main);
    max-width: 700px;
    line-height: 1.4;
}

.rose-slide-caption span {
    color: #ff5a83;
}

.slider-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(23, 66, 41, 0.8);
    color: white;
    border: none;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: 0.3s;
    z-index: 10;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

.slider-btn:hover {
    background: #174229;
    transform: translateY(-50%) scale(1.1);
}

.slider-btn.prev {
    left: 20px;
}

.slider-btn.next {
    right: 20px;
}

.slider-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 20px;
    padding-bottom: 10px;
}

.slider-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--border-color);
    border: none;
    cursor: pointer;
    transition: 0.3s;
}

.slider-dot.active {
    background: #ff5a83;
    width: 30px;
    border-radius: 6px;
}

footer{
    background:#174229;
    color:#a1c4af;
    padding:30px;
    text-align:center;
    font-size: 14px;
    margin-top: auto;
}

footer strong {
    color: white;
}

/* --- THEME CONFIGURATIONS --- */
html.theme-white {
    --bg-main: #f4fbf7;
    --home-bg: #f4fbf7;
    --card-bg: #ffffff;
    --text-main: #1c3829;
    --text-muted: #436150;
    --border-color: #e2e8f0;
    --orb-1: rgba(16, 185, 129, 0.22);
    --orb-2: rgba(5, 150, 105, 0.15);
    --orb-3: rgba(217, 119, 6, 0.12);
    --sun-color: #f4a261;
    --water-color: #457b9d;
    --soil-color: #8a5a44;
    --season-color: #9c27b0;
    --pest-color: #e63946;
}
html.theme-dark {
    --bg-main: #0f172a;
    --home-bg: #0f172a;
    --card-bg: #1e293b;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --border-color: #334155;
    --orb-1: rgba(16, 185, 129, 0.15);
    --orb-2: rgba(5, 150, 105, 0.1);
    --orb-3: rgba(56, 189, 248, 0.08);
    --sun-color: #f4a261;
    --water-color: #457b9d;
    --soil-color: #c08569;
    --season-color: #ba68c8;
    --pest-color: #ff6b6b;
}
html.theme-midnight {
    --bg-main: #000000;
    --home-bg: #000000;
    --card-bg: #111111;
    --text-main: #ffffff;
    --text-muted: #a1a1aa;
    --border-color: #27272a;
    --orb-1: rgba(16, 185, 129, 0.18);
    --orb-2: rgba(236, 72, 153, 0.08);
    --orb-3: rgba(99, 102, 241, 0.1);
    --sun-color: #f4a261;
    --water-color: #457b9d;
    --soil-color: #c08569;
    --season-color: #ba68c8;
    --pest-color: #ff6b6b;
}

.dynamic-card {
    background-color: var(--card-bg);
    border-color: var(--border-color);
    color: var(--text-main);
    transition: background-color 0.4s ease, border-color 0.4s ease, color 0.4s ease;
}

/* --- DETAILED CARE GUIDE STYLES (Integrated from File 2) --- */
.care-card {
    background-color: var(--card-bg);
    border-radius: 20px;
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    border: 1px solid var(--border-color);
    border-left: 8px solid #ccc;
}

.care-card h2 {
    margin-top: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
    font-size: 1.25rem;
    font-weight: 700;
}

.card-sun { border-left-color: var(--sun-color); } .card-sun h2 { color: var(--sun-color); }
.card-water { border-left-color: var(--water-color); } .card-water h2 { color: var(--water-color); }
.card-soil { border-left-color: var(--soil-color); } .card-soil h2 { color: var(--soil-color); }
.card-season { border-left-color: var(--season-color); } .card-season h2 { color: var(--season-color); }
.card-pest { border-left-color: var(--pest-color); } .card-pest h2 { color: var(--pest-color); }

.feature-img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    border-radius: 12px;
    margin: 10px 0 5px 0;
    background-color: #e9ecef;
}

.pest-img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    border-radius: 8px;
    margin: 15px 0 5px 0;
    border: 1px solid var(--border-color);
    background-color: #e9ecef;
}

.img-credit {
    font-size: 0.8em;
    color: var(--text-muted);
    text-align: right;
    margin: 0 0 15px 0;
    font-style: italic;
    display: block;
}

.img-credit a {
    color: #10b981;
    text-decoration: underline;
}

.quick-list { padding-left: 20px; margin: 10px 0; color: var(--text-muted); font-size: 0.95rem; }
.quick-list li { margin-bottom: 8px; }
.quick-list strong { color: var(--text-main); }

.season-container {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}

.season-box {
    flex: 1;
    padding: 15px;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
}

.season-summer { background-color: rgba(255, 152, 0, 0.1); border-top: 4px solid #ff9800; color: var(--text-main); }
.season-rainy { background-color: rgba(33, 150, 243, 0.1); border-top: 4px solid #2196f3; color: var(--text-main); }
.season-winter { background-color: rgba(0, 188, 212, 0.1); border-top: 4px solid #00bcd4; color: var(--text-main); }

.season-box h3 {
    margin-top: 0; margin-bottom: 10px;
    display: flex; flex-direction: column; align-items: center; gap: 5px; font-size: 1.1em; font-weight: 700;
}
.season-box .icon { font-size: 1.8em; }
.season-box ul { padding-left: 20px; font-size: 0.9em; margin: 0; opacity: 0.9; }

.accordion {
    background-color: rgba(230, 57, 70, 0.08); color: var(--text-main); cursor: pointer;
    padding: 15px 20px; width: 100%; border: 1px solid rgba(230, 57, 70, 0.3);
    text-align: left; outline: none; font-size: 1.05em; font-family: inherit;
    transition: 0.3s; border-radius: 10px; margin-bottom: 8px; font-weight: 600;
    display: flex; justify-content: space-between; align-items: center;
}

.accordion.active, .accordion:hover { background-color: rgba(230, 57, 70, 0.18); }
.accordion:after { content: '\002B'; font-size: 1.5em; color: var(--pest-color); font-weight: bold; }
.accordion.active:after { content: "\2212"; }

.panel {
    padding: 0 20px; background-color: var(--card-bg); max-height: 0; overflow: hidden;
    transition: max-height 0.3s ease-out; border-left: 4px solid var(--pest-color);
    margin-bottom: 15px; margin-top: -5px; border-radius: 0 0 10px 10px; border-right: 1px solid var(--border-color); border-bottom: 1px solid var(--border-color);
}

.treatment-table {
    width: 100%; border-collapse: collapse; margin: 15px 0;
    background: var(--bg-main); border-radius: 8px; overflow: hidden; border: 1px solid var(--border-color);
}
.treatment-table td { padding: 12px 15px; vertical-align: top; border-bottom: 1px solid var(--border-color); color: var(--text-main); font-size: 0.9em; }
.treatment-table tr:last-child td { border-bottom: none; }
.topic-col { font-weight: bold; white-space: nowrap; width: 1%; padding-right: 20px !important; color: var(--text-main); }

.insight-box {
    background-color: rgba(255, 193, 7, 0.12); border-left: 4px solid #ffc107;
    padding: 10px 15px; margin: 15px 0; border-radius: 4px; font-size: 0.95em; color: var(--text-main);
}

.ai-cta {
    background: linear-gradient(135deg, #1d3557, #457b9d); color: white; text-align: center;
    padding: 35px 20px; border-radius: 20px; margin-top: 30px;
    box-shadow: 0 10px 30px rgba(29, 53, 87, 0.3); cursor: pointer; transition: 0.2s;
}
.ai-cta:hover { transform: translateY(-5px); box-shadow: 0 15px 35px rgba(29, 53, 87, 0.4); }
.ai-cta h2 { margin: 0 0 10px 0; font-size: 1.8em; color: white;}
.ai-cta p { margin: 0; font-size: 1.1em; opacity: 0.9; }

/* --- SMOOTH CHAT BUBBLE ANIMATIONS --- */
@keyframes chatBubbleIn {
    0% {
        opacity: 0;
        transform: translateY(15px) scale(0.95);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.chat-message-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    animation: chatBubbleIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* --- CUSTOM FULLSCREEN UPLOADING OVERLAY --- */
#uploading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

#uploading-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.upload-spinner {
    width: 64px;
    height: 64px;
    border: 5px solid rgba(255, 255, 255, 0.2);
    border-top-color: #ff5a83;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* --- RESPONSIVE MEDIA QUERIES --- */
@media (max-width: 768px) {
    .season-container { flex-direction: column; }
    .table-wrapper { overflow-x: auto; }

    .hero {
        flex-direction: column;
        text-align: center;
        padding: 40px 5%;
    }
    .hero-text h1 {
        font-size: 36px;
    }
    .hero-text {
        margin-bottom: 30px;
    }
    .hero-img-box {
        margin: 0 auto;
    }
    .btn {
        display: block;
        width: 100%;
        margin-bottom: 12px;
        margin-right: 0;
    }
    .rose-slide-caption {
        font-size: 18px;
    }
}