/* Main CSS for Nagpur City Police Website */

/* Global Khand Font Application */
* {
    font-family: 'Khand', system-ui, sans-serif !important;
}

body, h1, h2, h3, h4, h5, h6, p, span, div, a, li, td, th, button, input, select, textarea {
    font-family: 'Khand', system-ui, sans-serif !important;
}

.card-title, .card-text, .btn, .nav-link, .dropdown-item {
    font-family: 'Khand', system-ui, sans-serif !important;
}

/* Global Layout */
.font-family-khand {
    font-family: 'Khand', system-ui, sans-serif !important;
}

/* Footer always at bottom */
html, body {
    height: 100%;
}

#app {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

main {
    flex: 1;
    min-height: 70vh;
}

/* Homepage specific - override the default padding */
body.homepage main {
    padding-top: 0; /* Homepage handles its own spacing */
}

/* Mobile responsive padding */
@media (max-width: 768px) {
    body.homepage main {
        padding-top: 0; /* Homepage handles its own mobile spacing */
    }
}

/* Skip Navigation */
.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: var(--police-primary, #054285);
    color: white;
    padding: 8px;
    text-decoration: none;
    z-index: 10000;
    border-radius: 0 0 4px 4px;
}

.skip-link:focus {
    top: 0;
}

/* Dark Mode Support */
body.dark-mode {
    background-color: #121212;
    color: #ffffff;
    font-family: 'Khand', system-ui, sans-serif !important;
}

.navbar-dark-mode {
    background-color: #333;
    font-family: 'Khand', system-ui, sans-serif !important;
}

/* Common Button Styles */
.btn-primary {
    background: var(--police-primary, #054285);
    border: none;
    font-family: 'Khand', sans-serif !important;
}

.btn-primary:hover {
    background: var(--police-secondary, #0b72c7);
}

.btn-secondary {
    background: var(--police-accent, #FFD700);
    color: var(--police-primary, #054285);
    border: none;
    font-family: 'Khand', sans-serif !important;
}

.btn-secondary:hover {
    background: var(--warning, #ffc107);
    color: var(--police-primary, #054285);
}

/* Dark Mode Support */
body.dark-mode {
    background-color: #121212;
    color: #ffffff;
    font-family: 'Khand', system-ui, sans-serif !important;
}

.navbar-dark-mode {
    background-color: #333;
    font-family: 'Khand', system-ui, sans-serif !important;
}

/* Common Button Styles */
.btn-primary {
    background: var(--police-primary, #054285);
    border: none;
    font-family: 'Khand', sans-serif !important;
}

.btn-primary:hover {
    background: var(--police-secondary, #0b72c7);
}

.btn-secondary {
    background: var(--police-accent, #FFD700);
    color: var(--police-primary, #054285);
    border: none;
    font-family: 'Khand', sans-serif !important;
}

.btn-secondary:hover {
    background: var(--warning, #ffc107);
    color: var(--police-primary, #054285);
}

/* Common Card Styles */
.card {
    border: none;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

/* Utility Classes */
.text-primary-custom {
    color: var(--police-primary, #054285) !important;
}

.text-secondary-custom {
    color: var(--police-secondary, #0b72c7) !important;
}

.bg-primary-custom {
    background: var(--police-primary, #054285) !important;
}

.bg-secondary-custom {
    background: var(--police-accent, #FFD700) !important;
}

/* Responsive Utilities */
@media (max-width: 768px) {
    .mobile-hide {
        display: none !important;
    }
}

@media (min-width: 769px) {
    .desktop-hide {
        display: none !important;
    }
}

/* Icon Styles - Force icons to be visible */
.fas, .fa, .fab, .far, .fal, .fad, .fass, .fasr, .fasl, .fast {
    color: inherit !important;
    opacity: 1 !important;
    visibility: visible !important;
    display: inline-block !important;
    font-family: "Font Awesome 6 Free" !important;
    font-weight: 900 !important;
    -webkit-font-smoothing: antialiased !important;
    text-rendering: auto !important;
}

/* Ensure Font Awesome solid icons work */
.fas::before, .fa-solid::before {
    font-family: "Font Awesome 6 Free" !important;
    font-weight: 900 !important;
}

/* Ensure Font Awesome regular icons work */
.far::before, .fa-regular::before {
    font-family: "Font Awesome 6 Free" !important;
    font-weight: 400 !important;
}

/* Top bar icons should be white */
.top-bar .fas, .top-bar .fa {
    color: white !important;
}

/* Navigation icons should use the theme color */
.main-navigation .fas, .main-navigation .fa,
.mobile-menu .fas, .mobile-menu .fa {
    color: var(--police-secondary, #0b72c7) !important;
}

/* Search icon */
.search-btn .fas, .search-btn .fa {
    color: white !important;
}

/* Footer icons */
footer .fas, footer .fa {
    color: var(--police-secondary, #0b72c7) !important;
}

/* Prevent service icon filters from affecting Font Awesome icons */
.fas, .fa, [class^="fa-"], [class*=" fa-"] {
    filter: none !important;
}

/* Comprehensive Theme Color Override - All Blue Elements */
/* Use high specificity and !important to override compiled/vendor CSS safely */
.top-bar,
.main-navigation,
.nav-link,
.headline,
.headline-bg,
.popup,
.search-btn,
.search-input-group,
.owl-carousel .over-layer {
    background: var(--police-secondary, #0b72c7) !important;
    background-image: none !important;
    box-shadow: none !important;
}

.main-header {
    background: transparent !important;
    background-image: none !important;
}

.head-border {
    border-color: var(--police-secondary, #0b72c7) !important;
}

.text-primary-custom,
.btn-primary,
.btn-primary:hover {
    color: #ffffff !important;
    background: var(--police-secondary, #0b72c7) !important;
    border-color: var(--police-secondary, #0b72c7) !important;
}

.logo-text h1 {
    color: var(--police-secondary, #0b72c7) !important;
    background: transparent !important;
}

.logo-text p {
    color: var(--police-secondary, #0b72c7) !important;
    background: transparent !important;
}

.bg-primary-custom {
    background: var(--police-secondary, #0b72c7) !important;
}

/* Ensure dropdown hover states use flat color */
.dropdown-menu a:hover {
    background: #f8f9fa !important;
    color: var(--police-secondary, #0b72c7) !important;
    border-left-color: var(--police-secondary, #0b72c7) !important;
}

/* Scroll to Top Button */
.scroll-to-top {
    position: fixed;
    bottom: 90px;
    left: 20px;
    z-index: 100000;
    width: 50px;
    height: 50px;
    border: 2px solid white;
    border-radius: 50%;
    background: var(--police-secondary, #0b72c7);
    color: white;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(11, 114, 199, 0.3);
    transition: all 0.3s ease;
    opacity: 0;
    transform: translateY(20px);
}

.scroll-to-top.show {
    display: flex;
    opacity: 1;
    transform: translateY(0);
    animation: fadeInUp 0.3s ease;
}

.scroll-to-top:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(11, 114, 199, 0.5);
    background: var(--police-accent, #FFD700);
    border-color: rgba(255, 255, 255, 0.9);
    color: #000;
}

.scroll-to-top:active {
    transform: translateY(-1px);
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Mobile responsive */
@media (max-width: 768px) {
    .scroll-to-top {
        bottom: 80px;
        left: 20px;
        width: 45px;
        height: 45px;
    }
    
    .scroll-to-top svg {
        width: 20px;
        height: 20px;
    }
}

/* WhatsApp Chatbot Float Button */
.whatsapp-chatbot-float {
    position: fixed;
    bottom: 100px;
    right: 20px;
    width: 60px;
    height: 60px;
    background: var(--police-secondary, #0b72c7);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(11, 114, 199, 0.4);
    z-index: 998;
    transition: all 0.3s ease;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.whatsapp-chatbot-float svg {
    width: 35px;
    height: 35px;
}

.whatsapp-chatbot-float:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 6px 20px rgba(11, 114, 199, 0.6);
    background: var(--police-primary, #1e3a8a);
}

/* Mobile responsive */
@media (max-width: 768px) {
    .whatsapp-chatbot-float {
        bottom: 90px;
        right: 20px;
        width: 50px;
        height: 50px;
    }
    
    .whatsapp-chatbot-float svg,
    .whatsapp-chatbot-float img {
        width: 28px;
        height: 28px;
    }
}

/* Accessibility Widget Mobile Fix */
/* Ensure accessibility widget close button is clickable on mobile */
@media (max-width: 768px) {
    /* Ensure UX4G accessibility widget buttons are clickable */
    [id*="ux4g"] button,
    [class*="ux4g"] button,
    [id*="accessibility"] button,
    [class*="accessibility"] button,
    #ux4g-widget button,
    #ux4g-widget .close,
    #ux4g-widget [role="button"],
    .ux4g-widget button,
    .ux4g-widget .close,
    .ux4g-widget [role="button"] {
        pointer-events: auto !important;
        touch-action: manipulation !important;
        z-index: 999999 !important;
        cursor: pointer !important;
        position: relative !important;
    }
    
    /* Specifically target close button */
    [id*="ux4g-close"],
    [class*="ux4g-close"],
    [id*="accessibility-close"],
    [class*="close-accessibility"],
    [class*="ux4g"] [class*="close"],
    #ux4g-widget [class*="close"],
    .ux4g-widget [class*="close"] {
        pointer-events: auto !important;
        touch-action: manipulation !important;
        z-index: 999999 !important;
        cursor: pointer !important;
        position: relative !important;
        min-width: 44px !important;
        min-height: 44px !important;
    }
    
    /* Ensure entire widget panel has proper z-index */
    [id*="ux4g"],
    [class*="ux4g"],
    #ux4g-widget,
    .ux4g-widget {
        z-index: 99999 !important;
        position: fixed !important;
    }
}

/* Global fix for all screen sizes */
[id*="ux4g"] *,
[class*="ux4g"] *,
#ux4g-widget *,
.ux4g-widget * {
    pointer-events: auto !important;
}
