/*
 * Responsive Enhancements for Vize Tema
 * Mobile-first approach for better mobile app-like experience
 */

/* ==========================================================================
   Base Mobile-First Responsive Fixes
   ========================================================================== */

/* Enhanced Mobile Navigation */
@media (max-width: 991px) {
    /* Header optimizations */
    .header__top-wrap {
        display: none; /* Hide top bar on mobile for cleaner look */
    }
    
    .header__wrap {
        padding: 10px 0;
        position: sticky;
        top: 0;
        z-index: 999;
        background: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(10px);
        box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
    }
    
    .xb-logo img {
        max-height: 35px;
        width: auto;
    }
    
    /* Mobile menu button styling */
    .xb-nav-mobile-button {
        font-size: 28px;
        padding: 8px;
        border-radius: 8px;
        background: rgba(0, 0, 0, 0.05);
        transition: all 0.3s ease;
    }
    
    .xb-nav-mobile-button:hover {
        background: var(--color-primary);
        color: white;
        transform: scale(1.05);
    }
}

/* ==========================================================================
   Mobile Menu Enhancements
   ========================================================================== */
@media (max-width: 991px) {
    .xb-header-menu {
        width: 320px;
        max-width: 85vw;
        box-shadow: 0 0 50px rgba(0, 0, 0, 0.3);
        border-radius: 0 20px 20px 0;
    }
    
    .xb-header-menu-scroll {
        padding: 30px 20px;
        height: 100vh;
        overflow-y: auto;
    }
    
    .xb-logo-mobile {
        text-align: center;
        margin-bottom: 30px;
        padding-bottom: 20px;
        border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    }
    
    .xb-menu-primary li a {
        padding: 15px 20px;
        font-size: 16px;
        border-radius: 10px;
        margin-bottom: 5px;
        border: none;
        background: rgba(0, 0, 0, 0.02);
        transition: all 0.3s ease;
        display: flex;
        align-items: center;
        min-height: 50px; /* Touch-friendly */
    }
    
    .xb-menu-primary li a:hover,
    .xb-menu-primary li.current-menu-item > a {
        background: var(--color-primary);
        color: white;
        transform: translateX(5px);
    }
    
    .xb-menu-primary .sub-menu li a {
        padding-left: 40px;
        background: rgba(0, 0, 0, 0.01);
        font-size: 15px;
    }
}

/* ==========================================================================
   Hero Section Mobile Optimizations
   ========================================================================== */
@media (max-width: 767px) {
    .hero__style-one {
        min-height: 500px;
        padding: 60px 0 40px;
        text-align: center;
    }
    
    .hero__content h1 {
        font-size: 28px !important;
        line-height: 1.3;
        margin-bottom: 15px;
    }
    
    .hero__content p {
        font-size: 16px;
        line-height: 1.6;
        margin-bottom: 25px;
    }
    
    .hero__style-two {
        min-height: 400px;
        padding: 40px 0;
    }
    
    .hero__style-three {
        min-height: 450px;
        padding: 50px 0 30px;
    }
    
    .xb-hero--title h1 {
        font-size: 24px !important;
        letter-spacing: -1px;
    }
    
    .xb-hero--subtitle {
        font-size: 12px !important;
        letter-spacing: 2px;
        margin-bottom: 20px !important;
    }
}

/* ==========================================================================
   Services Section Mobile Enhancements  
   ========================================================================== */
@media (max-width: 767px) {
    .xb-service .xb-item--inner {
        padding: 30px 20px;
        margin-bottom: 20px;
        border-radius: 15px;
        box-shadow: 0 5px 25px rgba(0, 0, 0, 0.08);
    }
    
    .xb-service .xb-item--icon {
        width: 50px;
        height: 50px;
        margin-bottom: 15px;
    }
    
    .xb-service .xb-item--title {
        font-size: 18px;
        margin-bottom: 10px;
    }
    
    .xb-service2 {
        width: 100% !important;
        margin-bottom: 15px;
    }
    
    .xb-service2 .xb-item--inner {
        border: 1px solid #eee !important;
        border-radius: 15px;
        padding: 25px 20px;
    }
}

/* ==========================================================================
   Counter Section Mobile App Style
   ========================================================================== */
@media (max-width: 767px) {
    .xb-counter .xb-item--item {
        width: 100% !important;
        padding: 25px 20px;
        margin-bottom: 15px;
        border-radius: 15px !important;
        border: 1px solid #eee;
        box-shadow: 0 5px 20px rgba(0, 0, 0, 0.06);
    }
    
    .xb-counter .xb-item--icon {
        width: 60px;
        height: 60px;
        margin-right: 20px;
        margin-top: 0;
    }
    
    .xb-counter .xb-item--holder {
        width: calc(100% - 80px);
        margin-top: 0;
    }
    
    .xb-counter .xb-item--number {
        font-size: 32px !important;
        margin-top: 0;
    }
    
    .xb-counter .xb-item--title {
        font-size: 16px;
        margin-top: 5px;
    }
    
    .xb-counter__wrap {
        padding: 20px;
        border-radius: 15px;
    }
}

/* ==========================================================================
   Blog Section Mobile Optimization
   ========================================================================== */
@media (max-width: 767px) {
    .blog .container {
        padding-left: 15px;
        padding-right: 15px;
    }
    
    .blog .row {
        margin: 0 -10px;
    }
    
    .blog .col-lg-8,
    .blog .col-lg-4 {
        padding: 0 10px;
    }
    
    /* Blog post cards */
    .xb-blog {
        margin-bottom: 30px;
        border-radius: 15px;
        overflow: hidden;
        box-shadow: 0 5px 25px rgba(0, 0, 0, 0.08);
        background: white;
    }
    
    .xb-blog .xb-item--img {
        margin-bottom: 0;
    }
    
    .xb-blog .xb-item--img img {
        border-radius: 15px 15px 0 0;
        width: 100%;
        height: 200px;
        object-fit: cover;
    }
    
    .xb-blog .xb-item--holder {
        padding: 20px;
    }
    
    .xb-blog .xb-item--title {
        font-size: 18px;
        line-height: 1.4;
        margin-bottom: 10px;
    }
    
    .xb-blog .xb-item--title a:hover {
        color: var(--color-primary);
    }
    
    /* Post meta styling */
    .post-meta {
        flex-wrap: wrap;
        margin-bottom: 15px;
    }
    
    .post-meta li {
        margin-right: 15px;
        margin-bottom: 5px;
        font-size: 13px;
        color: #666;
    }
    
    .post-meta li i {
        margin-right: 5px;
        color: var(--color-primary);
    }
}

/* ==========================================================================
   Single Post Mobile Enhancements
   ========================================================================== */
@media (max-width: 767px) {
    .post-details {
        padding: 0;
    }
    
    .post-details .post-thumb {
        margin-bottom: 20px;
        border-radius: 15px;
        overflow: hidden;
    }
    
    .post-details .post-thumb img {
        width: 100%;
        height: auto;
        border-radius: 15px;
    }
    
    .post-details h2 {
        font-size: 24px;
        line-height: 1.3;
        margin-bottom: 15px;
    }
    
    .post-content {
        font-size: 16px;
        line-height: 1.7;
    }
    
    .post-content h3 {
        font-size: 20px;
        margin-top: 25px;
        margin-bottom: 15px;
    }
    
    .post-content h4 {
        font-size: 18px;
        margin-top: 20px;
        margin-bottom: 12px;
    }
    
    .post-content p {
        margin-bottom: 18px;
    }
    
    .post-content img {
        border-radius: 10px;
        margin: 15px 0;
    }
}

/* ==========================================================================
   Breadcrumb Mobile Optimization
   ========================================================================== */
@media (max-width: 767px) {
    .breadcrumb {
        padding: 60px 0 40px;
        min-height: auto;
    }
    
    .breadcrumb__content {
        text-align: center;
    }
    
    .breadcrumb__title {
        font-size: 24px !important;
        line-height: 1.3;
        margin-bottom: 15px;
    }
    
    .breadcrumb__list {
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .breadcrumb__list li {
        margin: 0 5px;
        font-size: 14px;
    }
    
    .breadcrumb__shape,
    .breadcrumb__circle {
        display: none;
    }
}

/* ==========================================================================
   Sidebar Mobile Optimization
   ========================================================================== */
@media (max-width: 767px) {
    .xb-sidebar {
        margin-top: 40px;
    }
    
    .xb-sidebar .widget {
        background: white;
        padding: 25px 20px;
        border-radius: 15px;
        margin-bottom: 20px;
        box-shadow: 0 5px 20px rgba(0, 0, 0, 0.06);
    }
    
    .xb-sidebar .widget-title {
        font-size: 18px;
        margin-bottom: 15px;
        padding-bottom: 10px;
        border-bottom: 2px solid var(--color-primary);
        position: relative;
    }
    
    .xb-sidebar .widget ul li {
        padding: 10px 0;
        border-bottom: 1px solid #eee;
    }
    
    .xb-sidebar .widget ul li:last-child {
        border-bottom: none;
    }
    
    .xb-sidebar .widget ul li a {
        font-size: 15px;
        color: #333;
        transition: all 0.3s ease;
    }
    
    .xb-sidebar .widget ul li a:hover {
        color: var(--color-primary);
        padding-left: 5px;
    }
}

/* ==========================================================================
   Form Elements Mobile Optimization
   ========================================================================== */
@media (max-width: 767px) {
    input[type="text"],
    input[type="email"],
    input[type="tel"],
    input[type="password"],
    textarea,
    select {
        min-height: 50px; /* Touch-friendly */
        padding: 15px 20px;
        border-radius: 12px;
        border: 2px solid #eee;
        font-size: 16px; /* Prevent zoom on iOS */
        transition: all 0.3s ease;
        margin-bottom: 15px;
    }
    
    input:focus,
    textarea:focus,
    select:focus {
        border-color: var(--color-primary);
        box-shadow: 0 0 0 3px rgba(0, 204, 153, 0.1);
        outline: none;
    }
    
    button,
    .btn,
    .thm-btn {
        min-height: 50px;
        padding: 15px 25px;
        border-radius: 12px;
        font-size: 16px;
        font-weight: 600;
        transition: all 0.3s ease;
        border: none;
        cursor: pointer;
    }
    
    .thm-btn:hover {
        transform: translateY(-2px);
        box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    }
}

/* ==========================================================================
   General Mobile App-like Enhancements
   ========================================================================== */
@media (max-width: 767px) {
    /* Smooth scrolling */
    html {
        scroll-behavior: smooth;
    }
    
    /* Container padding adjustments */
    .container {
        padding-left: 15px;
        padding-right: 15px;
    }
    
    /* Section spacing */
    .pt-120 {
        padding-top: 60px !important;
    }
    
    .pb-120 {
        padding-bottom: 60px !important;
    }
    
    .pt-100 {
        padding-top: 50px !important;
    }
    
    .pb-100 {
        padding-bottom: 50px !important;
    }
    
    /* Card-like appearance for content blocks */
    .xb-item--inner,
    .content-card {
        background: white;
        border-radius: 15px;
        padding: 25px 20px;
        margin-bottom: 20px;
        box-shadow: 0 5px 20px rgba(0, 0, 0, 0.06);
        border: 1px solid rgba(0, 0, 0, 0.05);
        transition: all 0.3s ease;
    }
    
    .xb-item--inner:hover {
        transform: translateY(-2px);
        box-shadow: 0 8px 30px rgba(0, 0, 0, 0.1);
    }
    
    /* Enhanced text readability */
    body {
        line-height: 1.7;
        font-size: 16px;
    }
    
    p {
        line-height: 1.7;
        margin-bottom: 16px;
    }
    
    /* Touch-friendly links */
    a {
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        text-decoration: none;
        transition: all 0.3s ease;
    }
    
    /* Improved list spacing */
    ul, ol {
        padding-left: 20px;
    }
    
    li {
        margin-bottom: 8px;
    }
    
    /* Image optimization */
    img {
        height: auto;
        border-radius: 8px;
    }
    
    /* Loading states and transitions */
    .fade-in {
        animation: fadeIn 0.6s ease-in-out;
    }
    
    @keyframes fadeIn {
        from {
            opacity: 0;
            transform: translateY(20px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }
    
    /* Sticky elements optimization */
    .sticky-element {
        position: sticky;
        top: 20px;
        z-index: 10;
    }
}

/* ==========================================================================
   Back to Top Mobile Enhancement
   ========================================================================== */
@media (max-width: 767px) {
    .xb-backtotop {
        bottom: 20px;
        right: 20px;
    }
    
    .xb-backtotop a {
        width: 50px;
        height: 50px;
        border-radius: 50%;
        background: var(--color-primary);
        color: white;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 16px;
        box-shadow: 0 5px 20px rgba(0, 204, 153, 0.3);
        transition: all 0.3s ease;
    }
    
    .xb-backtotop a:hover {
        transform: scale(1.1);
        box-shadow: 0 8px 25px rgba(0, 204, 153, 0.4);
    }
}

/* ==========================================================================
   Archive Page Mobile Optimization
   ========================================================================== */
@media (max-width: 767px) {
    .blog-posts-wrapper {
        margin-top: 20px;
    }
    
    .xb-blog.mb-60 {
        margin-bottom: 25px;
    }
    
    .xb-blog .row {
        margin: 0;
    }
    
    .xb-blog .col-lg-5,
    .xb-blog .col-lg-7,
    .xb-blog .col-lg-12 {
        padding: 0;
    }
    
    .xb-blog .xb-item--holder {
        padding: 20px;
    }
    
    /* Pagination mobile styling */
    .pagination {
        margin-top: 30px;
        justify-content: center;
    }
    
    .pagination .page-link {
        min-width: 44px;
        min-height: 44px;
        margin: 0 3px;
        border-radius: 10px;
        border: 1px solid #ddd;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .pagination .page-link:hover,
    .pagination .page-item.active .page-link {
        background: var(--color-primary);
        border-color: var(--color-primary);
        color: white;
    }
}

/* ==========================================================================
   Ultra Small Devices (320px and below)
   ========================================================================== */
@media (max-width: 320px) {
    .container {
        padding-left: 10px;
        padding-right: 10px;
    }
    
    .hero__content h1 {
        font-size: 24px !important;
    }
    
    .xb-header-menu {
        width: 280px;
    }
    
    .xb-counter .xb-item--number {
        font-size: 28px !important;
    }
    
    .breadcrumb__title {
        font-size: 20px !important;
    }
    
    .post-details h2 {
        font-size: 20px;
    }
    
    .xb-service .xb-item--inner {
        padding: 20px 15px;
    }
    
    input[type="text"],
    input[type="email"],
    input[type="tel"],
    textarea {
        padding: 12px 15px;
    }
    
    button,
    .btn,
    .thm-btn {
        padding: 12px 20px;
        font-size: 15px;
    }
}

/* ==========================================================================
   Accessibility Improvements
   ========================================================================== */
@media (max-width: 767px) {
    /* Focus states for better accessibility */
    button:focus,
    .btn:focus,
    input:focus,
    textarea:focus,
    select:focus,
    a:focus {
        outline: 2px solid var(--color-primary);
        outline-offset: 2px;
    }
    
    /* Skip links */
    .skip-link {
        position: absolute;
        top: -40px;
        left: 6px;
        background: var(--color-primary);
        color: white;
        padding: 8px 16px;
        text-decoration: none;
        border-radius: 4px;
        z-index: 1000;
    }
    
    .skip-link:focus {
        top: 6px;
    }
    
    /* High contrast mode support */
    @media (prefers-contrast: high) {
        .xb-item--inner,
        .content-card {
            border: 2px solid #000;
        }
        
        button,
        .btn,
        .thm-btn {
            border: 2px solid currentColor;
        }
    }
    
    /* Reduced motion support */
    @media (prefers-reduced-motion: reduce) {
        *,
        *::before,
        *::after {
            animation-duration: 0.01ms !important;
            animation-iteration-count: 1 !important;
            transition-duration: 0.01ms !important;
        }
    }
}