/**
 * Responsive Fixes & Mobile Optimization
 * HHost - CMS
 */

/* ==================== MOBILE MENU IMPROVEMENTS ==================== */
@media (max-width: 768px) {
    /* Menu Toggle Animation */
    .modern-menu-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }
    
    .modern-menu-toggle.active span:nth-child(2) {
        opacity: 0;
    }
    
    .modern-menu-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(7px, -6px);
    }
    
    /* Mobile Menu Styling */
    .modern-menu {
        animation: slideDown 0.3s ease-out;
    }
    
    @keyframes slideDown {
        from {
            opacity: 0;
            transform: translateY(-20px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }
    
    .modern-menu-link {
        width: 100%;
        justify-content: flex-start;
        padding: 1rem;
    }
    
    /* Hero Adjustments */
    .modern-hero {
        padding: 2rem 0;
    }
    
    .modern-hero h1 {
        font-size: 1.75rem;
        line-height: 1.3;
    }
    
    .modern-hero p {
        font-size: 1rem;
    }
    
    /* Section Spacing */
    .modern-section {
        padding: 2rem 0;
    }
    
    .modern-section-title {
        font-size: 1.5rem;
    }
    
    .modern-section-subtitle {
        font-size: 1rem;
    }
    
    /* Pricing Cards */
    .modern-pricing-card {
        padding: 1.5rem;
    }
    
    .modern-pricing-amount {
        font-size: 2.5rem;
    }
    
    .modern-pricing-title {
        font-size: 1.5rem;
    }
    
    /* Feature Icons */
    .modern-feature-icon {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
    }
    
    /* Buttons */
    .modern-btn-lg {
        padding: 0.875rem 1.5rem;
        font-size: 1rem;
    }
    
    /* Footer */
    .modern-footer-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    /* Container Padding */
    .modern-container {
        padding: 0 1rem;
    }
}

/* ==================== TABLET ADJUSTMENTS ==================== */
@media (min-width: 769px) and (max-width: 1024px) {
    .modern-pricing-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .modern-features-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ==================== SMALL MOBILE ==================== */
@media (max-width: 480px) {
    h1 { font-size: 1.75rem; }
    h2 { font-size: 1.5rem; }
    h3 { font-size: 1.25rem; }
    
    .modern-pricing-grid {
        gap: 1.5rem;
    }
    
    .modern-features-grid {
        gap: 1.5rem;
    }
    
    .modern-btn {
        width: 100%;
        justify-content: center;
    }
}

/* ==================== LANDSCAPE MODE ==================== */
@media (max-height: 500px) and (orientation: landscape) {
    .modern-hero {
        padding: 1.5rem 0;
    }
    
    .modern-hero h1 {
        font-size: 1.5rem;
    }
}

/* ==================== TOUCH DEVICE OPTIMIZATIONS ==================== */
@media (hover: none) and (pointer: coarse) {
    /* Larger touch targets */
    .modern-menu-link {
        min-height: 48px;
    }
    
    .modern-btn {
        min-height: 48px;
    }
    
    /* Remove hover effects on touch */
    .modern-card:hover {
        transform: none;
    }
    
    .modern-pricing-card:hover {
        transform: none;
    }
}

/* ==================== ACCESSIBILITY ==================== */
/* Focus Visible */
.modern-menu-link:focus-visible,
.modern-btn:focus-visible {
    outline: 3px solid var(--primary-color);
    outline-offset: 2px;
}

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

/* ==================== PRINT STYLES ==================== */
@media print {
    .modern-topbar,
    .modern-header,
    .modern-footer,
    .modern-btn {
        display: none;
    }
    
    .modern-section {
        page-break-inside: avoid;
    }
    
    .modern-pricing-card {
        page-break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ddd;
    }
}

/* ==================== HIGH CONTRAST MODE ==================== */
@media (prefers-contrast: high) {
    .modern-card,
    .modern-pricing-card {
        border: 2px solid currentColor;
    }
    
    .modern-btn {
        border: 2px solid currentColor;
    }
}

/* ==================== DARK MODE SUPPORT (OPTIONAL) ==================== */
@media (prefers-color-scheme: dark) {
    /* Uncomment to enable dark mode */
    /*
    :root {
        --gray-50: #1f2937;
        --gray-100: #374151;
        --gray-900: #f9fafb;
        --white: #111827;
    }
    
    body {
        background-color: #111827;
        color: #f9fafb;
    }
    
    .modern-card,
    .modern-pricing-card {
        background-color: #1f2937;
        color: #f9fafb;
    }
    */
}

/* ==================== LOADING STATE ==================== */
.loading {
    pointer-events: none;
    opacity: 0.6;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    margin: -20px 0 0 -20px;
    border: 4px solid rgba(0, 0, 0, 0.1);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ==================== UTILITY CLASSES ==================== */
.hide-mobile {
    display: none;
}

@media (min-width: 769px) {
    .hide-mobile {
        display: block;
    }
    
    .hide-desktop {
        display: none;
    }
}

.text-truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
