/* Enhanced Responsive Design for IFN Ministry Website */

/* Base responsive typography */
html {
    font-size: 16px;
}

/* Extra small devices (phones, 320px and up) */
@media (max-width: 480px) {
    html {
        font-size: 14px;
    }
    
    /* Hero section adjustments */
    .hero-slider {
        height: 60vh !important; /* Reduced from 80vh to 60vh for mobile */
    }
    
    .hero-slide {
        height: 60vh !important;
        padding-top: 2rem !important;
        padding-bottom: 2rem !important;
    }
    
    .hero-slide h1 {
        font-size: 1.8rem !important;
        line-height: 1.2;
        margin-bottom: 0.5rem;
    }
    
    .hero-slide p {
        font-size: 0.9rem !important;
        line-height: 1.4;
        margin-bottom: 1rem;
    }
    
    .hero-slide .btn {
        font-size: 0.85rem;
        padding: 0.6rem 1.2rem;
    }
    
    /* Container padding */
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    /* Section padding */
    section {
        padding-top: 2rem;
        padding-bottom: 2rem;
    }
    
    /* Card adjustments */
    .bg-white {
        padding: 1rem !important;
    }
    
    /* Text size adjustments */
    h1 {
        font-size: 1.8rem;
    }
    
    h2 {
        font-size: 1.5rem;
    }
    
    h3 {
        font-size: 1.2rem;
    }
    
    h4 {
        font-size: 1.1rem;
    }
    
    /* Button adjustments */
    .btn, button, a[class*="btn"] {
        font-size: 0.85rem;
        padding: 0.6rem 1rem;
    }
    
    /* Navigation adjustments */
    .mobile-nav-item span {
        font-size: 0.7rem;
    }
    
    /* Live stream banner */
    .bg-gradient-to-r .text-2xl {
        font-size: 1.3rem !important;
    }
    
    .bg-gradient-to-r .text-lg {
        font-size: 1rem !important;
    }
    
    /* Countdown cards */
    .countdown-card {
        min-width: 70px !important;
        padding: 0.75rem !important;
    }
    
    .countdown-card .text-3xl {
        font-size: 1.2rem !important;
    }
    
    .countdown-card .text-sm {
        font-size: 0.7rem !important;
    }
}

/* Small devices (landscape phones, 481px to 768px) */
@media (min-width: 481px) and (max-width: 768px) {
    html {
        font-size: 15px;
    }
    
    /* Hero section adjustments for small devices */
    .hero-slider {
        height: 70vh !important; /* Slightly taller than mobile but still reduced */
    }
    
    .hero-slide {
        height: 70vh !important;
        padding-top: 2.5rem !important;
        padding-bottom: 2.5rem !important;
    }
    
    .hero-slide h1 {
        font-size: 2.2rem !important;
        line-height: 1.3;
    }
    
    .hero-slide p {
        font-size: 1rem !important;
        line-height: 1.5;
    }
    
    /* Section padding */
    section {
        padding-top: 3rem;
        padding-bottom: 3rem;
    }
    
    /* Card adjustments */
    .bg-white {
        padding: 1.25rem !important;
    }
    
    /* Text adjustments */
    h1 {
        font-size: 2rem;
    }
    
    h2 {
        font-size: 1.7rem;
    }
    
    h3 {
        font-size: 1.4rem;
    }
    
    /* Countdown cards */
    .countdown-card {
        min-width: 80px !important;
        padding: 1rem !important;
    }
    
    .countdown-card .text-3xl {
        font-size: 1.4rem !important;
    }
    
    .countdown-card .text-sm {
        font-size: 0.8rem !important;
    }
}

/* Medium devices (tablets, 769px to 1024px) */
@media (min-width: 769px) and (max-width: 1024px) {
    html {
        font-size: 15px;
    }
    
    .hero-slide h1 {
        font-size: 2.8rem !important;
    }
    
    .hero-slide p {
        font-size: 1.1rem !important;
    }
    
    /* Grid adjustments */
    .grid-cols-1.md\:grid-cols-2.lg\:grid-cols-3 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    
    /* Section padding */
    section {
        padding-top: 4rem;
        padding-bottom: 4rem;
    }
}

/* Large devices (desktops, 1025px to 1200px) */
@media (min-width: 1025px) and (max-width: 1200px) {
    html {
        font-size: 16px;
    }
    
    .container {
        max-width: 1140px;
    }
}

/* Extra large devices (large desktops, 1201px and up) */
@media (min-width: 1201px) {
    html {
        font-size: 17px;
    }
    
    .container {
        max-width: 1200px;
    }
    
    .hero-slide h1 {
        font-size: 3.5rem !important;
    }
    
    .hero-slide p {
        font-size: 1.3rem !important;
    }
}

/* Responsive images */
img {
    max-width: 100%;
    height: auto;
}

/* Responsive tables */
@media (max-width: 768px) {
    table {
        font-size: 0.8rem;
    }
    
    th, td {
        padding: 0.5rem 0.25rem;
    }
}

/* Responsive forms */
@media (max-width: 768px) {
    input, textarea, select {
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    .form-group {
        margin-bottom: 1rem;
    }
    
    label {
        font-size: 0.9rem;
        margin-bottom: 0.25rem;
    }
}

/* Responsive spacing utilities */
@media (max-width: 480px) {
    .space-y-4 > * + * {
        margin-top: 0.75rem;
    }
    
    .space-y-6 > * + * {
        margin-top: 1rem;
    }
    
    .space-y-8 > * + * {
        margin-top: 1.25rem;
    }
    
    .mb-4 {
        margin-bottom: 0.75rem;
    }
    
    .mb-6 {
        margin-bottom: 1rem;
    }
    
    .mb-8 {
        margin-bottom: 1.25rem;
    }
    
    .py-8 {
        padding-top: 1.5rem;
        padding-bottom: 1.5rem;
    }
    
    .py-12 {
        padding-top: 2rem;
        padding-bottom: 2rem;
    }
    
    .py-16 {
        padding-top: 2.5rem;
        padding-bottom: 2.5rem;
    }
}

/* Responsive flex utilities */
@media (max-width: 768px) {
    .flex-col.md\:flex-row {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    
    .space-x-6.md\:space-x-6 {
        margin-left: 0;
        margin-right: 0;
    }
    
    .space-x-6.md\:space-x-6 > * + * {
        margin-left: 0;
        margin-top: 1rem;
    }
}

/* Responsive grid improvements */
@media (max-width: 640px) {
    .grid-cols-2 {
        grid-template-columns: repeat(1, minmax(0, 1fr));
        gap: 1rem;
    }
    
    .grid-cols-3 {
        grid-template-columns: repeat(1, minmax(0, 1fr));
        gap: 1rem;
    }
    
    .grid-cols-4 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.75rem;
    }
}

/* Enhanced mobile navigation */
@media (max-width: 768px) {
    .mobile-nav {
        padding: 0.5rem 0;
    }
    
    .mobile-nav-item {
        padding: 0.5rem 0.25rem;
    }
    
    .mobile-nav-item i {
        font-size: 18px;
    }
    
    .mobile-nav-item span {
        font-size: 0.75rem;
        margin-top: 0.25rem;
    }
}

/* Enhanced header responsiveness */
@media (max-width: 480px) {
    /* Mobile top bar adjustments */
    .bg-primary {
        padding: 0.5rem 0.75rem !important;
    }
    
    /* Desktop navigation height adjustments */
    .desktop-nav .h-14 {
        height: 3rem;
    }
    
    /* Logo and text size adjustments */
    .desktop-nav img {
        height: 1.75rem;
    }
    
    .desktop-nav .text-lg {
        font-size: 0.9rem;
    }
    
    /* Navigation menu spacing */
    .desktop-nav .space-x-3 > * + * {
        margin-left: 0.5rem;
    }
    
    /* Dropdown menu adjustments */
    .dropdown-menu {
        min-width: 160px;
        font-size: 0.85rem;
    }
    
    .dropdown-menu a {
        padding: 0.5rem 0.75rem;
    }
}

@media (min-width: 481px) and (max-width: 768px) {
    /* Tablet header adjustments */
    .desktop-nav .space-x-3 > * + * {
        margin-left: 0.75rem;
    }
    
    .desktop-nav .text-sm {
        font-size: 0.9rem;
    }
}

/* Mobile drawer improvements */
@media (max-width: 768px) {
    .mobile-drawer {
        overflow-y: auto;
    }
    
    .mobile-drawer .p-4 {
        padding: 1rem;
    }
    
    .mobile-drawer h3 {
        font-size: 1rem;
        margin-bottom: 0.75rem;
    }
    
    .mobile-drawer a {
        padding: 0.75rem 0;
        font-size: 0.9rem;
        border-bottom: 1px solid #f3f4f6;
        display: block;
        transition: color 0.2s;
    }
    
    .mobile-drawer a:hover {
        color: var(--primary-color);
    }
    
    /* Better touch targets */
    .mobile-nav-item {
        min-height: 60px;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
    }
}

/* Responsive WhatsApp button */
@media (max-width: 480px) {
    .whatsapp-float {
        width: 50px;
        height: 50px;
        font-size: 24px;
        bottom: 90px;
        right: 15px;
    }
}

/* Improved header sticky behavior */
@media (max-width: 768px) {
    .desktop-nav {
        position: relative;
    }
    
    /* Ensure mobile top bar doesn't interfere with content */
    body {
        padding-top: 0;
    }
}

@media (min-width: 769px) {
    .desktop-nav {
        position: sticky;
        top: 0;
    }
}

/* Print styles */
@media print {
    .mobile-nav,
    .whatsapp-float,
    .hero-slider,
    .bg-gradient-to-r {
        display: none !important;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.4;
    }
    
    h1 {
        font-size: 18pt;
    }
    
    h2 {
        font-size: 16pt;
    }
    
    h3 {
        font-size: 14pt;
    }
}

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

/* High contrast mode support */
@media (prefers-contrast: high) {
    .text-gray-600 {
        color: #000 !important;
    }
    
    .text-gray-700 {
        color: #000 !important;
    }
    
    .bg-gray-50 {
        background-color: #fff !important;
    }
}

/* Dark mode support (if needed in future) */
@media (prefers-color-scheme: dark) {
    /* Dark mode styles can be added here */
}