/* Consolidated Styles for BkWorld.uk - Browser Compatible Version with Mobile Fixes */

/* CRITICAL MOBILE FIXES - MUST BE AT TOP */
/* Prevent horizontal scrolling on mobile */
html, body {
    overflow-x: hidden;
    width: 100%;
    -webkit-text-size-adjust: 100%; /* Prevent text scaling in Safari */
    -ms-text-size-adjust: 100%;
}

/* Ensure proper box-sizing for all elements */
*, *:before, *:after {
    -webkit-box-sizing: border-box;
    -moz-box-sizing: border-box;
    box-sizing: border-box;
}

/* Fix viewport issues on mobile devices */
@viewport {
    width: device-width;
    initial-scale: 1.0;
}

/* Original styles.css content - CLEANED UP */
.logo {
    width: 50px;
    height: 50px;
    margin-right: 10px;
    display: inline-block;
    vertical-align: middle;
}

.logo-panel {
    background-color: #000000;
    color: #fff;
    text-align: center;
    justify-content: center;
    padding: 1rem;
}

.logo-text {
    font-size: 24px;
    margin: 0;
    display: inline-block;
    vertical-align: middle;
}

img {
    max-width: 100%;
    height: auto;
    margin: 1rem 0;
}

/* Main Styles for BkWorld.uk */
body {
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
    background: #c0c0c0;
    -webkit-font-smoothing: antialiased; /* Better font rendering in Safari */
    -moz-osx-font-smoothing: grayscale;
}

main {
    max-width: 1000px;
    margin: auto;
    padding: 2rem;
    background: #fff;
    background: #e0e0e0;
    font-weight: bold;
    -webkit-box-sizing: border-box; /* Safari compatibility */
    -moz-box-sizing: border-box;
    box-sizing: border-box;
}

section {
    margin-bottom: 3rem;
}

h2 {
    color: rgb(4, 29, 77);
}

.app-links a {
    display: inline-block;
    margin-right: 1rem;
    background: #003366;
    color: #fff;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    text-decoration: none;
}

footer {
    background: #003366;
    color: #fff;
    text-align: center;
    padding: 0.5rem 0.5rem;
    font-size: 0.9rem;
    height: 100px;
    -webkit-box-sizing: border-box;
    -moz-box-sizing: border-box;
    box-sizing: border-box;
}

.lead {
    font-size: 1.2rem;
    line-height: 1.6;
    color: #0000FF;
}

/* Update button colors to match */
.btn-primary {
    background-color: #003366;
    border-color: #003366;
}

.btn-primary:hover {
    background-color: #002244;
    border-color: #002244;
}

.btn-outline-primary {
    color: #003366;
    border-color: #003366;
}

.btn-outline-primary:hover {
    background-color: #003366;
    border-color: #003366;
}

/* Navigation Styles - Enhanced for cross-browser compatibility */
.navbar {
    padding-top: 2px !important;
    padding-bottom: 2px !important;
    min-height: auto !important;
    -webkit-box-sizing: border-box;
    -moz-box-sizing: border-box;
    box-sizing: border-box;
}

.navbar-brand {
    display: -webkit-flex; /* Safari compatibility */
    display: -moz-flex;
    display: flex;
    -webkit-align-items: center;
    -moz-align-items: center;
    align-items: center;
    padding: 0 !important;
    margin: 0 !important;
}

.navbar-brand img {
    width: 80px !important;
    height: 80px !important;
    margin: 2px 0 !important;  /* minimal top & bottom margin */
    object-fit: contain;
    display: block;
    -webkit-object-fit: contain; /* Safari compatibility */
}

.navbar-nav .nav-link {
    padding: 2px 0.75rem !important;
}

.btn {
    padding: 2px 0.75rem !important;
    font-size: 0.875rem;
    -webkit-box-sizing: border-box;
    -moz-box-sizing: border-box;
    box-sizing: border-box;
}

/* HAMBURGER MENU FIXES */
.navbar-toggler {
    padding: 0.25rem 0.5rem !important;
    font-size: 1.25rem;
    line-height: 1;
    background-color: transparent;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.375rem;
    -webkit-border-radius: 0.375rem;
    -moz-border-radius: 0.375rem;
    /* iOS Chrome specific touch fixes */
    touch-action: manipulation;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    cursor: pointer;
}

.navbar-toggler:focus {
    text-decoration: none;
    outline: 0;
    box-shadow: 0 0 0 0.25rem rgba(255, 255, 255, 0.25);
    -webkit-box-shadow: 0 0 0 0.25rem rgba(255, 255, 255, 0.25);
    -moz-box-shadow: 0 0 0 0.25rem rgba(255, 255, 255, 0.25);
}

/* Ensure the collapse transition works smoothly */
.navbar-collapse {
    transition: all 0.35s ease;
    -webkit-transition: all 0.35s ease;
    -moz-transition: all 0.35s ease;
}

/* iOS Chrome Specific Fixes */
@supports (-webkit-touch-callout: none) {
    /* Target iOS devices */
    
    /* Fix for iOS Chrome specifically */
    .navbar-toggler {
        /* Ensure proper touch handling for iOS Chrome */
        -webkit-touch-callout: none;
        -webkit-user-select: none;
        touch-action: manipulation;
        cursor: pointer;
        
        /* Force larger touch target for iOS Chrome */
        min-height: 48px !important;
        min-width: 48px !important;
        
        /* Fix iOS Chrome button rendering */
        -webkit-appearance: none;
        appearance: none;
        border-radius: 0.375rem;
        
        /* Prevent iOS Chrome zoom issues */
        font-size: 16px !important;
    }
    
    /* iOS Chrome dropdown fixes */
    .dropdown-toggle {
        -webkit-touch-callout: none;
        touch-action: manipulation;
        font-size: 16px !important;
        cursor: pointer;
        min-height: 44px;
        min-width: 44px;
    }
    
    /* Fix iOS Chrome viewport issues */
    .navbar-collapse {
        /* Force hardware acceleration */
        -webkit-transform: translate3d(0, 0, 0);
        transform: translate3d(0, 0, 0);
        -webkit-backface-visibility: hidden;
        backface-visibility: hidden;
        
        /* Ensure proper z-index */
        position: relative;
        z-index: 1050;
    }
    
    /* iOS Chrome nav links */
    .navbar-nav .nav-link {
        touch-action: manipulation;
        -webkit-tap-highlight-color: transparent;
        font-size: 16px !important;
    }
    
    /* Fix iOS Chrome button focus states */
    .navbar-toggler:focus,
    .navbar-toggler:active {
        outline: none;
        box-shadow: 0 0 0 0.25rem rgba(255, 255, 255, 0.25);
    }
}

/* Specific fix for iOS Chrome user agent */
@media screen and (-webkit-min-device-pixel-ratio: 2) and (max-device-width: 812px) {
    /* This targets high-DPI iOS devices */
    
    .navbar-toggler {
        /* Extra padding for iOS Chrome touch accuracy */
        padding: 0.5rem !important;
        
        /* Ensure visibility */
        opacity: 1 !important;
        visibility: visible !important;
        
        /* Fix potential rendering issues */
        transform: translateZ(0);
        -webkit-transform: translateZ(0);
    }
    
    /* Fix iOS Chrome collapse animation */
    .navbar-collapse.collapsing {
        transition: height 0.35s ease;
        -webkit-transition: height 0.35s ease;
    }
    
    .navbar-collapse.show {
        height: auto !important;
    }
    
    /* Fix dropdown menus on iOS Chrome */
    .dropdown-menu {
        touch-action: manipulation;
    }
}

/* Hero Section - Enhanced for cross-browser compatibility */
.hero-section {
    padding: 2rem 0;
    background-color: #444444;
    color: #fff;
    margin-bottom: 2rem;
    font-family: sans-serif;
    font-weight: bold;
    background-image: url('assets/img/backdrop.jpg');
    background-size: auto 100%;
    background-repeat: no-repeat;
    background-position: center;
    -webkit-background-size: auto 100%; /* Safari compatibility */
    -moz-background-size: auto 100%;
    -webkit-box-sizing: border-box;
    -moz-box-sizing: border-box;
    box-sizing: border-box;
}

.hero-section .row {
    gap: 0;
    margin-left: 0;
    margin-right: 0;
    display: -webkit-flex; /* Safari compatibility */
    display: -moz-flex;
    display: flex;
    -webkit-flex-wrap: wrap;
    -moz-flex-wrap: wrap;
    flex-wrap: wrap;
}

.hero-section .column {
    gap: 0;
}

.hero-section h1 {
    color: #fff !important;
}

.hero-section .lead {
    color: #fff !important;
}

.hero-section [class*="col-"] {
    padding-left: 2px;
    padding-right: 2px;
    -webkit-box-sizing: border-box;
    -moz-box-sizing: border-box;
    box-sizing: border-box;
}

/* Content Section */
.content-section {
    padding: 3rem 0;
    background: #444 !important;
}

/* Interest Cards - Enhanced for cross-browser compatibility */
.interest-card {
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
    background-color: #666;
    color: #fff;
    -webkit-border-radius: 8px; /* Safari compatibility */
    -moz-border-radius: 8px;
    -webkit-box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    -moz-box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    -webkit-box-sizing: border-box;
    -moz-box-sizing: border-box;
    box-sizing: border-box;
}

.interest-card img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    -webkit-object-fit: cover; /* Safari compatibility */
    display: block;
}

.interest-card-body {
    padding: 1.5rem;
    -webkit-box-sizing: border-box;
    -moz-box-sizing: border-box;
    box-sizing: border-box;
}

/* Profile Image */
.profile-image {
    width: 100%;
    max-width: 200px;
    height: auto;
    border-radius: 10px;
    -webkit-border-radius: 10px; /* Safari compatibility */
    -moz-border-radius: 10px;
    display: block;
}

/* Footer */
.footer {
    background-color: #212529;
    color: #fff;
    padding: 2rem 0;
    margin-top: 3rem;
    -webkit-box-sizing: border-box;
    -moz-box-sizing: border-box;
    box-sizing: border-box;
}

/* Navigation Links */
.nav-link {
    font-weight: 500;
}

/* Social Icons */
.social-icons a {
    color: #fff;
    font-size: 1.5rem;
    margin-right: 1rem;
}

.social-icons a:hover {
    color: #0d6efd;
}

/* Store Badge Styles - Enhanced for cross-browser compatibility */
.app-group {
    margin-bottom: 1.5rem;
    -webkit-box-sizing: border-box;
    -moz-box-sizing: border-box;
    box-sizing: border-box;
}

.store-badge {
    height: 60px;
    width: auto;
    margin-right: 1rem;
    margin-top: 0.5rem;
    display: inline-block;
    vertical-align: middle;
    -webkit-box-sizing: border-box;
    -moz-box-sizing: border-box;
    box-sizing: border-box;
}

/* Fix SVG badge alignment to match IMG badges */
.store-badge svg,
.store-badge.web-badge {
    vertical-align: middle !important;
    display: inline-block !important;
}

/* Make Google Play badge larger to match App Store visual size */
.store-badge[alt*="Google Play"] {
    height: 90px;
}

/* Safari-specific adjustment for Google Play badge */
@media not all and (min-resolution:.001dpcm) {
    @supports (-webkit-appearance:none) {
        .store-badge[alt*="Google Play"] {
            height: 95px; /* Slightly larger for Safari */
        }
    }
}

.store-badge:hover {
    opacity: 0.8;
    -webkit-transition: opacity 0.2s ease;
    -moz-transition: opacity 0.2s ease;
    transition: opacity 0.2s ease;
}

/* Override the button styling for store badge links */
.app-links a.store-link {
    background: none !important;
    padding: 0 !important;
    border-radius: 0 !important;
    margin-right: 1rem;
    display: inline-block;
    vertical-align: middle;
    -webkit-box-sizing: border-box;
    -moz-box-sizing: border-box;
    box-sizing: border-box;
}

/* Ensure Bootstrap collapse functionality works */
.collapse:not(.show) {
    display: none;
}

.collapsing {
    height: 0;
    overflow: hidden;
    transition: height 0.35s ease;
    -webkit-transition: height 0.35s ease;
    -moz-transition: height 0.35s ease;
}

/* Additional navbar improvements */
.navbar-dark .navbar-toggler {
    color: rgba(255, 255, 255, 0.55);
    border-color: rgba(255, 255, 255, 0.1);
}

.navbar-dark .navbar-toggler:hover,
.navbar-dark .navbar-toggler:focus {
    color: rgba(255, 255, 255, 0.75);
}

.navbar-dark .navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255, 255, 255, 0.55%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

/* MOBILE RESPONSIVE FIXES */

/* Mobile-specific container fixes */
@media (max-width: 767.98px) {
    /* Container fixes */
    .container {
        width: 100% !important;
        max-width: 100% !important;
        padding-left: 10px !important;
        padding-right: 10px !important;
    }
    
    /* Row fixes to prevent overflow */
    .row {
        margin-left: 0 !important;
        margin-right: 0 !important;
    }
    
    /* Column fixes */
    [class*="col-"] {
        padding-left: 5px !important;
        padding-right: 5px !important;
    }
    
    /* Hero section mobile fixes */
    .hero-section {
        padding: 1rem 0;
        background-size: cover;
        background-position: center;
        min-height: auto;
    }
    
    /* Main content area mobile fixes */
    main {
        padding: 1rem 10px;
        margin: 0;
        width: 100%;
        max-width: 100%;
    }
    
    /* Interest cards mobile fixes */
    .interest-card {
        margin-bottom: 1rem;
        width: 100%;
    }
    
    /* App links mobile fixes */
    .app-group {
        text-align: center;
        margin-bottom: 2rem;
    }
    
    .store-badge {
        height: 48px !important;
        margin: 0.25rem !important;
        display: inline-block;
        max-width: 150px;
    }
    
    .store-badge[alt*="Google Play"] {
        height: 60px !important;
    }
    
    /* Typography mobile fixes */
    h1 {
        font-size: 1.75rem !important;
        line-height: 1.2;
    }
    
    h2 {
        font-size: 1.5rem !important;
        line-height: 1.3;
    }
    
    .lead {
        font-size: 1.1rem !important;
        line-height: 1.4;
    }
    
    /* Navigation mobile fixes */
    .navbar-brand img {
        width: 60px !important;
        height: 60px !important;
    }
    
    .navbar-nav {
        text-align: center;
        width: 100%;
        padding-top: 0.5rem;
    }
    
    .navbar-nav .nav-link {
        padding: 0.75rem 1rem !important;
        border-bottom: 1px solid rgba(255,255,255,0.1);
        /* iOS Chrome mobile nav fixes */
        touch-action: manipulation;
        -webkit-tap-highlight-color: transparent;
    }
    
    /* Button mobile fixes */
    .btn {
        padding: 0.5rem 1rem !important;
        font-size: 1rem !important;
        width: 100%;
        margin-bottom: 0.5rem;
    }
    
    .btn.ms-md-2 {
        margin-left: 0 !important;
        margin-top: 0.5rem !important;
    }
    
    /* Ensure dropdown menus work properly on mobile */
    .dropdown-menu {
        position: static !important;
        float: none;
        width: auto;
        margin-top: 0;
        background-color: #343a40;
        border: 0;
        box-shadow: none;
        -webkit-box-shadow: none;
        -moz-box-shadow: none;
        /* iOS Chrome dropdown fixes */
        touch-action: manipulation;
    }
    
    .dropdown-item {
        color: #fff;
        padding: 0.5rem 1rem;
        /* iOS Chrome dropdown item fixes */
        touch-action: manipulation;
        -webkit-tap-highlight-color: transparent;
    }
    
    .dropdown-item:hover,
    .dropdown-item:focus {
        background-color: #495057;
        color: #fff;
    }
    
    .dropdown-divider {
        border-color: #495057;
    }
    
    /* iOS Chrome specific mobile fixes */
    .navbar-toggler {
        /* Force hardware acceleration for iOS Chrome mobile */
        -webkit-transform: translateZ(0);
        transform: translateZ(0);
    }
}

/* Responsive Media Queries - Enhanced for cross-browser compatibility */
@media (max-width: 768px) {
    .profile-image {
        max-width: 80px;
    }
    
    .hero-section {
        padding: 2rem 0;
    }
    
    .store-badge {
        height: 48px;
        margin-right: 0.5rem;
        margin-bottom: 0.5rem;
    }
    
    .store-badge[alt*="Google Play"] {
        height: 60px;
    }
    
    /* Safari mobile adjustment */
    @media not all and (min-resolution:.001dpcm) {
        @supports (-webkit-appearance:none) {
            .store-badge[alt*="Google Play"] {
                height: 65px;
            }
        }
    }
    
    .app-group {
        margin-bottom: 2rem;
    }
}

/* Extra small devices (phones, less than 576px) */
@media (max-width: 575.98px) {
    .hero-section h1 {
        font-size: 1.5rem !important;
    }
    
    .hero-section .lead {
        font-size: 1rem !important;
    }
    
    .profile-image {
        max-width: 60px !important;
    }
    
    .store-badge {
        height: 40px !important;
        margin: 0.2rem !important;
    }
    
    .store-badge[alt*="Google Play"] {
        height: 50px !important;
    }
}

/* Landscape orientation fixes for mobile */
@media (max-width: 768px) and (orientation: landscape) {
    .hero-section {
        padding: 0.5rem 0;
    }
    
    .navbar-brand img {
        width: 50px !important;
        height: 50px !important;
    }
}

/* Additional Safari-specific fixes */
@media not all and (min-resolution:.001dpcm) {
    @supports (-webkit-appearance:none) {
        /* Safari-specific flexbox fixes */
        .hero-section .row {
            display: -webkit-flex;
            -webkit-align-items: center;
        }
        
        .navbar-brand {
            display: -webkit-flex;
            -webkit-align-items: center;
        }
        
        /* Safari font rendering improvement */
        body {
            -webkit-font-smoothing: antialiased;
        }
        
        /* Safari navbar toggler fix */
        .navbar-toggler {
            -webkit-appearance: none;
        }
    }
}

/* Fix for mobile Chrome tap highlight */
.navbar-toggler,
.nav-link,
.dropdown-toggle {
    -webkit-tap-highlight-color: transparent;
}

/* Force responsive images */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Fix for Bootstrap columns on mobile */
@media (max-width: 768px) {
    .col-lg-3, .col-lg-9, .col-md-4, .col-md-8 {
        width: 100% !important;
        flex: 0 0 100% !important;
        max-width: 100% !important;
    }
}