/* =========================================
   Krishi Hub - Premium Modern Agricultural CSS
   ========================================= */

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700;800&display=swap');

:root {
    /* Refined Modern Colors */
    --primary: #166534;          /* Rich Emerald Green */
    --primary-dark: #14532d;
    --primary-light: #22c55e;
    --primary-soft: #dcfce7;     /* Soft green background for icons */
    
    --accent: #f59e0b;           /* Warm Golden Amber */
    --accent-hover: #d97706;
    
    --text-dark: #1e293b;        /* Slate dark */
    --text-body: #475569;        /* Slate gray */
    --bg-light: #f8fafc;         /* Ultra-light cool gray */
    --white: #ffffff;

    /* Soft, layered shadows (Apple style) */
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.05), 0 1px 2px rgba(0,0,0,0.03);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.05), 0 2px 4px -1px rgba(0,0,0,0.03);
    --shadow-lg: 0 20px 25px -5px rgba(0,0,0,0.05), 0 10px 10px -5px rgba(0,0,0,0.02);
    --shadow-glow: 0 10px 25px rgba(22, 101, 52, 0.15); /* Green glow for cards */
    
    --transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
}

/* =========================================
   GLOBAL RESET & TYPOGRAPHY
   ========================================= */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--bg-light);
    color: var(--text-body);
    line-height: 1.6;
    font-size: 15px;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

ul { list-style: none; }

h1, h2, h3, h4, h5, h6 {
    color: var(--text-dark);
    font-weight: 700;
    line-height: 1.2;
}

/* =========================================
   HEADER (Top branding banner)
   ========================================= */
.main-header {
    background: var(--white);
    padding: 15px 0;
    text-align: center;
    border-bottom: 3px solid var(--accent);
    position: relative;
    z-index: 1001;
    box-shadow: var(--shadow-sm);
}

.logo-container {
    display: flex;             
    align-items: center;       
    justify-content: center;   
    gap: 15px;                 
    padding: 10px 0;
}

.logo-icon img {
    height: 75px; 
    width: auto;   
    display: block;
    transition: var(--transition);
}

.logo-icon img:hover {
    transform: scale(1.05) rotate(-3deg);
}

.header-text { text-align: left; }

.header-text h1 {
    margin: 0;
    font-size: 52px;
    line-height: 1;
    color: var(--primary); 
    text-transform: uppercase;
    font-weight: 800;
    letter-spacing: -1px;
}

.header-text p {
    margin: 2px 0 0;
    font-size: 16px;
    color: var(--text-body);    
    font-weight: 600;
    letter-spacing: 0.5px;
}

/* =========================================
   NAVBAR
   ========================================= */
.navbar {
    background: var(--primary);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 10px 30px rgba(20, 83, 45, 0.2);
    height: 70px;
    display: flex;
    align-items: center;
}

.nav-container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 5px;
}

.nav-menu a, .dropbtn {
    color: rgba(255, 255, 255, 0.9);
    padding: 10px 18px;
    font-size: 0.95rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    border-radius: var(--radius-sm);
}

.nav-menu a i, .dropbtn i {
    font-size: 1.1rem;
    transition: var(--transition);
}

/* Navbar Hover Pill Effect */
.nav-menu a:hover, .nav-menu a.active, .dropdown:hover .dropbtn {
    color: var(--accent);
    background: rgba(255, 255, 255, 0.05);
}

/* Dropdown Animation */
.dropdown { position: relative; }

.dropdown-content {
    opacity: 0;
    visibility: hidden;
    transform: translateY(15px);
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--white);
    min-width: 240px;
    box-shadow: var(--shadow-lg);
    border-radius: var(--radius-md);
    overflow: hidden;
    z-index: 1001;
    transition: var(--transition);
    border: 1px solid rgba(0,0,0,0.05);
    margin-top: 10px;
}

.dropdown:hover .dropdown-content {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-content a {
    color: var(--text-dark);
    padding: 14px 20px;
    display: block;
    border-bottom: 1px solid #f1f5f9;
    font-weight: 500;
    text-transform: none;
    letter-spacing: 0;
}

.dropdown-content a:last-child { border-bottom: none; }

.dropdown-content a:hover {
    background: var(--primary-soft);
    color: var(--primary);
    padding-left: 26px; /* Smooth slide right on hover */
}

/* Staff Login Button */
.login-btn {
    background: var(--accent);
    color: var(--text-dark) !important;
    border-radius: 50px !important;
    padding: 10px 24px !important;
    margin-left: 15px;
    box-shadow: 0 4px 10px rgba(245, 158, 11, 0.3);
}

.login-btn:hover {
    background: var(--accent-hover) !important;
    color: var(--white) !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(245, 158, 11, 0.4);
}

/* Hamburger */
.hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    cursor: pointer;
    gap: 5px;
}

.bar {
    width: 28px;
    height: 3px;
    background: var(--white);
    border-radius: 3px;
    transition: var(--transition);
}

/* =========================================
   NEWS TICKER
   ========================================= */
.news-ticker {
    background: var(--text-dark);
    color: var(--white);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    box-shadow: var(--shadow-sm);
}

.ticker-title {
    background: var(--accent);
    color: var(--text-dark);
    font-weight: 800;
    padding: 12px 30px 12px 25px;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 1px;
    clip-path: polygon(0 0, 100% 0, 85% 100%, 0% 100%);
}

.ticker-content {
    flex: 1;
    overflow: hidden;
    padding: 10px 20px;
    font-weight: 300;
}

/* =========================================
   HERO SECTION
   ========================================= */
.hero {
    background: linear-gradient(to right, rgba(20, 83, 45, 0.9), rgba(20, 83, 45, 0.6)), url('../images/farm-bg.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    height: 60vh;
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
    clip-path: polygon(0 0, 100% 0, 100% 88%, 0 100%);
    margin-bottom: -60px;
    padding-bottom: 60px;
}

.hero-content {
    animation: fadeInUp 1s ease-out forwards;
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

.hero h1 {
    color: var(--white);
    font-size: 4rem;
    font-weight: 800;
    margin-bottom: 15px;
    text-shadow: 0 4px 20px rgba(0,0,0,0.4);
    letter-spacing: -1px;
}

.hero p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.25rem;
    margin-bottom: 35px;
    font-weight: 400;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.btn-hero {
    background: var(--accent);
    color: var(--text-dark);
    padding: 16px 45px;
    font-size: 1.1rem;
    font-weight: 700;
    border-radius: 50px;
    box-shadow: 0 10px 25px rgba(245, 158, 11, 0.4);
    display: inline-block;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-hero:hover {
    background: var(--white);
    color: var(--primary);
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0,0,0,0.3);
}

/* =========================================
   SERVICES / FEATURE CARDS
   ========================================= */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    position: relative;
    z-index: 10;
}

.service-card {
    background: var(--white);
    padding: 50px 30px;
    border-radius: var(--radius-md);
    text-align: center;
    box-shadow: var(--shadow-md);
    border: 1px solid rgba(0,0,0,0.03);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.service-card:hover {
    transform: translateY(-12px);
    box-shadow: var(--shadow-glow);
    border-color: rgba(34, 197, 94, 0.2);
}

.service-card i {
    font-size: 2.5rem;
    color: var(--primary);
    margin-bottom: 25px;
    background: var(--primary-soft);
    width: 85px;
    height: 85px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: var(--transition);
}

.service-card:hover i {
    background: var(--primary);
    color: var(--white);
    transform: scale(1.1);
    box-shadow: 0 10px 20px rgba(22, 101, 52, 0.2);
}

.service-card h3 {
    font-size: 1.4rem;
    margin-bottom: 12px;
    color: var(--text-dark);
}

.service-card p {
    color: var(--text-body);
    margin-bottom: 30px;
    font-size: 0.95rem;
    flex-grow: 1;
}

.btn-apply {
    padding: 10px 28px;
    background: var(--primary-soft);
    color: var(--primary);
    border-radius: 50px;
    font-weight: 700;
    font-size: 0.9rem;
    transition: var(--transition);
    border: 1px solid transparent;
}

.service-card:hover .btn-apply {
    background: var(--primary);
    color: var(--white);
    box-shadow: 0 4px 15px rgba(22, 101, 52, 0.3);
}

/* =========================================
   GENERAL PAGE LAYOUT
   ========================================= */
.container {
    max-width: 1200px;
    margin: 40px auto;
    padding: 40px;
    background: var(--white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    min-height: 50vh;
}

.page-header {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    padding: 80px 20px;
    text-align: center;
    margin-bottom: -40px; /* Pulls container up over the background */
    padding-bottom: 120px;
}

.page-header h1 {
    color: var(--white);
    font-size: 2.8rem;
    margin-bottom: 10px;
}

/* =========================================
   FORMS & INPUTS
   ========================================= */
input[type="text"], input[type="email"], input[type="password"],
input[type="date"], input[type="number"], select, textarea {
    width: 100%;
    padding: 15px 20px;
    margin: 8px 0 20px;
    border: 2px solid #e2e8f0;
    border-radius: var(--radius-sm);
    background: var(--bg-light);
    font-family: inherit;
    font-size: 1rem;
    color: var(--text-dark);
    transition: var(--transition);
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--primary-light);
    background: var(--white);
    box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.15);
}

button, .btn {
    background: var(--primary);
    color: var(--white);
    padding: 15px 30px;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: var(--transition);
    display: inline-block;
    text-align: center;
}

button:hover, .btn:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(20, 83, 45, 0.2);
}

/* =========================================
   TABLES
   ========================================= */
table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin: 20px 0;
    background: var(--white);
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 1px solid #e2e8f0;
}

th {
    background: #f8fafc;
    color: var(--text-dark);
    padding: 18px 15px;
    text-align: left;
    text-transform: uppercase;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    border-bottom: 2px solid #e2e8f0;
}

td {
    padding: 16px 15px;
    border-bottom: 1px solid #f1f5f9;
    color: var(--text-body);
}

tr:last-child td { border-bottom: none; }
tr:hover td { background: #f8fafc; }

/* =========================================
   FOOTER
   ========================================= */
footer {
    background: var(--text-dark);
    color: #94a3b8;
    padding: 60px 20px;
    text-align: center;
    margin-top: 80px;
    border-top: 5px solid var(--accent);
}

footer a {
    color: var(--accent);
    margin: 0 10px;
    font-weight: 500;
}

footer a:hover {
    color: var(--white);
}

/* =========================================
   MOBILE RESPONSIVENESS
   ========================================= */
@media (max-width: 990px) {
    /* Header Adjustments */
    .main-header .header-text h1 { font-size: 2.2rem; }
    .main-header .header-text p { font-size: 0.9rem; }
    
    .hero h1 { font-size: 2.8rem; }
    .hero { clip-path: polygon(0 0, 100% 0, 100% 95%, 0 100%); }

    /* Navbar Layout */
    .nav-container { justify-content: flex-end; }
    .hamburger { display: flex; z-index: 2001; }

    /* Hamburger Animation */
    .hamburger.active .bar:nth-child(1) { transform: translateY(8px) rotate(45deg); }
    .hamburger.active .bar:nth-child(2) { opacity: 0; }
    .hamburger.active .bar:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

    /* Mobile Menu Drawer */
    .nav-menu {
        opacity: 0;
        visibility: hidden;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: var(--white);
        flex-direction: column;
        align-items: flex-start;
        box-shadow: 0 20px 25px -5px rgba(0,0,0,0.1);
        border-top: 3px solid var(--accent);
        transform: translateY(-10px);
        transition: var(--transition);
        padding: 10px 0 20px 0;
        z-index: 2000;
    }

    .nav-menu.active {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }

    .nav-menu a, .dropbtn {
        color: var(--text-dark);
        padding: 15px 25px;
        width: 100%;
        border-bottom: 1px solid #f1f5f9;
        border-radius: 0;
    }
    
    .nav-menu a:hover { background: var(--bg-light); color: var(--primary); }
    .nav-menu a::after, .dropbtn::after { display: none; } /* Hide underline effect on mobile */

    /* Mobile Dropdown Fix */
    .dropdown { width: 100%; }
    .dropdown-content {
        position: static;
        box-shadow: none;
        display: none;
        border: none;
        border-left: 4px solid var(--primary);
        background: #f8fafc;
        width: 100%;
        margin: 0;
        border-radius: 0;
        opacity: 1; visibility: visible; transform: none; /* Override desktop hover animations */
    }
    
    .dropdown.active .dropdown-content { display: block; }
    
    /* Mobile Login Button */
    .login-btn {
        width: calc(100% - 50px);
        margin: 20px 25px 0;
        text-align: center;
        justify-content: center;
    }
}