/* 
 * TopRankedDomains.com - Responsive Stylesheet
 * Mobile and tablet responsive overrides
 */

/* ==========================================================================
   Base Responsive Styles
   ========================================================================== */

/* Ensure proper box-sizing */
*, *::before, *::after {
    box-sizing: border-box;
}

/* ==========================================================================
   Featured Section - Mobile Responsive Fixes
   ========================================================================== */

/* Large tablets and small desktops */
@media screen and (min-width: 769px) and (max-width: 1024px) {
    .featured-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 15px !important;
    }
}

/* All mobile devices - FORCE 2 COLUMNS */
@media screen and (max-width: 768px) {
    /* Featured section container */
    .featured-section {
        padding: 20px 10px !important;
        margin-bottom: 20px !important;
    }
    
    /* Featured title */
    .featured-title {
        font-size: 1.4rem !important;
        margin-bottom: 10px !important;
        padding-bottom: 10px !important;
    }
    
    /* Subtitle paragraph */
    .featured-subtitle,
    .featured-section p {
        font-size: 0.8rem !important;
        margin-bottom: 15px !important;
        padding: 0 5px !important;
        line-height: 1.4 !important;
    }
    
    /* CRITICAL FIX: Force 2-column grid layout */
    .featured-grid {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px !important;
        padding: 0 !important;
        max-width: 100% !important;
        margin: 0 auto !important;
    }
    
    /* Featured cards */
    .featured-card {
        padding: 15px 5px !important;
        min-height: 110px !important;
        border-radius: 10px !important;
        display: flex !important;
        flex-direction: column !important;
        justify-content: center !important;
        align-items: center !important;
        text-align: center !important;
    }
    
    /* Domain names - CRITICAL: NO HYPHENATION, SMALLER TEXT */
    .featured-domain {
        font-size: 0.65rem !important;  /* Reduced from 0.75rem */
        margin-bottom: 10px !important;
        word-break: break-all !important;  /* Changed from break-word to break-all */
        line-height: 1.15 !important;
        padding: 0 2px !important;
        text-align: center !important;
        font-weight: 600 !important;
        max-width: 100% !important;
        overflow-wrap: break-word !important;
        /* REMOVE ALL HYPHENATION */
        hyphens: none !important;
        -webkit-hyphens: none !important;
        -moz-hyphens: none !important;
        -ms-hyphens: none !important;
        /* Alternative: use ellipsis for very long domains */
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }
    
    /* Tier badges */
    .featured-tier {
        font-size: 0.6rem !important;  /* Reduced from 0.65rem */
        padding: 3px 8px !important;
        border-radius: 12px !important;
    }
}

/* Small mobile devices (480px and below) */
@media screen and (max-width: 480px) {
    .featured-section {
        padding: 15px 8px !important;
    }
    
    .featured-title {
        font-size: 1.2rem !important;
    }
    
    .featured-subtitle,
    .featured-section p {
        font-size: 0.75rem !important;
        margin-bottom: 12px !important;
    }
    
    /* Keep 2 columns on small mobile */
    .featured-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 8px !important;
    }
    
    .featured-card {
        padding: 12px 4px !important;
        min-height: 100px !important;
    }
    
    /* Even smaller text for small devices */
    .featured-domain {
        font-size: 0.6rem !important;  /* Reduced from 0.7rem */
        margin-bottom: 8px !important;
        padding: 0 2px !important;
        word-break: break-all !important;
        hyphens: none !important;
        -webkit-hyphens: none !important;
        -moz-hyphens: none !important;
        -ms-hyphens: none !important;
    }
    
    .featured-tier {
        font-size: 0.55rem !important;  /* Reduced from 0.6rem */
        padding: 2px 6px !important;
    }
}

/* Very small mobile devices - single column */
@media screen and (max-width: 360px) {
    .featured-grid {
        grid-template-columns: 1fr !important;
        gap: 10px !important;
    }
    
    .featured-card {
        min-height: 90px !important;
        padding: 15px 10px !important;
    }
    
    /* Single column can have slightly larger text */
    .featured-domain {
        font-size: 0.8rem !important;
        hyphens: none !important;
        -webkit-hyphens: none !important;
        word-break: break-all !important;
    }
    
    .featured-tier {
        font-size: 0.65rem !important;
    }
}

/* Landscape orientation on mobile - allow 3 columns */
@media screen and (max-width: 768px) and (orientation: landscape) {
    .featured-grid {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 10px !important;
    }
    
    .featured-card {
        min-height: 80px !important;
        padding: 10px 3px !important;
    }
    
    .featured-domain {
        font-size: 0.55rem !important;  /* Very small for 3 columns */
        hyphens: none !important;
        -webkit-hyphens: none !important;
    }
    
    .featured-tier {
        font-size: 0.5rem !important;
    }
}

/* Specific device breakpoints */
@media screen and (max-width: 428px) { /* iPhone 14 Pro Max, 13 Pro Max, 12 Pro Max */
    .featured-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    
    .featured-domain {
        font-size: 0.62rem !important;
        hyphens: none !important;
        -webkit-hyphens: none !important;
    }
}

@media screen and (max-width: 390px) { /* iPhone 14, 13, 12 */
    .featured-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    
    .featured-domain {
        font-size: 0.6rem !important;
        hyphens: none !important;
        -webkit-hyphens: none !important;
    }
}

@media screen and (max-width: 375px) { /* iPhone SE, 11 Pro, X, older iPhones */
    .featured-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    
    .featured-domain {
        font-size: 0.58rem !important;
        hyphens: none !important;
        -webkit-hyphens: none !important;
    }
}

@media screen and (max-width: 412px) { /* Pixel phones and many Android devices */
    .featured-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    
    .featured-domain {
        font-size: 0.62rem !important;
        hyphens: none !important;
        -webkit-hyphens: none !important;
    }
}

/* iOS Safari specific fixes */
@supports (-webkit-touch-callout: none) {
    .featured-card {
        -webkit-tap-highlight-color: rgba(255, 107, 53, 0.1) !important;
        -webkit-transform: translateZ(0) !important;
        transform: translateZ(0) !important;
    }
    
    .featured-domain {
        /* CRITICAL: Disable hyphenation on iOS */
        -webkit-hyphens: none !important;
        hyphens: none !important;
        -webkit-line-break: strict !important;
        word-wrap: break-word !important;
        overflow-wrap: break-word !important;
        word-break: break-all !important;
    }
}

/* High DPI screens (Retina displays) */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .featured-card {
        box-shadow: 0 4px 12px rgba(255, 107, 53, 0.25) !important;
    }
    
    .featured-card:hover {
        box-shadow: 0 6px 20px rgba(255, 107, 53, 0.35) !important;
    }
}

/* Accessibility - Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    .featured-card {
        transition: none !important;
    }
    
    .featured-card:hover {
        transform: none !important;
    }
}

/* ==========================================================================
   Additional Global Mobile Fixes
   ========================================================================== */

@media screen and (max-width: 768px) {
    /* Ensure container doesn't overflow */
    .container {
        max-width: 100% !important;
        padding: 0 10px !important;
        overflow-x: hidden !important;
    }
    
    /* Prevent horizontal scrolling */
    html, body {
        overflow-x: hidden !important;
    }
    
    /* Fix any potential overflow from fixed-width elements */
    * {
        max-width: 100% !important;
    }
}

/* ==========================================================================
   Domain Grid Responsive Fixes
   ========================================================================== */

@media screen and (max-width: 768px) {
    .domains-grid {
        grid-template-columns: 1fr !important;
        gap: 15px !important;
    }
    
    .domain-card {
        padding: 15px !important;
    }
    
    .domain-name {
        font-size: 1rem !important;
    }
}

/* ==========================================================================
   Header and Navigation Responsive
   ========================================================================== */

@media screen and (max-width: 768px) {
    .header {
        padding: 20px 15px !important;
    }
    
    .site-title {
        font-size: 1.8rem !important;
    }
    
    .subtitle {
        font-size: 1rem !important;
    }
    
    .stats {
        flex-direction: column !important;
        gap: 10px !important;
    }
    
    .stat-item {
        width: 100% !important;
        max-width: 300px !important;
    }
}

/* ==========================================================================
   Forms and Inputs Responsive
   ========================================================================== */

@media screen and (max-width: 768px) {
    .filter-row {
        flex-direction: column !important;
        gap: 10px !important;
    }
    
    .search-input,
    .filter-select {
        width: 100% !important;
        min-width: unset !important;
    }
}

/* ==========================================================================
   Footer and Share Section Responsive
   ========================================================================== */

@media screen and (max-width: 768px) {
    .share-buttons-main {
        flex-direction: column !important;
        gap: 10px !important;
    }
    
    .share-btn-main {
        width: 100% !important;
        max-width: 300px !important;
    }
    
    .newsletter-form {
        flex-direction: column !important;
    }
    
    .newsletter-input,
    .newsletter-btn {
        width: 100% !important;
    }
}