
/* =================================
   AGRISMART AI - MOBILE APP DESIGN
================================= */

:root {
    --primary: #006b43;
    --primary-dark: #004d32;
    --primary-light: #e5f4ec;
    --background: #f2f5f2;
    --surface: #ffffff;
    --text: #17251d;
    --muted: #78857d;
    --border: #e5ebe6;
    --shadow: 0 4px 18px rgba(0, 60, 35, 0.07);
}

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

body {
    font-family: Arial, sans-serif;
    background: var(--background);
    color: var(--text);
    transition: 0.3s;
}

button, input, select {
    font: inherit;
}

button {
    cursor: pointer;
    border: none;
}

.app {
    min-height: 100vh;
}

/* =================================
   TOP HEADER
================================= */

.topbar {
    height: 65px;
    background: var(--surface);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow);
}

.dashboard-home {
    background: transparent;
    color: var(--primary);
    font-size: 19px;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 8px;
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

.icon-button {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--primary-light);
    color: var(--primary);
    font-size: 19px;
}

#languageSelect {
    background: var(--primary-light);
    color: var(--primary);
    border: none;
    padding: 9px 10px;
    border-radius: 10px;
    outline: none;
    font-weight: bold;
}

/* =================================
   MAIN CONTENT
================================= */

.main-content {
    width: 100%;
    max-width: 1100px;
    margin: auto;
    padding: 22px 18px 105px;
}

.page {
    display: none;
    animation: fadeIn 0.25s ease;
}

.page.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* =================================
   WELCOME SECTION
================================= */

.welcome {
    background: linear-gradient(
        120deg,
        #006b43,
        #07865a
    );
    color: white;
    padding: 25px 22px;
    border-radius: 22px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    box-shadow: var(--shadow);
    margin-bottom: 25px;
}

.welcome h1 {
    font-size: 23px;
    margin-bottom: 12px;
}

.welcome p {
    font-size: 13px;
    margin-top: 7px;
    color: #e1f3e9;
}

.welcome-icon {
    font-size: 55px;
}

/* =================================
   SECTION TITLES
================================= */

.section-title {
    font-size: 18px;
    margin-bottom: 15px;
}

/* =================================
   ANALYTICS CARDS
================================= */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 13px;
    margin-bottom: 22px;
}

.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 17px;
    padding: 17px;
    box-shadow: var(--shadow);
}

.stat-card span {
    font-size: 25px;
}

.stat-card p {
    font-size: 13px;
    color: var(--muted);
    margin: 10px 0 5px;
}

.stat-card h2 {
    color: var(--primary);
    font-size: 25px;
    margin-bottom: 5px;
}

.stat-card small {
    color: var(--muted);
    font-size: 11px;
}

/* =================================
   CONTENT PANELS
================================= */

.content-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-bottom: 18px;
}

.panel {
    background: var(--surface);
    padding: 20px;
    border-radius: 19px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    margin-bottom: 17px;
}

.panel h2,
.panel h3 {
    margin-bottom: 13px;
}

.panel p {
    line-height: 1.6;
    margin-bottom: 12px;
}

.muted {
    color: var(--muted);
    font-size: 13px;
}

/* =================================
   CHART
================================= */

.chart-placeholder {
    min-height: 160px;
    border-radius: 14px;
    background: var(--primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    font-size: 13px;
    margin-top: 15px;
}

/* =================================
   BUTTONS
================================= */

.panel button {
    background: var(--primary);
    color: white;
    padding: 12px 18px;
    border-radius: 12px;
    font-weight: bold;
    margin-top: 10px;
}

.panel button:active {
    transform: scale(0.97);
}

/* =================================
   INPUTS
================================= */

.panel input:not([type="file"]) {
    display: block;
    width: 100%;
    padding: 13px;
    margin: 12px 0;
    border: 1px solid var(--border);
    border-radius: 11px;
    background: var(--background);
    color: var(--text);
    outline: none;
}

.panel input:focus {
    border-color: var(--primary);
}

.panel input[type="file"] {
    display: block;
    width: 100%;
    margin: 18px 0;
}

/* =================================
   IMAGE PREVIEW
================================= */

#imagePreview {
    display: none;
    width: 100%;
    max-width: 350px;
    max-height: 280px;
    object-fit: contain;
    border-radius: 15px;
    margin: 15px 0;
}

/* =================================
   MORE FEATURES MENU
================================= */

.more-menu {
    display: none;
    position: fixed;
    bottom: 78px;
    right: 12px;
    left: 12px;
    max-width: 450px;
    margin-left: auto;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 18px;
    box-shadow: 0 8px 35px rgba(0,0,0,0.18);
    z-index: 200;
}

.more-menu.show {
    display: block;
    animation: fadeIn 0.2s ease;
}

.more-menu-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.more-menu-header button {
    background: var(--primary-light);
    color: var(--primary);
    border-radius: 50%;
    width: 32px;
    height: 32px;
}

.more-item {
    display: block;
    width: 100%;
    text-align: left;
    padding: 14px;
    margin-top: 7px;
    background: var(--background);
    color: var(--text);
    border-radius: 11px;
}

/* =================================
   BOTTOM NAVIGATION
================================= */

.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    min-height: 68px;
    background: var(--surface);
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    align-items: center;
    padding: 7px 4px;
    padding-bottom: max(7px, env(safe-area-inset-bottom));
    border-top: 1px solid var(--border);
    box-shadow: 0 -4px 18px rgba(0, 0, 0, 0.06);
    z-index: 150;
}

.bottom-item {
    background: transparent;
    color: var(--muted);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    min-width: 0;
    padding: 5px 1px;
}

.bottom-item span {
    font-size: 21px;
}

.bottom-item small {
    font-size: 10px;
    white-space: nowrap;
}

.bottom-item.active {
    color: var(--primary);
    font-weight: bold;
}

.bottom-item.active span {
    transform: translateY(-2px);
}

/* =================================
   FOOTER
================================= */

footer {
    text-align: center;
    color: var(--muted);
    font-size: 11px;
    padding: 15px 5px;
}

/* =================================
   DARK MODE
================================= */

body.dark-mode {
    --background: #101b16;
    --surface: #192720;
    --text: #edf5ef;
    --muted: #a5b5aa;
    --border: #304237;
    --primary-light: #203d30;
    --shadow: 0 4px 18px rgba(0,0,0,0.18);
}

body.dark-mode .more-item {
    background: #22352a;
}

body.dark-mode .panel input:not([type="file"]) {
    background: #203128;
    color: white;
    border-color: #405346;
}

/* =================================
   RTL SUPPORT
================================= */

html[dir="rtl"] .more-item {
    text-align: right;
}

html[dir="rtl"] .welcome {
    text-align: right;
}

html[dir="rtl"] .panel {
    text-align: right;
}

/* =================================
   TABLET AND DESKTOP
================================= */

@media (min-width: 768px) {

    .main-content {
        padding: 30px 30px 110px;
    }

    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .welcome h1 {
        font-size: 29px;
    }

    .welcome-icon {
        font-size: 75px;
    }

    .more-menu {
        right: 20px;
        left: auto;
        bottom: 85px;
    }
}

/* =================================
   SMALL MOBILE SCREENS
================================= */

@media (max-width: 380px) {

    .topbar {
        padding: 0 10px;
    }

    .dashboard-home {
        font-size: 16px;
    }

    .header-controls {
        gap: 6px;
    }

    .main-content {
        padding: 16px 12px 100px;
    }

    .welcome {
        padding: 19px 15px;
    }

    .welcome h1 {
        font-size: 19px;
    }

    .welcome-icon {
        font-size: 40px;
    }

    .bottom-item small {
        font-size: 9px;
    }

    .bottom-item span {
        font-size: 19px;
    }
}

/* FLOATING ROUNDED BOTTOM NAVIGATION */

.bottom-nav {
    position: fixed;
    bottom: 12px;
    left: 12px;
    right: 12px;
    width: auto;
    max-width: 600px;
    margin: auto;

    min-height: 72px;
    padding: 8px 7px;

    display: grid;
    grid-template-columns: repeat(5, 1fr);
    align-items: center;
    gap: 5px;

    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 22px;

    box-shadow: 0 8px 30px rgba(0, 50, 30, 0.15);

    z-index: 150;
}

.bottom-item {
    height: 55px;
    border-radius: 15px;

    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 4px;

    background: transparent;
    color: var(--muted);

    transition: all 0.25s ease;
}

.bottom-item span {
    font-size: 21px;
    transition: transform 0.2s ease;
}

.bottom-item small {
    font-size: 10px;
    font-weight: 600;
}

.bottom-item.active {
    background: var(--primary-light);
    color: var(--primary);
}

.bottom-item.active span {
    transform: translateY(-2px);
}

.bottom-item:active {
    transform: scale(0.94);
}

/* ROUNDED MORE MENU */

.more-menu {
    border-radius: 22px;
    padding: 18px;
    bottom: 95px;
    left: 15px;
    right: 15px;
}

.more-item {
    border-radius: 14px;
    padding: 15px;
    margin-top: 9px;
    transition: 0.2s;
}

.more-item:active {
    background: var(--primary-light);
    color: var(--primary);
    transform: scale(0.98);
}

/* CONTENT SPACE FOR FLOATING BAR */

.main-content {
    padding-bottom: 115px;
}

/* SMALL SCREEN ADJUSTMENT */

@media (max-width: 380px) {
    .bottom-nav {
        left: 8px;
        right: 8px;
        bottom: 8px;
        border-radius: 19px;
    }

    .bottom-item small {
        font-size: 9px;
    }
}

