/*
 * EcoHub Mobile Responsive Styles
 * Comprehensive mobile-first responsive design
 */

/* ===== MOBILE-FIRST RESPONSIVE VARIABLES ===== */
:root {
    --mobile-padding: 15px;
    --tablet-padding: 25px;
    --desktop-padding: 40px;
    --mobile-font-base: 14px;
    --tablet-font-base: 16px;
    --desktop-font-base: 18px;
}

/* ===== MOBILE STYLES ONLY ===== */
/* These styles ONLY apply to mobile devices (max-width: 767px) */

@media (max-width: 767px) {
    body {
        font-size: var(--mobile-font-base);
        line-height: 1.6;
        overflow-x: hidden;
    }

    .container-xl,
    .container {
        padding-left: var(--mobile-padding);
        padding-right: var(--mobile-padding);
    }

    /* ===== NAVIGATION MOBILE STYLES ===== */
    .navbar {
        padding: 10px var(--mobile-padding);
    }

    .navbar-brand {
        font-size: 1.5rem;
    }

    .navbar-toggler {
        border: none;
        padding: 4px 8px;
        font-size: 1.2rem;
    }

    .navbar-collapse {
        margin-top: 15px;
    }

    .navbar-nav .nav-link {
        padding: 12px 0;
        font-size: 1.1rem;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

    /* ===== HERO SECTION MOBILE ===== */
    .center_h2 h1 {
        font-size: 2.5rem !important;
        line-height: 1.2;
        margin-bottom: 20px;
    }

    .center_h2 p {
        font-size: 1.1rem;
        margin-bottom: 25px;
    }

    .center_hm {
        padding-top: 40px !important;
        padding-bottom: 40px !important;
        text-align: center;
    }

    /* ===== BUTTONS MOBILE ===== */
    .button,
    .button_1 {
        padding: 12px 25px !important;
        font-size: 0.95rem;
        display: block;
        width: 100%;
        max-width: 280px;
        margin: 10px auto;
        text-align: center;
    }

    /* ===== CARDS AND CONTENT MOBILE ===== */
    .card {
        margin-bottom: 20px;
        border-radius: 15px;
        overflow: hidden;
    }

    .card-body {
        padding: 20px var(--mobile-padding);
    }

    .card-title {
        font-size: 1.3rem;
        margin-bottom: 15px;
    }

    .card-text {
        font-size: 1rem;
        line-height: 1.6;
    }

    /* ===== IMAGES MOBILE ===== */
    img {
        max-width: 100%;
        height: auto;
        border-radius: 10px;
    }

    .img-fluid {
        width: 100%;
        height: auto;
    }

    /* ===== SECTIONS MOBILE ===== */
    section {
        padding: 30px 0;
    }

    .section-title {
        font-size: 2rem;
        text-align: center;
        margin-bottom: 30px;
    }

    /* ===== GRID ADJUSTMENTS MOBILE ===== */
    .row {
        margin-left: -10px;
        margin-right: -10px;
    }

    .col-md-4,
    .col-md-6,
    .col-md-8,
    .col-lg-4,
    .col-lg-6,
    .col-lg-8 {
        padding-left: 10px;
        padding-right: 10px;
        margin-bottom: 20px;
    }

    /* ===== FORMS MOBILE ===== */
    .form-control {
        padding: 12px 15px;
        font-size: 1rem;
        border-radius: 8px;
        margin-bottom: 15px;
    }

    .form-group {
        margin-bottom: 20px;
    }

    /* ===== FOOTER MOBILE ===== */
    footer {
        padding: 30px 0;
    }

    footer .col-md-3,
    footer .col-md-4 {
        margin-bottom: 25px;
        text-align: center;
    }

    footer ul li {
        margin-bottom: 8px;
    }

    /* ===== UTILITY CLASSES MOBILE ===== */
    .text-center-mobile {
        text-align: center;
    }

    .mb-mobile {
        margin-bottom: 20px;
    }

    .p-mobile {
        padding: var(--mobile-padding);
    }
}

/* ===== TABLET STYLES ===== */
@media (min-width: 576px) and (max-width: 767px) {

    .button,
    .button_1 {
        display: inline-block;
        width: auto;
        margin: 5px;
    }
}

/* ===== DESKTOP RESET ===== */
/* Ensure desktop styles are not affected by mobile CSS */
@media (min-width: 768px) {
    .navbar-nav .nav-link {
        border-bottom: none;
    }

    .button,
    .button_1 {
        display: inline-block;
        width: auto;
        margin: 5px;
    }
}

/* Desktop styles removed to preserve original design */

/* ===== MOBILE-SPECIFIC COMPONENTS ===== */

/* Mobile Menu Improvements */
@media (max-width: 767px) {
    .navbar-collapse {
        background: rgba(0, 0, 0, 0.95);
        padding: 20px;
        border-radius: 10px;
        margin-top: 10px;
    }

    .navbar-nav {
        text-align: center;
    }

    /* Mobile Gallery Grid */
    .gallery-item {
        margin-bottom: 15px;
    }

    /* Mobile Blog Cards */
    .blog-card {
        margin-bottom: 25px;
    }

    .blog-card img {
        width: 100%;
        height: 200px;
        object-fit: cover;
    }

    /* Mobile Contact Form */
    .contact-form {
        padding: 20px;
        background: rgba(255, 255, 255, 0.95);
        border-radius: 15px;
    }

    /* Mobile Statistics */
    .stat-item {
        text-align: center;
        margin-bottom: 30px;
    }

    .stat-number {
        font-size: 2.5rem;
        font-weight: bold;
        color: #54be73;
    }

    .stat-label {
        font-size: 1rem;
        color: #666;
    }
}

/* ===== TOUCH-FRIENDLY INTERACTIONS ===== */
@media (hover: none) and (pointer: coarse) {

    /* Touch device optimizations */
    .button,
    .button_1,
    .btn {
        min-height: 44px;
        min-width: 44px;
    }

    .nav-link {
        min-height: 44px;
        display: flex;
        align-items: center;
    }

    /* Remove hover effects on touch devices */
    .button:hover,
    .button_1:hover {
        transform: none;
    }
}

/* ===== ACCESSIBILITY IMPROVEMENTS ===== */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ===== DARK MODE MOBILE ADJUSTMENTS ===== */
@media (prefers-color-scheme: dark) {
    .mobile-card {
        background: rgba(255, 255, 255, 0.1);
        border: 1px solid rgba(255, 255, 255, 0.2);
    }

    .mobile-text {
        color: #f0f0f0;
    }
}

/* ===== ADDITIONAL MOBILE ENHANCEMENTS ===== */

/* Mobile Top Bar */
@media (max-width: 767px) {
    #top {
        padding: 10px 0 !important;
    }

    .top_1l ul li {
        display: block !important;
        margin-bottom: 5px;
        text-align: center;
    }

    .top_1l ul li.mx-2 {
        display: none !important;
    }

    .top_1r {
        margin-top: 15px;
        text-align: center !important;
    }

    .top_1r .input-group {
        max-width: 300px;
        margin: 0 auto;
    }
}

/* Mobile Header Improvements */
@media (max-width: 767px) {
    .navbar-brand {
        font-size: 1.3rem !important;
    }

    .dark-mode-toggle {
        margin-right: 10px !important;
    }

    .navbar-toggler {
        padding: 6px 10px;
        font-size: 1.1rem;
    }

    .navbar-collapse {
        background: rgba(255, 255, 255, 0.98);
        margin: 15px -15px 0 -15px;
        padding: 20px 15px;
        border-radius: 0 0 15px 15px;
        box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    }

    .navbar-nav .nav-item {
        margin-bottom: 5px;
    }

    .navbar-nav .nav-link {
        padding: 15px 20px !important;
        border-radius: 8px;
        transition: all 0.3s ease;
    }

    .navbar-nav .nav-link:hover,
    .navbar-nav .nav-link.active {
        background: #54be73;
        color: white !important;
    }
}

/* Mobile Hero Section */
@media (max-width: 767px) {
    .center_h {
        min-height: 60vh;
        background-attachment: scroll !important;
    }

    .center_hm {
        padding: 30px 0 !important;
    }

    .center_h2 h1 {
        font-size: 2.2rem !important;
        line-height: 1.3;
        margin-bottom: 20px;
    }

    .center_h2 p {
        font-size: 1rem;
        line-height: 1.6;
        margin-bottom: 25px;
    }
}

/* Mobile Blog Cards */
@media (max-width: 767px) {
    .blog-card {
        margin-bottom: 30px;
        border-radius: 15px;
        overflow: hidden;
        box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    }

    .blog-image {
        height: 200px;
        overflow: hidden;
    }

    .blog-image img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    .blog-content {
        padding: 20px;
    }

    .blog-title {
        font-size: 1.3rem;
        line-height: 1.4;
        margin-bottom: 15px;
    }

    .blog-excerpt {
        font-size: 0.95rem;
        line-height: 1.6;
        margin-bottom: 15px;
    }

    .blog-meta {
        font-size: 0.85rem;
        margin-bottom: 15px;
    }

    .blog-tags {
        margin-bottom: 15px;
    }

    .blog-tag {
        font-size: 0.8rem;
        padding: 4px 8px;
        margin-right: 5px;
        margin-bottom: 5px;
        display: inline-block;
    }
}

/* Mobile Contact Form */
@media (max-width: 767px) {
    .contact-section {
        padding: 40px 0;
    }

    .contact-form-container {
        padding: 30px 20px;
        background: rgba(255, 255, 255, 0.95);
        border-radius: 20px;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    }

    .section-title {
        font-size: 2rem !important;
        margin-bottom: 15px;
    }

    .section-description {
        font-size: 1rem;
        margin-bottom: 30px;
    }

    .form-group {
        margin-bottom: 20px;
    }

    .input-group-text {
        min-width: 45px;
        justify-content: center;
    }

    .form-control {
        padding: 15px;
        font-size: 1rem;
        border-radius: 0 8px 8px 0;
    }

    textarea.form-control {
        border-radius: 8px;
        min-height: 120px;
    }

    .btn-modern {
        padding: 15px 30px;
        font-size: 1.1rem;
        border-radius: 25px;
    }
}

/* Mobile Footer */
@media (max-width: 767px) {
    #footer {
        padding: 30px 0 !important;
    }

    .footer_1i {
        text-align: center;
        margin-bottom: 30px;
    }

    .footer_1i h4 {
        font-size: 1.5rem;
        margin-bottom: 20px;
    }

    .footer_1i p {
        font-size: 0.95rem;
        line-height: 1.6;
    }

    .footer_1i h6 {
        font-size: 0.9rem;
        margin-bottom: 10px;
    }

    .footer_1i .row {
        margin-top: 20px;
    }

    .footer_1i .row .col-md-6 {
        margin-bottom: 10px;
    }

    .footer_1i img {
        border-radius: 8px;
    }
}

/* Mobile Performance Classes */
.mobile-optimized {
    image-rendering: optimizeSpeed;
}

.touch-active {
    transform: scale(0.98);
    opacity: 0.8;
}

.touch-target-enhanced {
    min-height: 44px;
    min-width: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.mobile-menu-transition {
    transition: all 0.3s ease-in-out;
}

/* Mobile Utility Classes */
.mobile-device .reduced-motion * {
    animation-duration: 0.3s !important;
    transition-duration: 0.3s !important;
}

.mobile-device .animate-fade-up {
    animation-duration: 0.5s !important;
}

/* Mobile Dark Mode Adjustments */
.mobile-device.dark-mode .navbar-collapse {
    background: rgba(33, 37, 41, 0.98);
}

.mobile-device.dark-mode .contact-form-container {
    background: rgba(33, 37, 41, 0.95);
}

/* Mobile Landscape Orientation */
@media (max-width: 767px) and (orientation: landscape) {
    .center_h {
        min-height: 80vh;
    }

    .center_hm {
        padding: 20px 0 !important;
    }

    .center_h2 h1 {
        font-size: 2rem !important;
    }

    .navbar-collapse {
        max-height: 60vh;
        overflow-y: auto;
    }
}

/* Mobile Loading States */
.mobile-device img[loading="lazy"] {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

/* Mobile Sticky Elements */
@media (max-width: 767px) {
    .sticky-navbar {
        transition: transform 0.3s ease-in-out;
    }

    .sticky-navbar.sticky {
        position: fixed;
        top: 0;
        width: 100%;
        z-index: 1030;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    }
}

/* Mobile Print Styles */
@media print {

    .mobile-device .navbar,
    .mobile-device .dark-mode-toggle,
    .mobile-device #top {
        display: none !important;
    }

    .mobile-device .container-xl {
        padding: 0 !important;
    }

    .mobile-device .center_h2 h1 {
        font-size: 24pt !important;
        color: black !important;
    }
}

/* ===== CONTACT SECTION BACKGROUND FIX ===== */
/* Remove any background images from contact section */
.contact-section,
.contact-overlay,
#contact {
    background-image: none !important;
    background: transparent !important;
}

/* Ensure contact section has clean background */
.contact-section {
    background: linear-gradient(135deg, rgba(45, 90, 39, 0.05), rgba(107, 191, 89, 0.05)) !important;
}

.contact-overlay {
    background: transparent !important;
}