/* Import Google Fonts directly */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;600;700&display=swap');

/* Remove mobile tap highlights and blue cursor - CRITICAL */
* {
    -webkit-tap-highlight-color: transparent !important;
    -webkit-touch-callout: none !important;
}

a, button, input, select, textarea, [role="button"], [tabindex], .btn, .nav-link, .navbar-toggler {
    -webkit-tap-highlight-color: transparent !important;
    -webkit-touch-callout: none !important;
    -webkit-user-select: none !important;
    -moz-user-select: none !important;
    -ms-user-select: none !important;
    user-select: none !important;
}

/* Exception for modal elements - allow interactions */
.modal button, .modal .btn, .modal a, .modal [role="button"],
div.modal button, div.modal .btn, div.modal a, div.modal [role="button"] {
    -webkit-user-select: auto !important;
    -moz-user-select: auto !important;
    -ms-user-select: auto !important;
    user-select: auto !important;
    pointer-events: auto !important;
    cursor: pointer !important;
}

/* Allow text selection for input fields and content areas */
input, textarea, [contenteditable] {
    -webkit-user-select: text;
    -khtml-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    user-select: text;
}

/* Allow text selection for specific content areas */
p, span, div, h1, h2, h3, h4, h5, h6 {
    -webkit-user-select: text;
    -khtml-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    user-select: text;
}

/* Ensure proper viewport behavior */
html, body {
    height: 100%;
    overflow-x: hidden;
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    font-family: 'Poppins', sans-serif;
    font-weight: 400;
    color: #333;
}

main {
    flex: 1;
}

:root {
    --primary-color: #003366;
    --primary-color-light: rgba(0, 51, 102, 0.85);
}

/* 1. Update logo size */
.logo-img {
    height: 40px; /* Reduced from 60px */
    width: auto;
    max-width: 100%;
}

body, .dropdown-menu {
    font-family: 'Poppins', sans-serif;
    font-weight: 400;
    color: #333;
}

/* Navbar styling is handled entirely in navbar-styles.css to avoid conflicts */

/* 2. Ensure navbar has correct background color */
.navbar.bg-primary {
    background-color: #003366 !important; /* Force the right color */
}

.navbar-brand {
    font-weight: 600;
    display: flex;
    align-items: center;
}

.navbar-brand img {
    margin-right: 10px;
}

.navbar-nav .nav-link {
    font-weight: 500;
    letter-spacing: 0.5px;
    padding-top: 10px;
    padding-bottom: 10px;
}

.dropdown-menu .dropdown-item {
    font-weight: 400;
}

/* Fix logout button in dropdown */
.dropdown-menu form.dropdown-item {
    margin: 0;
    padding: 0;
}

.dropdown-menu .btn-link {
    color: #212529 !important;
    text-decoration: none !important;
    font-weight: 400 !important;
    padding: 0.25rem 1.5rem !important;
    border: none !important;
    background: none !important;
    border-radius: 0 !important;
    width: 100%;
    text-align: left;
    display: block;
}

.dropdown-menu .btn-link:hover {
    color: #16181b !important;
    background-color: #f8f9fa !important;
    text-decoration: none !important;
}

.dropdown-menu .btn-link:focus {
    color: #16181b !important;
    background-color: #f8f9fa !important;
    outline: none !important;
    box-shadow: none !important;
}

.bg-primary {
    background-color: var(--primary-color) !important;
}

.btn-primary {
    background-color: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
}

.btn-secondary {
    background-color: #6c757d;
    border-color: #6c757d;
}

.text-primary {
    color: var(--primary-color) !important;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Poppins', sans-serif;
    font-weight: bold;
    color: var(--primary-color);
}

/* Legacy footer styles removed - now using modern footer in base.html */

/* Ensure main content doesn't touch footer */
main {
    margin-bottom: 1rem;
}

/* Add extra bottom spacing for task pages */
body:has([class*="task-detail"]) main,
.container:has([class*="task"]) {
    margin-bottom: 4rem !important;
    padding-bottom: 2rem !important;
}

/* Alternative selector for task page spacing */
[title*="Task"] main,
.container[style*="font-family"] {
    margin-bottom: 4rem !important;
    padding-bottom: 2rem !important;
}

/* Add these styles at the end of the file */

/* Body class for when at top of page */
body.at-page-top .task-header {
    border-top: 0 !important;
}

/* For consistent task headers */
.task-header, 
.hmrc-header, 
.electoral-header, 
.dvla-header, 
.council-header, 
.utility-header, 
.deedpoll-header {
    background-color: #003366 !important;
    margin-top: 0 !important;
    border-top: 0 !important;
}

/* Remove any margins on container-fluid that might cause gaps */
.container-fluid.p-0 {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

/* All navbar positioning and merging is handled in navbar-styles.css */

/* Remove any possible gaps */
.container-fluid.p-0,
.full-bleed {
    margin-top: 0 !important;
    padding-top: 0 !important;
    overflow: hidden !important;
}

/* Add these at the end of the file to ensure they override other styles */

/* Disable all transitions when page loads */
.preload * {
    transition: none !important;
}

/* Override any conflicting container styles */
.container-fluid.p-0 {
    padding-top: 0 !important;
    margin-top: 0 !important;
    overflow: visible !important;
}

#start-journey {
    scroll-margin-top: 125px;  /* Adjust this value as needed */
}

/* Ensure main content doesn't touch footer */
main {
    margin-bottom: 1rem;
}

/* Add moderate bottom spacing for task pages */
body:has([class*="task-detail"]) main,
.container:has([class*="task"]) {
    margin-bottom: 2rem !important;
    padding-bottom: 1rem !important;
}

/* Alternative selector for task page spacing */
[title*="Task"] main,
.container[style*="font-family"] {
    margin-bottom: 2rem !important;
    padding-bottom: 1rem !important;
}

/* Additional mobile tap highlight removal for specific elements */
a, button, input, select, textarea, [role="button"], [tabindex] {
    -webkit-tap-highlight-color: transparent !important;
    -webkit-touch-callout: none !important;
}

/* Main container padding - removed to fix white space issue */
.main-container {
    padding-top: 0;
}

/* Remove top padding for pages with hero sections and pull hero up */
.no-top-padding .main-container {
    padding-top: 0 !important;
}

.no-top-padding .full-bleed:first-child,
.no-top-padding .home-hero:first-child,
.no-top-padding .hero-section:first-child {
    margin-top: -50px;
    padding-top: 50px;
}

/* For full-bleed sections that should touch the navbar */
.full-bleed, .home-hero, .hero-section {
    margin-left: calc(-50vw + 50%);
    margin-right: calc(-50vw + 50%);
}

/* Remove blue outline on focus for mobile while maintaining accessibility */
@media (max-width: 768px) {
    *:focus {
        outline: none !important;
        -webkit-tap-highlight-color: transparent !important;
    }
    
    /* But keep focus indicators for keyboard navigation */
    *:focus-visible {
        outline: 2px solid #003366 !important;
        outline-offset: 2px !important;
    }
}