/**
 * Niyog.info - Responsive Styles
 * Mobile-first responsive design
 */

/* ========================================
   Tablet (768px and below)
   ======================================== */
@media (max-width: 768px) {
    /* Typography */
    h1 { font-size: var(--font-size-3xl); }
    h2 { font-size: var(--font-size-2xl); }
    h3 { font-size: var(--font-size-xl); }
    
    /* Container */
    .container {
        padding: 0 var(--spacing-md);
    }
    
    /* Header */
    .header-wrapper {
        flex-wrap: wrap;
    }
    
    .header-search.desktop-only {
        display: none;
    }
    
    .mobile-menu-toggle {
        display: flex;
    }
    
    /* Navigation */
    .main-nav {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: var(--gray-900);
        z-index: var(--z-modal);
        padding: var(--spacing-xl);
    }
    
    .main-nav.active {
        display: block;
    }
    
    .nav-menu {
        flex-direction: column;
        align-items: stretch;
        gap: 0;
    }
    
    .nav-item a {
        padding: var(--spacing-md);
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    /* Dropdown - show as accordion on mobile */
    .dropdown-menu {
        position: static;
        display: none;
        box-shadow: none;
        background: rgba(255, 255, 255, 0.05);
        margin: 0;
    }
    
    .nav-item.has-dropdown.active .dropdown-menu {
        display: block;
    }
    
    .dropdown-menu a {
        color: rgba(255, 255, 255, 0.8);
        padding-left: var(--spacing-2xl);
    }
    
    .mobile-search {
        display: block;
        padding: var(--spacing-md) 0;
    }
    
    .mobile-search .search-form {
        display: flex;
        flex-direction: column;
        gap: var(--spacing-sm);
    }
    
    .mobile-search .search-input,
    .mobile-search .search-btn {
        width: 100%;
    }
    
    /* Main Content */
    .main-content {
        padding: var(--spacing-xl) 0;
    }
    
    /* Footer */
    .footer-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-xl);
    }
    
    .footer-bottom-content {
        flex-direction: column;
        text-align: center;
    }
    
    .footer-legal {
        flex-direction: column;
        gap: var(--spacing-sm);
    }
    
    .newsletter-form {
        flex-direction: column;
    }
    
    /* Job Cards */
    .job-card-header {
        flex-direction: column;
    }
    
    .job-meta {
        flex-direction: column;
        gap: var(--spacing-sm);
    }
    
    .job-footer {
        flex-direction: column;
        gap: var(--spacing-md);
        align-items: flex-start;
    }
    
    /* Grid */
    .grid-cols-2,
    .grid-cols-3,
    .grid-cols-4 {
        grid-template-columns: 1fr;
    }
    
    /* Buttons */
    .btn {
        width: 100%;
        justify-content: center;
    }
    
    .btn-group {
        flex-direction: column;
    }
    
    /* Pagination */
    .pagination {
        flex-wrap: wrap;
    }
    
    /* Mobile Bottom Nav - Show on mobile */
    .mobile-bottom-nav {
        display: flex;
    }
    
    /* Add padding to bottom of content to account for bottom nav */
    .main-content {
        padding-bottom: 80px;
    }
    
    /* Back to top button - adjust position */
    .back-to-top {
        bottom: 80px;
    }
    
    /* Utilities */
    .desktop-only {
        display: none !important;
    }
    
    .mobile-only {
        display: block !important;
    }
    
    /* Section */
    .section {
        padding: var(--spacing-2xl) 0;
    }
    
    .section-title {
        font-size: var(--font-size-2xl);
    }
    
    /* Search Input Group - Stack on mobile */
    .search-input-group {
        flex-direction: column;
    }
    
    .search-location {
        min-width: 100%;
    }
    
    /* Tabs - Scrollable on mobile */
    .tabs-nav {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    
    .tabs-nav::-webkit-scrollbar {
        display: none;
    }
    
    /* Cards - Full width on mobile */
    .card {
        border-radius: var(--radius-md);
    }
    
    /* Form - Larger inputs on mobile */
    .form-control {
        font-size: 16px; /* Prevents zoom on iOS */
    }
}

/* ========================================
   Mobile (480px and below)
   ======================================== */
@media (max-width: 480px) {
    /* Even smaller typography */
    h1 { font-size: var(--font-size-2xl); }
    h2 { font-size: var(--font-size-xl); }
    
    /* Reduce spacing */
    .section {
        padding: var(--spacing-xl) 0;
    }
    
    .footer-grid {
        gap: var(--spacing-lg);
    }
    
    /* Logo - Smaller on mobile */
    .logo-image {
        height: 32px;
    }
    
    .logo-text {
        font-size: var(--font-size-lg);
    }
    
    /* Job card - More compact */
    .job-card {
        padding: var(--spacing-md);
    }
    
    .job-title {
        font-size: var(--font-size-base);
    }
    
    /* Buttons - Smaller */
    .btn {
        padding: 0.625rem 1rem;
        font-size: var(--font-size-sm);
    }
    
    /* Newsletter */
    .newsletter-box h3 {
        font-size: var(--font-size-lg);
    }
    
    /* Back to top - Smaller */
    .back-to-top {
        width: 40px;
        height: 40px;
        bottom: 70px;
        right: var(--spacing-md);
    }
    
    /* Mobile bottom nav - Smaller text */
    .mobile-bottom-nav {
        padding: 0.375rem 0;
    }
    
    .mobile-bottom-nav .nav-item {
        font-size: 0.625rem;
    }
    
    .mobile-bottom-nav svg {
        width: 20px;
        height: 20px;
    }
}

/* ========================================
   Tablet Landscape (768px to 1024px)
   ======================================== */
@media (min-width: 769px) and (max-width: 1024px) {
    /* Grid - 2 columns on tablet */
    .grid-cols-3,
    .grid-cols-4 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* Header search - Reduce width */
    .header-search {
        max-width: 400px;
    }
}

/* ========================================
   Large Desktop (1440px and above)
   ======================================== */
@media (min-width: 1440px) {
    .container {
        max-width: 1320px;
    }
    
    .container-wide {
        max-width: 1600px;
    }
    
    /* Larger typography on big screens */
    h1 { font-size: 3rem; }
    h2 { font-size: 2.5rem; }
}

/* ========================================
   Print Styles
   ======================================== */
@media print {
    /* Hide navigation and footer */
    .site-header,
    .main-nav,
    .site-footer,
    .back-to-top,
    .mobile-bottom-nav,
    .ad-container {
        display: none !important;
    }
    
    /* Remove shadows and backgrounds */
    * {
        background: white !important;
        color: black !important;
        box-shadow: none !important;
        text-shadow: none !important;
    }
    
    /* Show links */
    a[href]:after {
        content: " (" attr(href) ")";
    }
    
    /* Page breaks */
    h1, h2, h3, h4, h5, h6 {
        page-break-after: avoid;
    }
    
    .job-card,
    .card {
        page-break-inside: avoid;
    }
}

/* ========================================
   Landscape Phone (Horizontal)
   ======================================== */
@media (max-height: 500px) and (orientation: landscape) {
    .main-nav {
        overflow-y: auto;
    }
    
    .section {
        padding: var(--spacing-xl) 0;
    }
}

/* ========================================
   High Resolution Displays (Retina)
   ======================================== */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    /* Use higher quality images here if needed */
    .logo-image {
        image-rendering: -webkit-optimize-contrast;
    }
}

/* ========================================
   Dark Mode (Optional)
   ======================================== */
@media (prefers-color-scheme: dark) {
    /* Dark mode styles can be added here if needed */
    /* For now, keeping light mode only */
}

/* ========================================
   Reduced Motion
   ======================================== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* ========================================
   Touch Device Optimizations
   ======================================== */
@media (hover: none) and (pointer: coarse) {
    /* Larger touch targets */
    .btn,
    .nav-item a,
    .form-control {
        min-height: 44px;
    }
    
    /* Remove hover effects on touch devices */
    .card:hover,
    .job-card:hover,
    .btn:hover {
        transform: none;
    }
}