/**
 * Premium Web Portal Custom Styles and Overrides (Saffron + Navy + White Theme)
 */

/* HSL Tailored Brand Colors */
:root {
    --color-primary-rgb: 234, 88, 12;      /* Saffron #EA580C */
    --color-secondary-rgb: 30, 58, 138;    /* Navy #1E3A8A */
    --color-accent-rgb: 234, 179, 8;       /* Saffron Yellow #EAB308 */
    
    --color-primary: rgb(var(--color-primary-rgb));
    --color-secondary: rgb(var(--color-secondary-rgb));
    --color-accent: rgb(var(--color-accent-rgb));
    
    --color-navy-light: #1E293B;
    --color-navy-dark: #0B0F19;
}

/* Premium Typography Rules */
body {
    font-family: 'Poppins', 'Hind Siliguri', sans-serif;
    background-color: #F8FAFC;
}

/* High-End Spacing & Spacers */
.section-padding {
    padding-top: 5rem;
    padding-bottom: 5rem;
}
@media (min-width: 768px) {
    .section-padding {
        padding-top: 7rem;
        padding-bottom: 7rem;
    }
}

/* 3XS / 2XS Custom Text Utility helper classes for subtexts */
.text-3xs {
    font-size: 0.65rem;
}
.text-2xs {
    font-size: 0.75rem;
}

/* Custom Scrollbar Styles for Premium App Feel */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: #F1F5F9; 
}
::-webkit-scrollbar-thumb {
    background: #CBD5E1; 
    border-radius: 4px;
    transition: background 0.2s ease;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--color-primary); 
}

/* Glassmorphism Styling Utilities */
.glassmorphism {
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.4);
}

.glassmorphism-dark {
    background: rgba(11, 15, 25, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

/* Subtle Micro-animations & Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.96);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.animate-fade-in-up {
    animation: fadeInUp 0.7s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.animate-scale-in {
    animation: scaleIn 0.45s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Premium Card hover effects */
.hover-card-trigger {
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.hover-card-trigger:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.05), 0 10px 10px -5px rgba(0, 0, 0, 0.02);
}

/* Responsive Hide Utilities */
.hide-scrollbar::-webkit-scrollbar {
    display: none;
}
.hide-scrollbar {
    -ms-overflow-style: none;  /* IE and Edge */
    scrollbar-width: none;  /* Firefox */
}

/* Skeleton Loading Animation */
.skeleton-box {
    background: linear-gradient(90deg, #F1F5F9 25%, #E2E8F0 50%, #F1F5F9 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s infinite linear;
}

@keyframes skeleton-shimmer {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Drag & Drop File Upload states */
.dragover-active {
    border-color: var(--color-primary) !important;
    background-color: rgba(234, 88, 12, 0.04) !important;
}

/* Lightbox scrolling lock state */
.lightbox-open {
    overflow: hidden !important;
}

/* Leaflet Map Overrides to resolve layout and z-index issues */
.leaflet-container {
    z-index: 10 !important;
}
.leaflet-control-container .leaflet-top,
.leaflet-control-container .leaflet-bottom {
    z-index: 20 !important;
}

/* Premium Button Shadows */
.shadow-premium-primary {
    box-shadow: 0 4px 14px 0 rgba(234, 88, 12, 0.3);
}
.shadow-premium-primary:hover {
    box-shadow: 0 6px 20px 0 rgba(234, 88, 12, 0.4);
}
.shadow-premium-secondary {
    box-shadow: 0 4px 14px 0 rgba(30, 58, 138, 0.2);
}
.shadow-premium-secondary:hover {
    box-shadow: 0 6px 20px 0 rgba(30, 58, 138, 0.3);
}

/* Custom Swiper/Lightbox Styles */
#gallery-lightbox {
    z-index: 3000 !important;
}

/* Premium Homepage Redesign Overrides */
.hero-gradient-overlay {
    background: linear-gradient(135deg, rgba(30, 58, 138, 0.95) 0%, rgba(15, 23, 42, 0.98) 100%);
}

.card-glass-navy {
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.card-glass-white {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.04);
}

.saffron-gradient-border {
    border-image: linear-gradient(to right, #EA580C, #EAB308) 1;
}

/* Timeline Custom Styles */
.timeline-line {
    position: absolute;
    left: 20px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #E2E8F0;
}

.timeline-dot {
    position: relative;
    z-index: 10;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--color-primary);
    border: 3px solid #FFF;
    box-shadow: 0 0 0 4px rgba(234, 88, 12, 0.15);
}

.timeline-dot.live {
    background: #10B981;
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.25);
}

/* App-like Touch Target Improvements */
.touch-target-premium {
    min-height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* 2-Column Mobile Grid Spacing */
@media (max-width: 640px) {
    .mobile-grid-2col {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
}

/* Global Mobile Scroll Safety Reset */
html,
body {
    max-width: 100% !important;
    width: 100% !important;
}

/* Strict Image Responsiveness */
img {
    max-width: 100% !important;
    height: auto !important;
}

/* Viewport-safe layout helper to prevent flex/grid squishing */
.min-w-0-safe {
    min-width: 0 !important;
}

/* Viewport safe overlays and popups */
#emergency-popup-overlay > div,
.modal-viewport-safe {
    max-height: 85vh !important;
    overflow-y: auto !important;
    max-width: 92vw !important;
    margin: auto !important;
}

/* Guarantee Drawers and Overlays stay inside the viewport */
#search-overlay,
#gallery-lightbox,
#emergency-popup-overlay,
#notification-bottom-sheet {
    max-width: 100vw !important;
}

/* Avoid content breakages for tables, embeds, and maps */
table, 
iframe, 
video, 
canvas, 
svg {
    max-width: 100% !important;
}

/* Clean fallback block for any custom absolute shapes */
.overflow-x-hidden-wrapper {
    overflow-x: hidden !important;
    max-width: 100% !important;
    width: 100% !important;
}

/* Hide header subtext on very narrow viewports to prevent brand identity overflow */
@media (max-width: 380px) {
    .header-subtext {
        display: none !important;
    }
}

/* Safe Area Padding for iOS Devices */
.pb-safe {
    padding-bottom: calc(0.5rem + env(safe-area-inset-bottom, 0px)) !important;
}

/* Bottom Navigation Offset for Mobile Screens */
@media (max-width: 1023px) {
    body {
        padding-bottom: 5rem !important; /* 80px offset for the mobile navigation dock */
    }
}

/* ====================================================
   OFFICIAL NEWS & ANNOUNCEMENTS PREMIUM STYLING
   ==================================================== */

/* Official Communication Sealed/Verified Badge */
.news-badge-official {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.625rem;
    font-size: 0.65rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-radius: 9999px;
    background: rgba(30, 58, 138, 0.08); /* Navy light tint */
    color: var(--color-secondary);
    border: 1px solid rgba(30, 58, 138, 0.15);
}

.news-badge-official::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #10B981; /* Emerald green */
    margin-right: 6px;
    display: inline-block;
    box-shadow: 0 0 8px #10B981;
}

/* Government Stamp Watermark for Details Page */
.official-seal-bg {
    position: relative;
}
.official-seal-bg::after {
    content: '';
    position: absolute;
    bottom: 2rem;
    right: 2rem;
    width: 120px;
    height: 120px;
    background: url('../images/official_seal_watermark.png') no-repeat center;
    background-size: contain;
    opacity: 0.04;
    pointer-events: none;
    z-index: 1;
}

/* Premium Card Layout Grids */
.news-premium-shadow {
    box-shadow: 0 4px 20px -2px rgba(15, 23, 42, 0.03), 0 2px 8px -1px rgba(15, 23, 42, 0.02);
}
.news-premium-shadow:hover {
    box-shadow: 0 20px 30px -10px rgba(15, 23, 42, 0.08), 0 4px 12px -2px rgba(15, 23, 42, 0.03);
}

/* Custom Scrollbars for Announcements list */
.custom-announcement-scroll {
    max-height: 480px;
    overflow-y: auto;
}
.custom-announcement-scroll::-webkit-scrollbar {
    width: 4px;
}
.custom-announcement-scroll::-webkit-scrollbar-thumb {
    background: rgba(30, 58, 138, 0.15);
    border-radius: 2px;
}
.custom-announcement-scroll::-webkit-scrollbar-thumb:hover {
    background: var(--color-primary);
}

/* Scrolling Banner Ticker Container */
.premium-ticker-bar {
    background: linear-gradient(90deg, rgba(30,58,138,0.02) 0%, rgba(234,88,12,0.02) 100%);
    border-top: 1px solid rgba(226, 232, 240, 0.8);
    border-bottom: 1px solid rgba(226, 232, 240, 0.8);
}

/* Micro-interaction scale overrides */
.news-card-img-zoom:hover img {
    transform: scale(1.03);
}

/* Government Release Header styling */
.press-release-letterhead {
    border-bottom: 3px double #CBD5E1;
    background-color: #FCFDFE;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.01);
}

