/* Mayil Mark - Official Brand Theme & Retina Stylesheet */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=Noto+Sans+Tamil:wght@400;500;600;700&display=swap');

:root {
    /* Official Mayil Mark Logo Colors */
    --brand-primary: #B82418;
    --brand-primary-dark: #861D17;
    --brand-primary-light: #DB1D03;
    --brand-accent: #F9B43F;
    --brand-accent-dark: #E29415;
    --brand-accent-light: #FDE8B3;
    --brand-gold: #F59E0B;
    --brand-emerald: #059669;
    --font-main: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
    --font-tamil: 'Noto Sans Tamil', 'Plus Jakarta Sans', sans-serif;
}

body {
    font-family: var(--font-main);
    background-color: #FAFAF9;
    background-image: 
        radial-gradient(circle at 12% 15%, rgba(249, 180, 63, 0.08) 0%, transparent 45%),
        radial-gradient(circle at 88% 85%, rgba(184, 36, 24, 0.06) 0%, transparent 45%),
        linear-gradient(to bottom, rgba(250, 250, 249, 0.93), rgba(250, 250, 249, 0.96)),
        url('../images/bg/page-bg-agro.webp');
    background-attachment: fixed;
    background-size: cover;
    background-position: center top;
    background-repeat: no-repeat;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

html.dark body,
body.dark {
    background-color: #0F172A;
    background-image: 
        radial-gradient(circle at 12% 15%, rgba(249, 180, 63, 0.05) 0%, transparent 45%),
        radial-gradient(circle at 88% 85%, rgba(184, 36, 24, 0.06) 0%, transparent 45%),
        linear-gradient(to bottom, rgba(15, 23, 42, 0.93), rgba(15, 23, 42, 0.97)),
        url('../images/bg/page-bg-agro.webp');
    background-attachment: fixed;
    background-size: cover;
    background-position: center top;
    background-repeat: no-repeat;
}

.font-tamil {
    font-family: var(--font-tamil);
}

/* Page Loader Animation Overlay */
#global-page-loader {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: #FFFFFF;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

.dark #global-page-loader {
    background: #0F172A;
}

.loader-logo-pulse {
    animation: logoPulse 1.4s ease-in-out infinite;
}

@keyframes logoPulse {
    0%, 100% {
        transform: scale(1);
        opacity: 0.95;
    }
    50% {
        transform: scale(1.08);
        opacity: 1;
        filter: drop-shadow(0 10px 20px rgba(184, 36, 24, 0.25));
    }
}

.loader-spinner-ring {
    width: 44px;
    height: 44px;
    border: 3.5px solid rgba(184, 36, 24, 0.15);
    border-top-color: var(--brand-primary);
    border-right-color: var(--brand-accent);
    border-radius: 50%;
    animation: spinRing 0.8s linear infinite;
}

@keyframes spinRing {
    to { transform: rotate(360deg); }
}

/* AJAX Section Skeleton Shimmer */
@keyframes ajaxShimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.skeleton-shimmer {
    background: linear-gradient(90deg, #F1F5F9 25%, #E2E8F0 37%, #F1F5F9 63%);
    background-size: 400% 100%;
    animation: ajaxShimmer 1.5s ease-in-out infinite;
}

.dark .skeleton-shimmer {
    background: linear-gradient(90deg, #1E293B 25%, #334155 37%, #1E293B 63%);
    background-size: 400% 100%;
    animation: ajaxShimmer 1.5s ease-in-out infinite;
}

/* Glassmorphism effects */
.glass-panel {
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.dark .glass-panel {
    background: rgba(15, 23, 42, 0.90);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

/* Card subtle elevation and backdrop translucency for agro texture visibility */
.product-card, .category-card, .agro-card {
    background-color: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}
.dark .product-card, .dark .category-card, .dark .agro-card {
    background-color: rgba(15, 23, 42, 0.92);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

/* Micro-interaction hover lift */
.hover-lift {
    transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}
.hover-lift:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 24px -6px rgba(184, 36, 24, 0.14);
}

/* Android frame simulator */
.android-frame {
    width: 100%;
    max-width: 420px;
    height: 860px;
    margin: 0 auto;
    border-radius: 40px;
    box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.4), 0 0 0 12px #1E293B, 0 0 0 14px #334155;
    overflow: hidden;
    position: relative;
    background-color: #FAFAF9;
    background-image: 
        linear-gradient(to bottom, rgba(250, 250, 249, 0.94), rgba(250, 250, 249, 0.97)),
        url('../images/bg/page-bg-agro.webp');
    background-size: cover;
    background-position: center top;
}

.android-notch {
    width: 140px;
    height: 24px;
    background: #1E293B;
    border-bottom-left-radius: 16px;
    border-bottom-right-radius: 16px;
    margin: 0 auto;
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    z-index: 50;
}

/* iOS iPhone frame simulator */
.ios-frame {
    width: 100%;
    max-width: 420px;
    height: 860px;
    margin: 0 auto;
    border-radius: 52px;
    box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.4), 0 0 0 12px #0F172A, 0 0 0 14px #1E293B;
    overflow: hidden;
    position: relative;
    background-color: #FAFAF9;
    background-image: 
        linear-gradient(to bottom, rgba(250, 250, 249, 0.94), rgba(250, 250, 249, 0.97)),
        url('../images/bg/page-bg-agro.webp');
    background-size: cover;
    background-position: center top;
}

.ios-dynamic-island {
    width: 110px;
    height: 26px;
    background: #000000;
    border-radius: 20px;
    margin: 0 auto;
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 50;
    box-shadow: 0 2px 6px rgba(0,0,0,0.4);
}

.ios-home-indicator {
    width: 135px;
    height: 4px;
    background: #CBD5E1;
    border-radius: 9999px;
    margin: 0 auto;
    position: absolute;
    bottom: 6px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 50;
}

/* Print Invoice Stylesheet */
@media print {
    body * {
        visibility: hidden;
    }
    #printable-invoice, #printable-invoice * {
        visibility: visible;
    }
    #printable-invoice {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        margin: 0;
        padding: 24px;
        background: white !important;
        color: black !important;
    }
    .no-print {
        display: none !important;
    }
}
