/**
 * IdeaDunes - Comprehensive Responsive & UI/UX Fixes
 * Fixes for all screen sizes, overlapping elements, navigation, forms, footer
 * Version: 3.0.0
 * Date: June 29, 2026
 */

/* ====================================================================
   GLOBAL FIXES - ALL SCREEN SIZES
   ==================================================================== */

/* Prevent horizontal overflow */
html, body {
    overflow-x: hidden;
    max-width: 100vw;
}

/* Fix overlapping elements */
.navbar-fixed-top {
    z-index: 1030 !important;
}

.cookie-banner, .id-cookie-banner {
    z-index: 1040 !important;
}

.modal {
    z-index: 1050 !important;
}

/* Fix form inputs on iOS */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="tel"],
input[type="number"],
input[type="search"],
textarea,
select {
    font-size: 16px !important; /* Prevents iOS zoom */
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    border-radius: 6px;
}

/* Fix button touch targets */
.btn, button, a.btn {
    min-height: 44px;
    min-width: 44px;
    touch-action: manipulation;
}

/* Fix focus states for accessibility */
a:focus, button:focus, input:focus, select:focus, textarea:focus {
    outline: 2px solid #6c587b;
    outline-offset: 2px;
}

/* Fix images overflow */
img {
    max-width: 100%;
    height: auto;
}

/* Fix tables overflow */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* ====================================================================
   HEADER FIXES - ALL SCREEN SIZES
   ==================================================================== */

/* Utility bar - fixed at top */
.public-utility-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1050;
    height: 42px;
    background: #1a2332;
    color: #fff;
    overflow: hidden;
}

/* Navbar - fixed below utility bar */
.public-navbar.navbar-default {
    position: fixed;
    top: 42px;
    left: 0;
    right: 0;
    z-index: 1040;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

/* Page content - account for fixed headers */
.page-content-wrapper,
.info-page-content,
.home-hero {
    padding-top: 120px !important;
}

/* ====================================================================
   NAVIGATION FIXES
   ==================================================================== */

/* Hamburger menu button */
.navbar-toggle {
    display: none;
    float: right;
    padding: 9px 10px;
    margin-top: 8px;
    margin-right: 15px;
    margin-bottom: 8px;
    background-color: transparent;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
}

.navbar-toggle .icon-bar {
    display: block;
    width: 22px;
    height: 2px;
    border-radius: 1px;
    background-color: #333;
}

.navbar-toggle .icon-bar + .icon-bar {
    margin-top: 4px;
}

/* Show hamburger on mobile */
@media (max-width: 767px) {
    .navbar-toggle {
        display: block;
    }
    
    .navbar-collapse {
        display: none;
        width: 100%;
    }
    
    .navbar-collapse.in {
        display: block;
    }
    
    .navbar-nav {
        float: none;
        margin: 0;
    }
    
    .navbar-nav > li {
        float: none;
    }
    
    .navbar-nav > li > a {
        padding: 12px 15px;
        border-top: 1px solid #eee;
    }
    
    /* Search bar in mobile nav */
    .public-nav-search {
        width: 100%;
        padding: 10px 15px;
    }
    
    .public-nav-search .form-control {
        width: 100%;
    }
    
    /* Auth buttons in mobile nav */
    .public-nav-action {
        width: 100%;
        padding: 5px 15px;
    }
    
    .public-nav-action a {
        display: block;
        width: 100%;
        text-align: center;
    }
}

/* ====================================================================
   UTILITY BAR FIXES - ALL SCREEN SIZES
   ==================================================================== */

/* Utility bar inner layout */
.public-utility-bar__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 42px;
    padding: 0 15px;
}

/* Utility bar message */
.public-utility-bar__message {
    font-size: 12px;
    opacity: 0.9;
}

/* Utility bar actions */
.public-utility-bar__actions {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 12px;
}

.public-utility-bar__actions a {
    color: #fff;
    text-decoration: none;
    opacity: 0.9;
    transition: opacity 0.2s;
}

.public-utility-bar__actions a:hover {
    opacity: 1;
}

/* Utility bar preference selectors */
.public-pref-select {
    font-size: 12px;
    padding: 2px 6px;
    background: rgba(255,255,255,0.1);
    color: #fff;
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 4px;
}

/* ====================================================================
   TABLET FIXES (768px - 991px)
   ==================================================================== */

@media (min-width: 768px) and (max-width: 991px) {
    .public-utility-bar {
        height: 42px;
    }
    
    .public-navbar.navbar-default {
        top: 42px;
    }
    
    .page-content-wrapper,
    .info-page-content,
    .home-hero {
        padding-top: 120px !important;
    }
    
    .public-utility-bar__message {
        display: none;
    }
    
    .public-utility-bar__actions {
        gap: 8px;
    }
}

/* ====================================================================
   MOBILE FIXES (max-width: 767px)
   ==================================================================== */

@media (max-width: 767px) {
    /* Utility bar - hide message, show only actions */
    .public-utility-bar {
        height: auto;
        min-height: 36px;
    }
    
    .public-utility-bar__inner {
        flex-direction: column;
        height: auto;
        padding: 4px 10px;
        gap: 2px;
    }
    
    .public-utility-bar__message {
        display: none;
    }
    
    .public-utility-bar__actions {
        font-size: 11px;
        gap: 8px;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .public-utility-bar__actions a {
        padding: 2px 6px;
        font-size: 11px;
    }
    
    .public-pref-select {
        font-size: 11px;
        padding: 2px 4px;
        min-width: 60px;
    }
    
    /* Navbar - adjust top position */
    .public-navbar.navbar-default {
        top: 36px !important;
        min-height: 56px;
    }
    
    /* Page content - adjust padding */
    .page-content-wrapper,
    .info-page-content,
    .home-hero {
        padding-top: 100px !important;
    }
    
    /* Logo/brand */
    .brand-logo {
        height: 28px !important;
        margin-right: 6px !important;
    }
    
    .brand-wordmark {
        font-size: 16px !important;
    }
    
    /* Navbar links */
    .navbar-nav > li > a {
        padding: 10px 15px;
        font-size: 14px;
    }
    
    /* Dropdown menus */
    .dropdown-menu {
        position: static;
        float: none;
        width: 100%;
        max-height: none;
        overflow: visible;
    }
    
    .dropdown-menu > li > a {
        padding: 10px 15px 10px 30px;
    }
    
    /* Search bar */
    .public-nav-search {
        padding: 8px 15px;
    }
    
    .public-nav-search .form-control {
        height: 40px;
    }
    
    /* Auth buttons */
    .public-nav-action {
        padding: 8px 15px;
    }
    
    .public-nav-action a {
        padding: 10px 20px;
        font-size: 14px;
    }
}

/* ====================================================================
   SMALL MOBILE FIXES (max-width: 480px)
   ==================================================================== */

@media (max-width: 480px) {
    /* Utility bar - minimal */
    .public-utility-bar {
        min-height: 32px;
    }
    
    .public-utility-bar__inner {
        padding: 2px 8px;
    }
    
    .public-utility-bar__actions {
        font-size: 10px;
        gap: 6px;
    }
    
    .public-utility-bar__actions a {
        padding: 2px 4px;
        font-size: 10px;
    }
    
    .public-pref-select {
        font-size: 10px;
        padding: 1px 3px;
        min-width: 50px;
    }
    
    /* Navbar - adjust top position */
    .public-navbar.navbar-default {
        top: 32px !important;
        min-height: 50px;
    }
    
    /* Page content - adjust padding */
    .page-content-wrapper,
    .info-page-content,
    .home-hero {
        padding-top: 90px !important;
    }
    
    /* Logo/brand */
    .brand-logo {
        height: 24px !important;
        margin-right: 4px !important;
    }
    
    .brand-wordmark {
        font-size: 14px !important;
    }
    
    /* Navbar links */
    .navbar-nav > li > a {
        padding: 8px 12px;
        font-size: 13px;
    }
    
    /* Auth buttons */
    .public-nav-action a {
        padding: 8px 16px;
        font-size: 13px;
    }
}

/* ====================================================================
   HERO SECTION FIXES
   ==================================================================== */

@media (max-width: 991px) {
    .home-hero {
        padding-top: 100px;
    }
    
    .home-hero__content {
        padding-right: 0;
    }
    
    .home-stat-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 767px) {
    .home-hero {
        padding: 80px 0 40px;
    }
    
    .home-hero h1 {
        font-size: 28px;
    }
    
    .home-hero__copy {
        font-size: 15px;
    }
    
    .home-stat-grid {
        grid-template-columns: 1fr;
    }
    
    .home-hero__actions {
        display: flex;
        flex-direction: column;
        gap: 10px;
    }
    
    .home-hero__actions .btn {
        width: 100%;
    }
}

/* ====================================================================
   SIGNUP FORM FIXES
   ==================================================================== */

@media (max-width: 767px) {
    .home-signup-card {
        margin-top: 24px;
        padding: 20px;
    }
    
    .home-signup-card__header h2 {
        font-size: 24px;
    }
    
    .home-signup-form .form-group {
        margin-bottom: 12px;
    }
    
    .home-signup-form .form-control {
        width: 100%;
        min-height: 44px;
    }
    
    .home-signup-form__actions .btn {
        width: 100%;
        min-height: 48px;
    }
    
    .home-social-row {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 10px;
    }
    
    .home-social-row .social-buttons {
        display: flex;
        gap: 10px;
    }
}

/* ====================================================================
   FOOTER FIXES
   ==================================================================== */

@media (max-width: 767px) {
    footer {
        padding: 20px 0;
    }
    
    footer .container {
        padding: 0 15px;
    }
    
    footer .row {
        margin: 0;
    }
    
    footer .col-md-3,
    footer .col-md-4,
    footer .col-md-6 {
        padding: 0 0 15px 0;
        width: 100%;
    }
    
    footer h5 {
        margin-bottom: 10px;
        font-size: 16px;
    }
    
    footer ul {
        padding-left: 0;
        list-style: none;
    }
    
    footer ul li {
        margin-bottom: 5px;
    }
    
    footer ul li a {
        display: block;
        padding: 5px 0;
    }
}

/* Footer grid responsive */
.footer-resource-grid,
.footer-industry-grid,
.footer-usecase-strip__grid,
.footer-compare-grid {
    display: grid;
    gap: 16px;
}

@media (max-width: 576px) {
    .footer-resource-grid,
    .footer-industry-grid,
    .footer-usecase-strip__grid,
    .footer-compare-grid {
        grid-template-columns: 1fr !important;
    }
}

@media (min-width: 577px) and (max-width: 991px) {
    .footer-resource-grid,
    .footer-industry-grid,
    .footer-usecase-strip__grid,
    .footer-compare-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

@media (min-width: 992px) {
    .footer-resource-grid,
    .footer-industry-grid,
    .footer-usecase-strip__grid,
    .footer-compare-grid {
        grid-template-columns: repeat(4, 1fr) !important;
    }
}

/* ====================================================================
   PRICING PAGE FIXES
   ==================================================================== */

@media (max-width: 767px) {
    .pricing-toggle {
        flex-direction: column;
        align-items: center;
    }
    
    .pricing-toggle .toggle-label {
        margin-bottom: 10px;
    }
    
    .pricing-card {
        margin-bottom: 20px;
    }
    
    .pricing-card .price {
        font-size: 32px;
    }
    
    .pricing-features {
        font-size: 14px;
    }
    
    .pricing-cta {
        width: 100%;
    }
    
    /* Region and currency selectors */
    .pricing-selectors {
        flex-direction: column;
        gap: 10px;
    }
    
    .pricing-selectors select {
        width: 100%;
    }
}

/* ====================================================================
   DASHBOARD FIXES
   ==================================================================== */

@media (max-width: 767px) {
    /* Sidebar */
    .sidebar-left {
        position: fixed;
        left: -100%;
        top: 0;
        width: 85%;
        height: 100vh;
        z-index: 1000;
        transition: left 0.3s ease;
        background: #fff;
        overflow-y: auto;
    }
    
    .sidebar-left.active {
        left: 0;
    }
    
    /* Sidebar backdrop */
    .sidebar-backdrop {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0,0,0,0.5);
        z-index: 999;
    }
    
    .sidebar-left.active ~ .sidebar-backdrop {
        display: block;
    }
    
    /* Mobile menu toggle */
    .mobile-menu-toggle {
        display: block;
        position: fixed;
        top: 10px;
        left: 10px;
        z-index: 1001;
        background: #6c587b;
        color: white;
        border: none;
        padding: 0.5rem 0.75rem;
        border-radius: 4px;
        cursor: pointer;
        font-size: 18px;
    }
    
    /* Content area */
    .main-content {
        margin-left: 0;
        padding: 15px;
    }
    
    /* Header */
    .header-area {
        padding: 10px 15px;
    }
    
    /* Cards */
    .card {
        margin-bottom: 15px;
    }
    
    .card-body {
        padding: 15px;
    }
    
    /* Tables */
    .table-responsive {
        font-size: 13px;
    }
    
    .table-responsive table td {
        padding: 8px 10px;
    }
    
    /* Buttons in cards */
    .card .btn {
        width: 100%;
        margin-bottom: 5px;
    }
}

/* ====================================================================
   FORM FIXES
   ==================================================================== */

@media (max-width: 767px) {
    .standalone-card {
        margin: 10px;
        padding: 20px;
    }
    
    .standalone-card h1 {
        font-size: 24px;
    }
    
    .form-group {
        margin-bottom: 12px;
    }
    
    .form-control {
        width: 100%;
        min-height: 44px;
    }
    
    .form-row {
        flex-direction: column;
    }
    
    .form-row .col-sm-6 {
        width: 100%;
        padding: 0;
    }
    
    /* Login form */
    .auth-social-grid {
        flex-direction: column;
        gap: 10px;
    }
    
    .auth-social-grid .btn {
        width: 100%;
    }
    
    /* Signup wizard */
    .signup-step-panel {
        padding: 15px;
    }
    
    .signup-step-buttons {
        flex-direction: column;
        gap: 10px;
    }
    
    .signup-step-buttons .btn {
        width: 100%;
    }
}

/* ====================================================================
   CONTACT PAGE FIXES
   ==================================================================== */

@media (max-width: 767px) {
    .contact-card {
        margin-bottom: 15px;
        padding: 15px;
    }
    
    .contact-card h3 {
        font-size: 18px;
    }
    
    /* Tabs */
    .nav-tabs {
        flex-wrap: wrap;
        gap: 5px;
    }
    
    .nav-tabs > li {
        flex: 1 1 auto;
        min-width: 80px;
    }
    
    .nav-tabs > li > a {
        padding: 8px 12px;
        font-size: 13px;
    }
}

/* ====================================================================
   APPS PAGE FIXES
   ==================================================================== */

@media (max-width: 767px) {
    .app-card {
        margin-bottom: 15px;
    }
    
    .app-card .card-body {
        padding: 15px;
    }
    
    .app-card h3 {
        font-size: 18px;
    }
    
    .app-card .tech-stack {
        display: none; /* Hide tech stack on mobile */
    }
    
    .app-card .pricing {
        font-size: 14px;
    }
}

/* ====================================================================
   BLOG PAGE FIXES
   ==================================================================== */

@media (max-width: 767px) {
    .blog-card {
        margin-bottom: 20px;
    }
    
    .blog-card .card-body {
        padding: 15px;
    }
    
    .blog-card h2 {
        font-size: 20px;
    }
    
    .blog-card .meta {
        font-size: 13px;
    }
}

/* ====================================================================
   DEMO PAGE FIXES
   ==================================================================== */

@media (max-width: 767px) {
    .demo-industry-grid {
        grid-template-columns: 1fr;
    }
    
    .demo-industry-card {
        margin-bottom: 15px;
    }
    
    .demo-steps {
        flex-direction: column;
    }
    
    .demo-step {
        margin-bottom: 20px;
    }
}

/* ====================================================================
   FEATURES PAGE FIXES
   ==================================================================== */

@media (max-width: 767px) {
    .feature-grid {
        grid-template-columns: 1fr;
    }
    
    .feature-card {
        margin-bottom: 15px;
    }
    
    .feature-card h3 {
        font-size: 18px;
    }
}

/* ====================================================================
   SOLUTIONS PAGE FIXES
   ==================================================================== */

@media (max-width: 767px) {
    .solution-grid {
        grid-template-columns: 1fr;
    }
    
    .solution-card {
        margin-bottom: 15px;
    }
    
    .solution-card h3 {
        font-size: 18px;
    }
}

/* ====================================================================
   PLATFORM PAGE FIXES
   ==================================================================== */

@media (max-width: 767px) {
    .platform-grid {
        grid-template-columns: 1fr;
    }
    
    .platform-card {
        margin-bottom: 15px;
    }
    
    .platform-card h3 {
        font-size: 18px;
    }
}

/* ====================================================================
   CAREERS PAGE FIXES
   ==================================================================== */

@media (max-width: 767px) {
    .careers-grid {
        grid-template-columns: 1fr;
    }
    
    .careers-card {
        margin-bottom: 15px;
    }
    
    .careers-card h3 {
        font-size: 18px;
    }
}

/* ====================================================================
   COOKIE BANNER FIXES
   ==================================================================== */

@media (max-width: 767px) {
    .id-cookie-banner {
        bottom: 0;
        right: 0;
        left: 0;
        width: 100%;
        border-radius: 0;
        padding: 12px;
    }
    
    .id-cookie-banner-inner {
        flex-direction: column;
        gap: 10px;
    }
    
    .id-cookie-banner-actions {
        flex-direction: column;
        gap: 8px;
    }
    
    .id-cookie-banner-actions button {
        width: 100%;
    }
}

/* ====================================================================
   SOCIAL PROOF FIXES
   ==================================================================== */

@media (max-width: 767px) {
    .home-social-proof {
        padding: 16px 0;
    }
    
    .home-social-proof .container > div {
        flex-direction: column;
        gap: 12px;
    }
    
    .home-social-proof .container > div > div {
        min-width: 100%;
    }
}

/* ====================================================================
   ANIMATIONS - REDUCED MOTION
   ==================================================================== */

@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ====================================================================
   HIGH CONTRAST MODE
   ==================================================================== */

@media (prefers-contrast: more) {
    .btn {
        border: 2px solid currentColor;
    }
    
    .form-control {
        border: 2px solid #333;
    }
    
    .card {
        border: 2px solid #333;
    }
}

/* ====================================================================
   PRINT STYLES
   ==================================================================== */

@media print {
    .navbar,
    .sidebar,
    .mobile-menu-toggle,
    .mobile-bottom-nav,
    .id-cookie-banner,
    .footer-compare-grid {
        display: none !important;
    }
    
    body {
        background: #fff !important;
        color: #000 !important;
        padding: 0 !important;
    }
    
    .container {
        max-width: 100% !important;
        width: 100% !important;
    }
    
    a {
        text-decoration: underline;
    }
    
    a::after {
        content: " (" attr(href) ")";
    }
}
