/* ===================================
   CROPHEALTH - STILLPOINT DESIGN
   =================================== */

:root {
    --bg-paper: #F4F1EE;
    --bg-hover: #EBE7E4;
    --bg-white: #FFFFFF;
    --text-black: #1C1C1C;
    --text-body: #4A4540;
    --text-muted: #7A7570;
    --accent-forest: #264639;
    --border-warm: #D1C7BD;
    --accent-olive: #6B7F4A;
    --accent-brick: #A85D4A;
    --font-serif: 'Cormorant Garamond', Georgia, serif;
    --font-sans: 'Inter', -apple-system, sans-serif;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    font-weight: 400;
    color: var(--text-body);
    line-height: 1.8;
    background: var(--bg-paper);
}

h1,
h2,
h3,
h4 {
    font-family: var(--font-serif);
    font-weight: 300;
    color: var(--text-black);
    letter-spacing: -0.02em;
}

/* --- Reveal --- */
.reveal {
    opacity: 0;
    transform: translateY(50px);
    transition: all 1.2s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* --- Navbar --- */
.navbar {
    position: sticky;
    top: 0;
    background: #F4EDE4;
    border-bottom: 1px solid var(--border-warm);
    z-index: 1500;
    padding: 1.5rem 0;
}

.nav-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.brand {
    font-family: var(--font-serif);
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-black);
    line-height: 1;
}

#brand-logo {
    text-decoration: none;
    color: var(--text-black);
    cursor: pointer;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 3rem;
    align-items: center;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-body);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    transition: color 0.3s ease;
    position: relative;
}

.nav-links a::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -4px;
    width: 0%;
    height: 1px;
    background: #1C1C1C;
    transition: width 0.3s ease;
}

.nav-links a:hover {
    color: #1C1C1C;
}

.nav-links a:hover::after {
    width: 100%;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.lang-dropdown {
    padding: 8px 12px;
    border: 1px solid #2d4a22;
    background: transparent;
    color: #2d4a22;
    font-size: 0.75rem;
    font-family: var(--font-main);
    letter-spacing: 0.05em;
    cursor: pointer;
    outline: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%232d4a22' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    padding-right: 28px;
}

.lang-dropdown:focus {
    border-color: #1a2e15;
    background-color: #FAF7F2;
}

.lang-dropdown option {
    background: #FAF7F2;
    color: #2d4a22;
    padding: 8px;
}

/* --- Hero --- */
.hero-header {
    background: #F4EDE4;
    padding: 120px 2rem 100px;
    text-align: center;
}

.hero-content {
    max-width: 700px;
    margin: 0 auto;
    text-align: center;
}

.eyebrow {
    display: block;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 3px;
    color: var(--text-body);
    margin-bottom: 2rem;
}

.eyebrow-small {
    display: block;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--text-body);
    margin-bottom: 1rem;
}

.hero-header h1 {
    font-size: 5rem;
    line-height: 1.1;
    margin-bottom: 2rem;
    font-weight: 300;
}

.hero-header h1 em {
    font-style: italic;
    color: var(--accent-forest);
}

.hero-header p {
    font-size: 1.1rem;
    color: var(--text-muted);
    margin-bottom: 0;
    font-weight: 300;
    line-height: 1.8;
}

.hero-btns {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-top: 3rem;
}

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 16px 32px;
    font-family: var(--font-sans);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 0;
}

.primary-btn {
    background: var(--accent-forest);
    color: var(--bg-white);
}

.primary-btn:hover {
    background: #1a332a;
}

.ghost-btn {
    background: transparent;
    color: var(--accent-forest);
    border: 1px solid var(--accent-forest);
}

.ghost-btn:hover {
    background: var(--accent-forest);
    color: var(--bg-white);
}

/* --- Sections --- */
section {
    padding: 120px 0;
}

.section-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* --- How it Works (Edge-to-Edge Grid) --- */
#how-it-works {
    background-color: #F3E9DD;
    padding: 0;
}

.how-it-works-section .section-container {
    max-width: 100%;
    padding: 0;
}

.how-header {
    text-align: center;
    padding: 80px 2rem 60px;
}

.how-header h2 {
    font-size: 3rem;
}

.how-grid-2x2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
    max-width: 100%;
    gap: 0;
    border-top: 1px solid #D1C7BD;
    border-bottom: 1px solid #D1C7BD;
}

.grid-item {
    padding: 100px 10%;
    transition: background-color 0.5s ease;
    border-bottom: 1px solid #D1C7BD;
}

/* Window pane borders */
.grid-item:nth-child(odd) {
    border-right: 1px solid #D1C7BD;
}

.grid-item:nth-child(3),
.grid-item:nth-child(4) {
    border-bottom: none;
}

.grid-item:hover {
    background-color: #FAF7F2;
}

.grid-item:hover .min-icon {
    transform: scale(1.1) rotate(90deg);
}

/* Item Header Row */
.item-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}

.min-icon {
    font-family: var(--font-serif);
    font-size: 1.5rem;
    color: var(--text-black);
    transition: transform 0.5s ease;
    display: inline-block;
}

.grid-item h3 {
    font-family: var(--font-serif);
    font-size: 1.5rem;
    color: var(--text-black);
    font-weight: 400;
}

.grid-item p {
    font-family: var(--font-sans);
    font-size: 1rem;
    color: var(--text-body);
    line-height: 1.6;
}

/* --- Diagnosis --- */
.diagnosis-section {
    background: #F4EDE4;
}

.tool-card {
    background: #F9F7F5;
    padding: 60px;
    border: 1px solid #D1C7BD;
    border-radius: 0;
    text-align: center;
    max-width: 700px;
    margin: 0 auto;
}

.tool-card h2 {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.desc-text {
    color: var(--text-muted);
    margin-bottom: 3rem;
}

/* --- Specimen Upload Zone --- */
.drop-zone {
    display: block;
    width: 100%;
    padding: 60px 40px;
    border: 1px solid #D1C7BD;
    background: #F0EBE5;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
    border-radius: 0;
}

/* Corner brackets */
.drop-zone::before,
.drop-zone::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border-color: #1C1C1C;
    border-style: solid;
}

.drop-zone::before {
    top: 10px;
    left: 10px;
    border-width: 2px 0 0 2px;
}

.drop-zone::after {
    bottom: 10px;
    right: 10px;
    border-width: 0 2px 2px 0;
}

.drop-zone:hover {
    background: #EBE5DD;
}

.drop-zone-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.drop-icon {
    font-size: 1.5rem;
    color: #1C1C1C;
    animation: float 2s infinite ease-in-out;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-5px);
    }
}

#upload-btn-text {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: #1C1C1C;
    border-bottom: 1px solid #1C1C1C;
    padding-bottom: 4px;
}

/* --- Results --- */
.preview-image {
    width: 100%;
    max-height: 400px;
    object-fit: cover;
    margin: 2rem 0;
    filter: sepia(0.1) brightness(0.98);
}

.result-card-dynamic {
    background: var(--bg-white);
    padding: 3rem;
    border: 1px solid var(--border-warm);
    max-width: 500px;
    margin: 2rem auto 0;
    text-align: center;
}

.result-card-dynamic.border-healthy {
    border-top: 4px solid var(--accent-olive);
}

.result-card-dynamic.border-diseased {
    border-top: 4px solid var(--accent-brick);
}

.result-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.result-title {
    font-family: var(--font-serif);
    font-size: 1.75rem;
    color: var(--text-black);
    margin-bottom: 0.5rem;
}

.confidence-container {
    margin: 1.5rem 0;
    text-align: left;
}

.confidence-text {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    display: block;
    margin-bottom: 0.5rem;
}

.confidence-bar-bg {
    background: var(--bg-paper);
    height: 6px;
}

.confidence-bar-fill {
    height: 100%;
    background: var(--accent-forest);
    transition: width 1s ease;
}

.remedy-list {
    text-align: left;
    background: var(--bg-paper);
    padding: 1.5rem;
    margin: 1.5rem 0;
}

.remedy-list h4 {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--accent-forest);
    margin-bottom: 1rem;
}

.remedy-list ul {
    list-style: none;
}

.remedy-list li {
    position: relative;
    padding-left: 1.25rem;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.remedy-list li::before {
    content: "—";
    position: absolute;
    left: 0;
    color: var(--text-muted);
}

/* --- Offline Badge --- */
.offline-badge {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 2000;
    background: var(--accent-forest);
    color: var(--bg-white);
    padding: 10px 16px;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

/* --- Footer --- */
footer {
    padding: 60px 2rem;
    background: #E6DDD0;
    border-top: 1px solid #D1C7BD;
    text-align: center;
    color: #4A4540;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.status-indicator {
    margin-top: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.dot {
    width: 6px;
    height: 6px;
    background: var(--accent-olive);
    border-radius: 50%;
}

.offline .dot {
    background: var(--accent-brick);
}

.hidden {
    display: none !important;
}

/* =============================================
   MINIMALIST ICONS (Lucide-style)
============================================= */

/* Inline SVG Icons */
.icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    vertical-align: middle;
    margin-right: 6px;
}

.icon svg {
    width: 18px;
    height: 18px;
    stroke-width: 2;
    fill: none;
    stroke: currentColor;
}

.icon-lg svg {
    width: 48px;
    height: 48px;
}

/* Icon Colors */
.icon-success {
    color: #4CAF50;
}

.icon-error {
    color: #e57373;
}

.icon-warning {
    color: #e67e22;
}

.icon-muted {
    color: #888;
}

.icon-primary {
    color: #264639;
}

/* Status Dots */
.status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 8px;
    vertical-align: middle;
}

.status-dot.in-stock {
    background-color: #4CAF50;
}

.status-dot.out-of-stock {
    background-color: #e57373;
}

/* Section Headers with Icons */
.section-header-icon {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 1rem;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #4A4540;
}

.section-header-icon .icon svg {
    width: 16px;
    height: 16px;
}

/* Shop List Items */
.shop-item {
    padding: 12px 0;
    border-bottom: 1px solid #D1C7BD;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

.shop-info {
    flex: 1;
}

.shop-name {
    font-weight: 500;
    color: #1C1C1C;
}

.shop-distance {
    font-size: 0.85rem;
    color: #888;
}

.stock-status {
    display: flex;
    align-items: center;
    font-size: 0.85rem;
}

/* Result Icon Container */
.result-icon-container {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
}

.result-icon-container.healthy {
    background: rgba(76, 175, 80, 0.1);
    color: #4CAF50;
}

.result-icon-container.diseased {
    background: rgba(230, 126, 34, 0.1);
    color: #e67e22;
}

.result-icon-container svg {
    width: 32px;
    height: 32px;
    stroke-width: 2;
}

/* =============================================
   HAMBURGER MENU (Hidden on Desktop)
============================================= */

.hamburger-btn {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
    width: 44px;
    height: 44px;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    order: 2;
}

.hamburger-line {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text-black);
    transition: all 0.3s ease;
}

/* Hamburger Animation when Active */
.hamburger-btn.active .hamburger-line:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.hamburger-btn.active .hamburger-line:nth-child(2) {
    opacity: 0;
}

.hamburger-btn.active .hamburger-line:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* --- Responsive --- */
@media (max-width: 768px) {

    /* Show hamburger on mobile */
    .hamburger-btn {
        display: flex;
    }

    /* Navbar layout for mobile */
    .nav-content {
        flex-wrap: wrap;
        padding: 0 20px;
    }

    .brand {
        font-size: 1.8rem;
        order: 1;
        flex: 1;
    }

    /* Nav actions (language + login) */
    .nav-actions {
        order: 3;
        display: flex;
        align-items: center;
        gap: 10px;
    }

    .nav-actions .ghost-btn {
        padding: 8px 16px;
        font-size: 0.8rem;
        min-height: 44px;
    }

    .lang-dropdown {
        min-height: 44px;
        padding: 8px 30px 8px 12px;
        min-width: 60px;
        -webkit-appearance: none;
        -moz-appearance: none;
        appearance: none;
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23333' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
        background-repeat: no-repeat;
        background-position: right 8px center;
        border: 1px solid #333;
        background-color: #fff;
    }

    /* Mobile Nav Links - Slide Down Menu */
    .nav-links {
        display: none;
        flex-direction: column;
        width: 100%;
        order: 4;
        background: #F4EDE4;
        border-top: 1px solid var(--border-warm);
        padding: 1rem 0;
        margin-top: 1rem;
        gap: 0;
    }

    .nav-links.active {
        display: flex;
    }

    .nav-links li {
        width: 100%;
    }

    .nav-links a {
        display: block;
        padding: 15px 20px;
        font-size: 1rem;
        border-bottom: 1px solid var(--border-warm);
        min-height: 44px;
    }

    .nav-links li:last-child a {
        border-bottom: none;
    }

    .nav-links a:hover {
        background: #FAF7F2;
    }

    /* Grid adjustments */
    .how-grid-2x2 {
        grid-template-columns: 1fr;
    }

    .grid-item {
        border-right: none !important;
        border-bottom: 1px solid var(--border-warm);
    }

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

    .grid-item {
        padding: 50px 30px;
    }

    .hero-header h1 {
        font-size: 2.5rem;
    }

    .hero-header {
        padding: 60px 1.5rem;
    }

    section {
        padding: 60px 0;
    }

    .tool-card {
        padding: 30px 20px;
        margin: 0 15px;
    }

    .section-container {
        padding: 0 20px;
    }

    /* Shop items mobile */
    .shop-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .stock-status {
        margin-left: 0;
    }
}

/* Extra small screens */
@media (max-width: 480px) {
    .brand {
        font-size: 1.5rem;
    }

    .hero-header h1 {
        font-size: 2rem;
    }

    .nav-actions .ghost-btn {
        display: none;
    }
}

/* =============================================
   SMS GATEWAY BUTTON STATES
============================================= */

.gateway-btn {
    position: relative;
    transition: all 0.3s ease;
    min-height: 48px;
}

.gateway-btn:disabled {
    cursor: wait;
}

/* Connecting State */
.gateway-btn.connecting {
    background: #2d4a22;
    animation: pulse-gateway 1.5s ease-in-out infinite;
}

@keyframes pulse-gateway {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.7;
    }
}

/* Success State */
.gateway-btn.success {
    background: #4CAF50;
    cursor: default;
}

.gateway-btn.success:hover {
    background: #4CAF50;
}

/* Fallback State */
.gateway-btn.fallback {
    background: #e67e22;
}

/* Status Message */
.gateway-status {
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 0.85rem;
    letter-spacing: 0.02em;
}

.gateway-status.success {
    background: rgba(76, 175, 80, 0.1);
    color: #4CAF50;
}

.gateway-status.error {
    background: rgba(230, 126, 34, 0.1);
    color: #e67e22;
}

/* =============================================
   FARMER PHONE INPUT STYLES
============================================= */

#farmer-phone {
    width: 100%;
    padding: 12px;
    margin-bottom: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    box-sizing: border-box;
    transition: border-color 0.3s, box-shadow 0.3s;
}

#farmer-phone:focus {
    outline: none;
    border-color: #2d4a22;
    box-shadow: 0 0 5px rgba(45, 74, 34, 0.3);
}

/* Shake animation for validation */
@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    20%,
    60% {
        transform: translateX(-5px);
    }

    40%,
    80% {
        transform: translateX(5px);
    }
}

.shake {
    animation: shake 0.4s ease-in-out;
}

/* =============================================
   APP LOADING SCREEN
============================================= */

.loader-spinner {
    width: 50px;
    height: 50px;
    border: 3px solid #e0e0e0;
    border-top-color: #2d4a22;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}