/* ========================================
   ICAR Pesticides Website - Professional Styles
   ======================================== */

/* CSS Variables */
:root {
    --primary-color: #2c5f2d;
    --primary-dark: #1a3a1b;
    --secondary-color: #ff9800;
    --accent-color: #4caf50;
    --text-dark: #333333;
    --text-light: #666666;
    --text-white: #ffffff;
    --bg-light: #f8f9fa;
    --bg-white: #ffffff;
    --border-color: #e0e0e0;
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.15);
    --transition: all 0.3s ease;
    --border-radius: 8px;
    --font-primary: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-primary);
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-dark);
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    overflow-x: hidden;
}

/* For WebKit browsers (Chrome, Edge, Safari) */
::-webkit-scrollbar {
    width: 4px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: beige;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 4px;
    border: none;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--secondary-color);
}

::-webkit-scrollbar-thumb:active {
    background: var(--primary-dark);
}

::-webkit-scrollbar-corner {
    background: var(--secondary-color);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

ul {
    list-style: none;
}

button {
    border: none;
    background: none;
    cursor: pointer;
    font-family: inherit;
}

/* ========================================
   TOP HEADER
   ======================================== */
.top-header {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-color) 100%);
    color: var(--text-white);
    padding: 3px 0;
    font-size: 14px;
    border-bottom: 2px solid var(--secondary-color);
}

.top-header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.top-header-left,
.top-header-right {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.header-link {
    color: var(--text-white);
    display: flex;
    align-items: center;
    gap: 8px;
    opacity: 0.95;
    transition: var(--transition);
}

.header-link:hover {
    opacity: 1;
    color: var(--secondary-color);
    transform: translateY(-2px);
}

.header-link i {
    font-size: 14px;
}

.social-i {
    padding: 5px;
    font-size: 16px;
}

.social-i:hover i {
    color: var(--secondary-color);
    transform: translateY(-2px);
}

/* ========================================
   MAIN HEADER
   ======================================== */
.main-header {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 8px 0;
    box-shadow: var(--shadow-sm);
    position: sticky;
    z-index: 998;
    top: 0;
    transition: var(--transition);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-section {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo {
    width: 70px;
    height: 70px;
    object-fit: contain;
}

.logo-text h1 {
    font-size: 24px;
    color: var(--primary-color);
    font-weight: 700;
    margin-bottom: 2px;
    line-height: 1.2;
}

.tagline {
    font-size: 13px;
    color: var(--text-light);
    font-weight: 400;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.search-toggle {
    padding: 0 15px;
    width: auto;
    height: 45px;
    border-radius: 15px;
    background: var(--primary-color);
    color: var(--text-white);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.search-toggle i {
    margin-right: 5px;
}

.search-toggle:hover {
    background: var(--primary-dark);
    transform: translateY(-3px);
    color: var(--secondary-color);
}

.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    width: 30px;
    position: relative;
    z-index: 1002;
}

.mobile-menu-toggle span {
    width: 100%;
    height: 3px;
    background: var(--primary-color);
    border-radius: 3px;
    transition: var(--transition);
}


/* ========================================
   MAIN NAVIGATION
   ======================================== */
.main-nav {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    box-shadow: var(--shadow-md);
    position: relative;
    z-index: 998;
}

.nav-menu {
    display: flex;
    justify-content: center;
    align-items: center;
}

.nav-item {
    position: relative;
    width: -webkit-fill-available;
}

.nav-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 8px 8px;
    color: var(--text-white);
    font-weight: 500;
    font-size: 15px;
    transition: var(--transition);
    position: relative;
}

.nav-link::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 3px;
    background: var(--secondary-color);
    transform: translateX(-50%);
    transition: var(--transition);
}

.nav-item:hover .nav-link::before,
.nav-item.active .nav-link::before {
    width: 80%;
}

.nav-link:hover,
.nav-item.active .nav-link {
    background: rgba(255, 255, 255, 0.1);
    color: var(--secondary-color);
}

.nav-link i.fa-chevron-down {
    font-size: 12px;
    transition: var(--transition);
}

.nav-item:hover .nav-link i.fa-chevron-down {
    transform: rotate(180deg);
}

/* Dropdown Menu */
.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--bg-white);
    min-width: 220px;
    box-shadow: var(--shadow-lg);
    border-radius: 0 0 var(--border-radius) var(--border-radius);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: var(--transition);
    z-index: 1000;
}

.nav-item:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-menu li {
    border-bottom: 1px solid var(--border-color);
}

.dropdown-menu li:last-child {
    border-bottom: none;
}

.dropdown-menu a {
    display: block;
    padding: 12px 20px;
    color: var(--text-dark);
    font-size: 14px;
    transition: var(--transition);
}

.dropdown-menu a:hover {
    background: var(--bg-light);
    color: var(--primary-color);
    padding-left: 25px;
}

/* ========================================
   MAIN CONTENT
   ======================================== */
.main-content {
    min-height: 60vh;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

/* ========================================
   FOOTER
   ======================================== */
.main-footer {
    background: linear-gradient(135deg, var(--primary-dark) 0%, #1a1a1a 100%);
    color: var(--text-white);
    margin-top: 60px;
}

.footer-top {
    padding: 60px 0 40px;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
}

.footer-col h3 {
    font-size: 20px;
    margin-bottom: 20px;
    color: var(--secondary-color);
    position: relative;
    padding-bottom: 10px;
}

.footer-col h3::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 50px;
    height: 3px;
    background: var(--secondary-color);
}

.footer-col p {
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 20px;
    line-height: 1.8;
}

.social-links {
    display: flex;
    gap: 12px;
}

.social-links a {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-white);
    transition: var(--transition);
}

.social-links a:hover {
    background: var(--secondary-color);
    transform: translateY(-5px);
}

.footer-links li {
    margin-bottom: 12px;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    transition: var(--transition);
}

.footer-links a::before {
    content: '→';
    opacity: 1;
    transform: translateX(-10px);
    transition: var(--transition);
}

.footer-links a:hover {
    color: var(--secondary-color);
    padding-left: 10px;
}

.footer-links a:hover::before {
    opacity: 1;
    color: var(--secondary-color);
    transform: translateX(0);
}

.footer-contact li {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
    color: rgba(255, 255, 255, 0.8);
}

.footer-contact i {
    width: 20px;
    color: var(--secondary-color);
    font-size: 18px;
    margin-top: 2px;
}

.footer-bottom {
    background: rgba(0, 0, 0, 0.3);
    padding: 25px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-bottom-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.footer-bottom p {
    color: rgba(255, 255, 255, 0.7);
}

.footer-legal {
    display: flex;
    gap: 25px;
    flex-wrap: wrap;
}

.footer-legal a {
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
    transition: var(--transition);
}

.footer-legal a:hover {
    color: var(--secondary-color);
}

/* ========================================
   MOBILE MENU OVERLAY
   ======================================== */
.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.mobile-menu-overlay.active {
    opacity: 1;
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */
@media (max-width: 1024px) {
    .logo-text h1 {
        font-size: 20px;
    }

    .tagline {
        font-size: 12px;
    }

    .nav-link {
        padding: 15px 15px;
        font-size: 14px;
    }
}

@media (max-width: 768px) {
    .social-icons {
        display: none;
    }


    .top-header-content {
        font-size: 12px;
        gap: 5px;
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .top-header-left {
        flex-direction: row;
        justify-content: center;
        gap: 15px;
        width: 100%;
    }

    .top-header-right {
        justify-content: center;
        gap: 8px;
        width: 100%;
    }

    .logo {
        width: 50px;
        height: 50px;
    }

    .logo-text h1 {
        font-size: 18px;
    }

    .tagline {
        font-size: 11px;
    }

    .mobile-menu-toggle {
        display: flex;
    }

    .mobile-menu-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(6px, 6px);
    }

    .mobile-menu-toggle.active span:nth-child(2) {
        opacity: 0;
    }

    .mobile-menu-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(6px, -6px);
    }

    /* Enhanced Mobile Navigation */
    .nav-menu {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: var(--primary-color);
        flex-direction: column;
        align-items: stretch;
        justify-content: flex-start;
        padding: 80px 20px 30px;
        max-height: 100vh;
        overflow-y: auto;
        transform: translateX(-100%);
        transition: transform 0.4s ease;
        z-index: 1000;
    }

    .nav-menu.active {
        transform: translateX(0);
        box-shadow: var(--shadow-lg);
    }

    .nav-menu.active .main-header {
        display: none;
    }

    .nav-link {
        padding: 18px 20px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        font-size: 16px;
        justify-content: space-between;
        border-radius: 8px;
        margin-bottom: 5px;
        transition: all 0.3s ease;
    }

    .nav-link:hover {
        background: rgba(255, 255, 255, 0.15);
        transform: translateX(5px);
    }

    /* Mobile Dropdown Styles */
    .dropdown-menu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        max-height: 0;
        overflow: hidden;
        background: rgba(0, 0, 0, 0.2);
        border-radius: 8px;
        margin: 10px 0;
        transition: max-height 0.4s ease;
    }

    .nav-item.dropdown-active .dropdown-menu {
        max-height: 500px;
    }

    .dropdown-menu a {
        color: rgba(255, 255, 255, 0.9);
        padding: 15px 25px;
        font-size: 15px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        transition: all 0.3s ease;
    }

    .dropdown-menu a:hover {
        background: rgba(255, 255, 255, 0.1);
        padding-left: 35px;
        color: var(--secondary-color);
    }

    .dropdown-menu a:last-child {
        border-bottom: none;
    }

    /* Mobile Close Button */
    .mobile-close-btn {
        position: fixed;
        top: 40px;
        right: 10px;
        width: 40px;
        height: 40px;
        background: var(--secondary-color);
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        color: white;
        font-size: 20px;
        z-index: 1001;
        box-shadow: var(--shadow-md);
        transition: var(--transition);
    }

    .mobile-close-btn:hover {
        background: #e68900;
        transform: scale(1.1);
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .footer-bottom-content {
        flex-direction: column;
        text-align: center;
    }

    .footer-legal {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .search-toggle {
        display: none;
    }

    .container {
        padding: 0 15px;
    }

    .top-header {
        font-size: 12px;
    }

    .top-header-left,
    .top-header-right {
        width: 100%;
        justify-content: center;
    }

    .logo-text h1 {
        font-size: 16px;
    }

    .search-form input {
        padding: 12px 20px;
        font-size: 14px;
    }

    .search-form button {
        padding: 12px 20px;
    }

    .footer-top {
        padding: 40px 0 30px;
    }

    .nav-menu {
        padding: 70px 15px 20px;
    }

    .nav-link {
        padding: 16px 15px;
        font-size: 15px;
    }

    .dropdown-menu a {
        padding: 14px 20px;
        font-size: 14px;
    }
}

/* ========================================
   UTILITY CLASSES
   ======================================== */
.text-center {
    text-align: center;
}

.mt-20 {
    margin-top: 20px;
}

.mb-20 {
    margin-bottom: 20px;
}

.btn-primary {
    display: inline-block;
    padding: 12px 30px;
    background: var(--primary-color);
    color: var(--text-white);
    border-radius: var(--border-radius);
    font-weight: 500;
    transition: var(--transition);
    border: 2px solid var(--primary-color);
}

.btn-primary:hover {
    background: transparent;
    color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    display: inline-block;
    padding: 12px 30px;
    background: var(--secondary-color);
    color: var(--text-white);
    border-radius: var(--border-radius);
    font-weight: 500;
    transition: var(--transition);
}

.btn-secondary:hover {
    background: #e68900;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* Loader Styles */
.loader-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #ffffff;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.loader-container.hidden {
    opacity: 0;
    visibility: hidden;
}

.loader-content {
    text-align: center;
}

.loader-spinner {
    position: relative;
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
}

.spinner-ring {
    position: absolute;
    width: 64px;
    height: 64px;
    margin: 8px;
    border: 8px solid transparent;
    border-radius: 50%;
    animation: spinner 1.2s cubic-bezier(0.5, 0, 0.5, 1) infinite;
    border-top-color: #ff9800;
}

.spinner-ring:nth-child(1) {
    animation-delay: -0.45s;
}

.spinner-ring:nth-child(2) {
    animation-delay: -0.3s;
    border-top-color: #2c5f2d;
}

.spinner-ring:nth-child(3) {
    animation-delay: -0.15s;
    border-top-color: #ff9800;
}

.spinner-ring:nth-child(4) {
    border-top-color: #1a3a1b;
}

.loader-text {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 16px;
    font-weight: 500;
    color: #2c3e50;
    letter-spacing: 1px;
}

@keyframes spinner {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Desktop-only sticky navigation */
@media (min-width: 769px) {
    .main-nav.sticky {
        position: sticky;
        top: 0;
        z-index: 997;
        box-shadow: var(--shadow-lg);
        animation: slideDown 0.3s ease;
    }

    .main-header.hidden {
        transform: translateY(-100%);
    }
}


/* VISITOR COUNTER STYLING */
.visitor-counter {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.08);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.9rem;
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.08);
    margin-bottom: 12px;
}

.visitor-counter i {
    color: var(--secondary-color);
    font-size: 1.3rem;
}

.visitor-counter a {
    margin: 0 !important;
    padding: 0 !important;
    color: var(--secondary-color) !important;
}

/* Dynamic Content Table Styles */
.section-text table, 
.card-body table,
.page-overlay-content table {
    width: 100% !important;
    border-collapse: collapse !important;
    margin: 20px 0 !important;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.section-text table th, 
.section-text table td,
.card-body table th,
.card-body table td,
.page-overlay-content table th,
.page-overlay-content table td {
    border: 1px solid #ddd !important;
    padding: 12px 15px !important;
    text-align: left !important;
}

.section-text table th,
.card-body table th,
.page-overlay-content table th {
    background-color: #f8f9fa !important;
    font-weight: 700 !important;
    color: #2c5f2d !important;
}

.section-text table tr:nth-child(even),
.card-body table tr:nth-child(even),
.page-overlay-content table tr:nth-child(even) {
    background-color: #fafafa;
}

.section-text table tr:hover,
.card-body table tr:hover,
.page-overlay-content table tr:hover {
    background-color: #f1f1f1;
}