/* HOSTING MASTRIX - Responsive Styles */

/* Mobile Viewport Optimization - Apply to all mobile devices */
@media (max-width: 767px) {
    /* Ensure proper viewport scaling */
    body {
        width: 100%;
        min-width: 320px;
        overflow-x: hidden;
    }
    
    /* Fix container widths */
    .container,
    .container-fluid {
        width: 100%;
        max-width: 100%;
        padding: 0 0.75rem;
        overflow-x: hidden;
    }
    
    /* Fix row and column spacing */
    .row {
        margin: 0 -0.75rem;
        width: calc(100% + 1.5rem);
    }
    
    [class*="col-"] {
        padding: 0 0.75rem;
        width: 100%;
    }
    
    /* Fix header elements */
    .top-header,
    .header-row,
    .navbar {
        width: 100%;
        overflow: hidden;
    }
    
    /* Fix top header text */
    .top-header-left {
        gap: 10px;
        font-size: 12px;
    }
    
    .top-header-left span {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    .top-header-right {
        gap: 10px;
    }
    
    /* Fix header logo */
    .header-logo {
        font-size: 18px;
    }
    
    .header-logo-img {
        max-height: 35px;
        width: auto;
    }
    
    /* Fix header datetime */
    .header-datetime {
        font-size: 11px;
        gap: 5px;
        flex-wrap: wrap;
    }
    
    .header-datetime span {
        white-space: nowrap;
    }
    
    /* Fix hero section */
    .hero {
        width: 100%;
        overflow: hidden;
        min-height: auto;
        padding: 3rem 0;
    }
    
    .hero h1 {
        font-size: 1.75rem;
        line-height: 1.3;
    }
    
    .hero p {
        font-size: 1rem;
        line-height: 1.5;
    }
    
    .hero-buttons {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .hero-buttons .btn {
        width: 100%;
        justify-content: center;
    }
    
    /* Fix buttons */
    .btn {
        max-width: 100%;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    /* Fix text overflow */
    h1, h2, h3, h4, h5, h6, p, span, a {
        max-width: 100%;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
    
    /* Fix domain search section */
    .domain-search-section {
        padding: 2rem 0;
        overflow: hidden;
    }
    
    .domain-search-container h2 {
        font-size: 1.5rem;
    }
    
    .domain-search-form {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .domain-search-input,
    .domain-search-form .btn {
        width: 100%;
    }
    
    /* Fix TLD cards */
    .tld-cards {
        gap: 0.75rem;
        justify-content: center;
    }
    
    .tld-card {
        min-width: 80px;
        padding: 1rem;
        flex: 1 1 auto;
    }
    
    /* Fix pricing cards */
    .pricing-card {
        padding: 1.5rem;
    }
    
    /* Fix feature grids */
    .features-grid,
    .security-grid,
    .support-cards,
    .payment-methods {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    /* Ensure icons are visible on mobile */
    .card-icon i,
    .security-item i,
    .support-card i {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        font-size: 1.5rem !important;
    }
    
    .features-grid .card-icon i {
        font-size: 1.75rem !important;
    }
    
    /* Fix navbar on mobile */
    .navbar-collapse {
        background: white;
        padding: 1rem;
        margin-top: 0.5rem;
        border-radius: 0.5rem;
        box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    }
    
    .navbar-nav {
        flex-direction: column;
    }
    
    .navbar-nav .nav-link {
        padding: 0.75rem 0 !important;
        color: #333 !important;
    }
    
    .navbar-buttons {
        flex-direction: column;
        width: 100%;
        margin-top: 1rem;
    }
    
    .navbar-buttons .btn {
        width: 100%;
        margin-bottom: 0.5rem;
    }
    
    /* Fix floating elements */
    .whatsapp-float {
        bottom: 20px;
        right: 20px;
        width: 50px;
        height: 50px;
        font-size: 24px;
    }
    
    /* Fix footer */
    .footer {
        padding: 2rem 0;
    }
    
    .footer ul li a {
        font-size: 0.85rem;
    }
    
    /* Fix touch scrolling */
    * {
        -webkit-overflow-scrolling: touch;
    }
    
    /* Fix for iOS Safari address bar */
    .hero {
        min-height: 100vh;
        min-height: -webkit-fill-available;
    }
    
    /* Fix for zoom on input focus */
    input, select, textarea {
        font-size: 16px !important;
    }
}

/* Extra Small Devices (phones, 320px and up) */
@media (max-width: 320px) {
    .top-header {
        display: none;
    }

    .header-row {
        padding: 8px 0;
    }

    .header-datetime {
        font-size: 10px;
        gap: 5px;
    }

    .header-logo {
        font-size: 16px;
    }

    .header-logo-img {
        max-height: 30px;
    }

    .domain-search-container h2 {
        font-size: 1.25rem;
    }

    .tld-card {
        min-width: 70px;
        padding: 0.75rem;
    }

    .tld-card h4 {
        font-size: 0.9rem;
    }

    .tld-card .price {
        font-size: 0.8rem;
    }
    
    .hero h1 {
        font-size: 1.5rem;
    }
    
    .hero p {
        font-size: 0.9rem;
    }
    
    .hero-circles,
    .hero-server-icons {
        display: none;
    }
    
    .container {
        padding: 0 0.5rem !important;
    }
    
    .row {
        margin: 0 -0.5rem !important;
        width: calc(100% + 1rem) !important;
    }
    
    [class*="col-"] {
        padding: 0 0.5rem !important;
    }
    
    /* Additional fixes for very small screens */
    .top-header-left {
        gap: 5px;
        font-size: 10px;
    }
    
    .top-header-left span {
        flex-direction: column;
        align-items: flex-start;
        gap: 2px;
    }
    
    .top-header-right {
        gap: 5px;
    }
    
    .social-icon {
        font-size: 12px;
    }
    
    .header-logo {
        font-size: 14px;
    }
    
    .header-logo-img {
        max-height: 25px;
    }
    
    .header-datetime {
        font-size: 9px;
        gap: 3px;
    }
    
    .navbar-brand {
        font-size: 1rem;
    }
    
    .navbar-brand img {
        height: 25px;
    }
}

/* Small Devices (landscape phones, 375px and up) */
@media (min-width: 375px) {
    .top-header {
        display: block;
    }

    .header-datetime {
        font-size: 13px;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .features-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .security-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* Prevent overflow */
    .container {
        overflow-x: hidden;
    }
    
    .header-row {
        overflow: hidden;
    }
    
    .navbar {
        overflow: hidden;
    }
}

/* Small Devices (landscape phones, 425px and up) */
@media (min-width: 425px) {
    .hero h1 {
        font-size: 2.25rem;
    }
    
    .tld-cards {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* Prevent overflow */
    .container {
        overflow-x: hidden;
    }
    
    .header-row {
        overflow: hidden;
    }
    
    .navbar {
        overflow: hidden;
    }
}

/* Medium Devices (tablets, 768px and up) */
@media (min-width: 768px) {
    .top-header-left {
        gap: 30px;
    }

    .top-header-right {
        gap: 20px;
    }

    .header-datetime {
        font-size: 14px;
    }

    .domain-search-container h2 {
        font-size: 2.2rem;
    }

    .tld-cards {
        gap: 15px;
    }

    .tld-card {
        min-width: 110px;
    }

    .hero h1 {
        font-size: 2.75rem;
    }

    .hero p {
        font-size: 1.25rem;
    }

    .hero-buttons {
        flex-direction: row;
    }

    .hero-buttons .btn {
        width: auto;
    }

    .pricing-card {
        padding: 2rem;
    }

    .pricing-price {
        font-size: 2.5rem;
    }

    .features-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .security-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .support-cards {
        grid-template-columns: repeat(2, 1fr);
    }

    .payment-methods {
        grid-template-columns: repeat(3, 1fr);
    }

    .cart-item {
        flex-direction: row;
        align-items: center;
    }
    
    .cart-item .btn {
        width: auto;
    }
    
    .domain-search-form {
        flex-direction: row;
    }
    
    .domain-search-form input,
    .domain-search-form button {
        width: auto;
    }
    
    .comparison-table-wrapper {
        overflow-x: auto;
    }
    
    .comparison-table {
        min-width: 800px;
    }
    
    .footer ul li a {
        font-size: 0.8rem;
    }
    
    .payment-icons {
        display: flex;
        gap: 0.75rem;
        justify-content: center;
    }
    
    .payment-icon-wrapper {
        min-width: 45px;
        min-height: 28px;
        padding: 7px;
    }
    
    .payment-icon-svg {
        width: 36px;
        height: 22px;
    }
    
    .payment-icon-text {
        font-size: 0.75rem;
    }
    
    .payment-icons i {
        font-size: 1.75rem;
    }
    
    /* Prevent overflow */
    .container {
        overflow-x: hidden;
    }
    
    .header-row {
        overflow: hidden;
    }
    
    .navbar {
        overflow: hidden;
    }
    
    .hero {
        overflow: hidden;
    }
}

/* Large Devices (desktops, 1024px and up) */
@media (min-width: 1024px) {
    .hero h1 {
        font-size: 3rem;
    }
    
    .hero p {
        font-size: 1.25rem;
    }
    
    .features-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .security-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .support-cards {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .payment-methods {
        grid-template-columns: repeat(5, 1fr);
    }
    
    .tld-cards {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .footer ul li a {
        font-size: 0.8rem;
    }
    
    .payment-icons {
        display: flex;
        gap: 1rem;
        justify-content: center;
    }
    
    .payment-icon-wrapper {
        min-width: 50px;
        min-height: 32px;
        padding: 8px;
    }
    
    .payment-icon-svg {
        width: 40px;
        height: 25px;
    }
    
    .payment-icon-text {
        font-size: 0.85rem;
    }
    
    .payment-icons i {
        font-size: 2rem;
    }
}

/* Extra Large Devices (large desktops, 1366px and up) */
@media (min-width: 1366px) {
    .hero h1 {
        font-size: 3.25rem;
    }
    
    .hero p {
        font-size: 1.35rem;
    }
    
    .features-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Extra Extra Large Devices (extra large desktops, 1440px and up) */
@media (min-width: 1440px) {
    .hero h1 {
        font-size: 3.5rem;
    }
    
    .hero p {
        font-size: 1.4rem;
    }
}

/* Ultra Wide Screens (1920px and up) */
@media (min-width: 1920px) {
    .container {
        max-width: 1400px;
    }
    
    .hero h1 {
        font-size: 4rem;
    }
    
    .hero p {
        font-size: 1.5rem;
    }
    
    .features-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .security-grid {
        grid-template-columns: repeat(6, 1fr);
    }
    
    .support-cards {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Mobile Navigation */
@media (max-width: 991px) {
    .navbar-collapse {
        background: #FFFFFF;
        padding: 1rem;
        margin-top: 1rem;
        border-radius: 0.5rem;
        box-shadow: var(--shadow-lg);
    }
    
    .navbar-nav {
        flex-direction: column;
    }
    
    .navbar-nav .nav-link {
        padding: 0.75rem 0 !important;
    }
    
    .dropdown-menu {
        position: static;
        box-shadow: none;
        padding-left: 1rem;
        display: block !important;
        margin-top: 0;
        animation: none;
    }
    
    .navbar-nav .nav-link::after {
        display: none;
    }
    
    .dropdown-toggle::after {
        display: none !important;
    }
    
    .dropdown-icon {
        display: none !important;
    }
    
    .dropdown-menu {
        background: #f8f9fa;
        border-radius: 0.25rem;
        margin: 0.5rem 0;
    }
    
    .dropdown-item {
        padding: 0.5rem 1rem;
        color: #333;
    }
    
    .dropdown-item:hover {
        background: #e9ecef;
        transform: none;
    }
    
    .navbar-buttons {
        flex-direction: column;
        width: 100%;
        margin-top: 1rem;
    }
    
    .navbar-buttons .btn {
        width: 100%;
        margin-bottom: 0.5rem;
    }
}

/* Tablet Specific Adjustments */
@media (min-width: 768px) and (max-width: 1023px) {
    .pricing-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .features-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .security-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Desktop Navigation */
@media (min-width: 992px) {
    .navbar-nav {
        flex-direction: row;
    }
    
    .navbar-buttons {
        flex-direction: row;
        width: auto;
        margin-top: 0;
    }
    
    .navbar-buttons .btn {
        width: auto;
        margin-bottom: 0;
    }
}

/* Print Styles */
@media print {
    .navbar,
    .whatsapp-float,
    .hero-buttons,
    .btn {
        display: none;
    }
    
    .hero {
        background: none;
    }
    
    .card,
    .pricing-card {
        break-inside: avoid;
    }
}

/* High DPI Displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .card-icon i,
    .card-icon-svg,
    .security-item i,
    .support-card i {
        -webkit-font-smoothing: antialiased;
    }
}

/* Dark Mode Support (for future implementation) */
@media (prefers-color-scheme: dark) {
    /* Placeholder for dark mode if needed in future */
}

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

/* Landscape Orientation for Mobile */
@media (max-width: 767px) and (orientation: landscape) {
    .hero {
        padding: 3rem 0;
    }
    
    .hero h1 {
        font-size: 1.75rem;
    }
    
    .hero p {
        font-size: 0.9rem;
    }
    
    .floating-cards {
        display: none;
    }
}

/* Touch Devices */
@media (hover: none) and (pointer: coarse) {
    .card:hover,
    .pricing-card:hover {
        transform: none;
    }
    
    .btn:hover {
        transform: none;
    }
}

/* Loading State for Slow Connections */
@media (max-width: 767px) and (max-width: 600kbps) {
    .hero-image,
    .floating-cards {
        display: none;
    }
}

/* General Overflow Fixes for All Screen Sizes */
* {
    box-sizing: border-box;
}

/* Ensure icons are visible on all devices */
i, .fas, .far, .fab, .fal {
    display: inline-block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.card-icon i,
.security-item i,
.support-card i {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Fix for any elements that might cause horizontal scroll */
html, body {
    overflow-x: hidden;
    width: 100%;
    max-width: 100%;
}

/* Fix for Bootstrap grid issues */
.row {
    width: 100%;
    margin: 0;
}

/* Fix for navbar collapse */
.navbar-collapse {
    max-height: 100vh;
    overflow-y: hidden;
}



/* Fix for any tables */
table {
    width: 100%;
    table-layout: fixed;
}

/* Fix for any images or media */
img, video, iframe, canvas, svg {
    max-width: 100%;
    height: auto;
}

/* Fix for any text elements that might overflow */
h1, h2, h3, h4, h5, h6, p, span, div {
    max-width: 100%;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Payment Icons Responsive */
@media (max-width: 576px) {
    .payment-icons {
        gap: 0.5rem;
    }
    
    .payment-icon-wrapper {
        min-width: 35px;
        min-height: 22px;
        padding: 4px;
    }
    
    .payment-icon-svg {
        width: 28px;
        height: 18px;
    }
    
    .payment-icon-text {
        font-size: 0.65rem;
    }
    
    .payment-icons i {
        font-size: 1.25rem;
    }
}

@media (min-width: 577px) and (max-width: 768px) {
    .payment-icons {
        gap: 0.75rem;
    }
    
    .payment-icon-wrapper {
        min-width: 40px;
        min-height: 25px;
        padding: 5px;
    }
    
    .payment-icon-svg {
        width: 32px;
        height: 20px;
    }
    
    .payment-icon-text {
        font-size: 0.7rem;
    }
    
    .payment-icons i {
        font-size: 1.5rem;
    }
}

/* Final viewport and edge case fixes */
@media (max-width: 991px) {
    /* Ensure proper scaling on tablets and mobile */
    body {
        -webkit-text-size-adjust: 100%;
        -ms-text-size-adjust: 100%;
    }
    
    /* Fix for any remaining overflow issues */
    .container,
    .container-fluid {
        overflow-x: hidden;
        width: 100%;
        max-width: 100%;
    }
    
    /* Fix for any fixed-position elements */
    .whatsapp-float,
    #arrowUp {
        position: fixed;
        z-index: 9999;
    }
    
    /* Fix for modal backdrop */
    .modal-backdrop {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
    }
    
    /* Fix for navbar collapse */
    .navbar-collapse {
        max-height: calc(100vh - 60px);
        overflow-y: hidden;
    }
}
