/* ========================================
   PIN HWA HIGH SCHOOL - RESPONSIVE DESIGN
   Comprehensive Mobile & Tablet Support
   ======================================== */

/* ===== BREAKPOINTS =====
   Mobile Small: 320px - 575px
   Mobile Large: 576px - 767px
   Tablet: 768px - 991px
   Desktop: 992px+
   ======================================== */

/* ==========================================
   1. GLOBAL RESPONSIVE STYLES
   ========================================== */

/* Ensure images are responsive */
img {
    max-width: 100%;
    height: auto;
}

/* Prevent horizontal scroll */
body {
    overflow-x: hidden;
    width: 100%;
}

/* Responsive containers */
.container,
.container-fluid {
    padding-left: 15px;
    padding-right: 15px;
}

/* ==========================================
   2. TABLET STYLES (768px - 991px)
   ========================================== */

@media (max-width: 991px) {
    /* Navigation adjustments */
    .navbar-floating {
        padding: 0.5rem 1rem;
    }
    
    .navbar-floating .navbar-brand img {
        height: 40px;
    }
    
    .navbar-floating .nav-link {
        padding: 0.4rem 0.8rem !important;
        font-size: 0.9rem;
    }
    
    /* Hero section adjustments */
    .hero-diagonal {
        min-height: 70vh;
    }
    
    .diagonal-card {
        padding: 2rem;
        margin-bottom: 1.5rem;
    }
    
    .display-2 {
        font-size: 2.5rem;
    }
    
    .display-6 {
        font-size: 1.8rem;
    }
    
    /* Features/Seven Habits section */
    .feature-card {
        margin-bottom: 1.5rem;
    }
    
    /* About section */
    .about-floating-card {
        position: relative !important;
        bottom: auto !important;
        right: auto !important;
        margin-top: 2rem;
    }
    
    /* Testimonials */
    .testimonial-card {
        margin-bottom: 1.5rem;
    }
    
    /* Video sections */
    .video-container {
        margin-bottom: 2rem;
    }
    
    /* Stats section */
    .stat-item {
        margin-bottom: 1.5rem;
    }
    
    /* Footer columns stack */
    .footer .col-lg-3,
    .footer .col-md-6 {
        margin-bottom: 2rem;
    }
}

/* ==========================================
   3. MOBILE LARGE STYLES (576px - 767px)
   ========================================== */

@media (max-width: 767px) {
    /* Body padding adjustment */
    body {
        padding-top: 60px;
    }
    
    /* Navigation mobile menu */
    .navbar-floating {
        padding: 0.5rem 1rem;
    }
    
    .navbar-floating .navbar-brand img {
        height: 35px;
    }
    
    .navbar-toggler {
        border: none;
        padding: 0.25rem 0.5rem;
    }
    
    .navbar-collapse {
        background: white;
        padding: 1rem;
        border-radius: 8px;
        margin-top: 0.5rem;
        box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    }
    
    .navbar-nav {
        gap: 0.25rem;
    }
    
    .navbar-floating .nav-link {
        padding: 0.6rem 1rem !important;
        border-radius: 8px;
    }
    
    /* Hero section mobile */
    .hero-diagonal {
        min-height: 60vh;
        padding: 2rem 0;
    }
    
    .diagonal-card {
        padding: 1.5rem;
        min-height: 280px;
    }
    
    .display-2 {
        font-size: 2rem;
    }
    
    .display-6 {
        font-size: 1.5rem;
    }
    
    .lead {
        font-size: 1rem;
    }
    
    /* Buttons */
    .btn-lg {
        padding: 0.6rem 1.2rem;
        font-size: 0.95rem;
    }
    
    .diagonal-buttons {
        display: flex;
        flex-direction: column;
        gap: 1rem;
    }
    
    .diagonal-buttons .btn {
        width: 100%;
        margin: 0 !important;
    }
    
    /* Seven Habits / Features */
    .features-section {
        padding: 2rem 0 !important;
        margin: 2rem 0 !important;
    }
    
    .feature-card {
        padding: 1.5rem;
    }
    
    .feature-icon {
        width: 50px;
        height: 50px;
        font-size: 1.5rem;
    }
    
    /* Section titles */
    h2.display-6 {
        font-size: 1.8rem;
    }
    
    h3.h4 {
        font-size: 1.3rem;
    }
    
    /* About section */
    .about-content {
        text-align: center;
    }
    
    .about-image {
        margin-bottom: 2rem;
    }
    
    /* Testimonials */
    .testimonials-section {
        padding: 2rem 0;
    }
    
    .testimonial-text {
        font-size: 0.95rem;
    }
    
    /* CTA section */
    .cta-section {
        padding: 2rem 1rem;
    }
    
    .cta-section .text-lg-end {
        text-align: center !important;
    }
    
    .cta-section .btn {
        display: block;
        width: 100%;
        margin-bottom: 0.5rem !important;
    }
    
    /* Video library */
    .video-grid {
        grid-template-columns: 1fr;
    }
    
    /* School song section */
    .school-song-section {
        padding: 2rem 0;
    }
    
    /* Statistics */
    .stats-section {
        padding: 2rem 0;
    }
    
    .stat-number {
        font-size: 2rem;
    }
    
    /* Footer */
    .footer {
        padding: 40px 0 20px;
    }
    
    .footer h5 {
        font-size: 1.1rem;
        margin-bottom: 15px;
    }
    
    .footer .social-links a {
        width: 35px;
        height: 35px;
        margin-right: 8px;
    }
    
    /* Language switcher */
    .lang-switcher {
        margin-top: 1rem;
    }
    
    /* Dropdown menus */
    .dropdown-menu {
        min-width: 100% !important;
        width: 100% !important;
    }
}

/* ==========================================
   4. MOBILE SMALL STYLES (320px - 575px)
   ========================================== */

@media (max-width: 575px) {
    /* Extra small adjustments */
    .container {
        padding-left: 10px;
        padding-right: 10px;
    }
    
    /* Hero section extra small */
    .hero-diagonal {
        min-height: 55vh;
    }
    
    .diagonal-card {
        padding: 1.2rem;
        min-height: 250px;
    }
    
    .display-2 {
        font-size: 1.7rem;
    }
    
    .display-6 {
        font-size: 1.3rem;
    }
    
    /* Creative badge */
    .creative-badge {
        font-size: 0.8rem;
        padding: 0.4rem 1rem;
    }
    
    /* Feature cards */
    .feature-card {
        padding: 1.2rem;
    }
    
    .feature-content h4 {
        font-size: 1.1rem;
    }
    
    .feature-content p {
        font-size: 0.85rem;
    }
    
    /* Text sizes */
    p.lead {
        font-size: 0.9rem;
    }
    
    small.text-muted {
        font-size: 0.75rem;
    }
    
    /* Buttons */
    .btn {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }
    
    /* Cards and sections */
    .card {
        padding: 1rem;
    }
    
    /* Spacing utilities */
    .py-5 {
        padding-top: 2rem !important;
        padding-bottom: 2rem !important;
    }
    
    .my-5 {
        margin-top: 2rem !important;
        margin-bottom: 2rem !important;
    }
    
    .mb-4 {
        margin-bottom: 1rem !important;
    }
    
    .mb-5 {
        margin-bottom: 1.5rem !important;
    }
    
    /* Images */
    .img-fluid {
        max-width: 100%;
    }
    
    /* Icons */
    .fa-3x {
        font-size: 2rem !important;
    }
    
    .fa-2x {
        font-size: 1.5rem !important;
    }
}

/* ==========================================
   5. LANDSCAPE MODE OPTIMIZATIONS
   ========================================== */

@media (max-width: 991px) and (orientation: landscape) {
    .hero-diagonal {
        min-height: 100vh;
    }
    
    .diagonal-card {
        min-height: 200px;
    }
}

/* ==========================================
   6. PRINT STYLES
   ========================================== */

@media print {
    .navbar-floating,
    .footer,
    .btn,
    .no-print {
        display: none !important;
    }
    
    body {
        padding-top: 0;
    }
    
    .main-content {
        margin-top: 0;
    }
}

/* ==========================================
   7. HIGH DPI / RETINA DISPLAYS
   ========================================== */

@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    img {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* ==========================================
   8. ACCESSIBILITY IMPROVEMENTS
   ========================================== */

/* Focus indicators for keyboard navigation */
@media (prefers-reduced-motion: no-preference) {
    a:focus,
    button:focus,
    input:focus,
    select:focus,
    textarea:focus {
        outline: 2px solid var(--primary-color);
        outline-offset: 2px;
    }
}

/* Reduce motion for users who prefer it */
@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;
    }
}

/* ==========================================
   9. TOUCH DEVICE OPTIMIZATIONS
   ========================================== */

@media (hover: none) and (pointer: coarse) {
    /* Increase touch targets */
    .btn,
    .nav-link,
    .dropdown-item {
        min-height: 44px;
        padding: 0.75rem 1rem;
    }
    
    /* Remove hover effects on touch devices */
    .feature-card:hover,
    .testimonial-card:hover {
        transform: none;
    }
}

/* ==========================================
   10. DARK MODE SUPPORT (Optional)
   ========================================== */

@media (prefers-color-scheme: dark) {
    /* Add dark mode styles here if needed */
    /* This can be expanded based on requirements */
}

/* ==========================================
   11. CONTACT PAGE RESPONSIVE
   ========================================== */

@media (max-width: 991px) {
    .contact-hero {
        padding: 30px 0 !important;
    }
    
    .contact-section {
        padding: 60px 0;
    }
    
    .contact-card {
        margin-bottom: 1.5rem;
    }
}

@media (max-width: 767px) {
    .contact-hero {
        padding: 25px 0 !important;
    }
    
    .contact-hero::before,
    .contact-hero::after {
        display: none; /* Hide decorative elements on mobile */
    }
    
    .contact-section {
        padding: 40px 0;
    }
    
    .contact-card {
        padding: 1.5rem !important;
        margin-bottom: 1rem;
    }
    
    .contact-info-item {
        padding: 15px !important;
        margin-bottom: 1rem;
    }
    
    .contact-form {
        margin-top: 2rem;
    }
    
    .map-container {
        height: 300px !important;
        margin-top: 2rem;
    }
}

@media (max-width: 575px) {
    .contact-hero {
        padding: 20px 0 !important;
    }
    
    .contact-card {
        padding: 1.2rem !important;
    }
    
    .contact-info-item {
        padding: 12px !important;
    }
}

/* ==========================================
   12. GALLERY PAGE RESPONSIVE
   ========================================== */

@media (max-width: 991px) {
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 767px) {
    .gallery-grid {
        grid-template-columns: 1fr;
    }
    
    .gallery-item {
        margin-bottom: 1rem;
    }
    
    .gallery-filters {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .gallery-filter-btn {
        font-size: 0.85rem;
        padding: 0.4rem 0.8rem;
    }
}

/* ==========================================
   13. NEWS & PIN NEWS PAGE RESPONSIVE
   ========================================== */

@media (max-width: 991px) {
    .news-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 767px) {
    .news-grid {
        grid-template-columns: 1fr;
    }
    
    .news-card {
        margin-bottom: 1.5rem;
    }
    
    .news-image {
        height: 200px;
    }
    
    .news-content {
        padding: 1.5rem;
    }
    
    .news-title {
        font-size: 1.2rem;
    }
    
    .news-excerpt {
        font-size: 0.9rem;
    }
    
    .news-meta {
        font-size: 0.8rem;
    }
}

@media (max-width: 575px) {
    .news-image {
        height: 180px;
    }
    
    .news-content {
        padding: 1.2rem;
    }
    
    .news-title {
        font-size: 1.1rem;
    }
}

/* ==========================================
   14. HONOR ROLL PAGE RESPONSIVE
   ========================================== */

@media (max-width: 991px) {
    .honor-card {
        margin-bottom: 1.5rem;
    }
}

@media (max-width: 767px) {
    .honor-list {
        padding: 0;
    }
    
    .honor-item {
        padding: 1rem;
        margin-bottom: 0.75rem;
    }
    
    .honor-badge {
        width: 50px;
        height: 50px;
        font-size: 1.5rem;
    }
    
    .honor-name {
        font-size: 1rem;
    }
    
    .honor-description {
        font-size: 0.85rem;
    }
}

/* ==========================================
   15. PANORAMA / 360 TOUR PAGE RESPONSIVE
   ========================================== */

@media (max-width: 991px) {
    .panorama-container {
        height: 500px;
    }
}

@media (max-width: 767px) {
    .panorama-container {
        height: 400px;
    }
    
    .panorama-controls {
        bottom: 10px;
        left: 10px;
        right: 10px;
    }
    
    .panorama-control-btn {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
    
    .viewpoint-list {
        max-height: 200px;
    }
}

@media (max-width: 575px) {
    .panorama-container {
        height: 300px;
    }
    
    .panorama-control-btn {
        width: 35px;
        height: 35px;
        font-size: 0.9rem;
    }
}

/* ==========================================
   16. SEVEN HABITS PAGE RESPONSIVE
   ========================================== */

@media (max-width: 991px) {
    .habit-card {
        margin-bottom: 1.5rem;
    }
}

@media (max-width: 767px) {
    .habit-detail {
        padding: 1.5rem;
    }
    
    .habit-icon {
        width: 60px;
        height: 60px;
        font-size: 2rem;
    }
    
    .habit-title {
        font-size: 1.3rem;
    }
    
    .habit-description {
        font-size: 0.95rem;
    }
}

@media (max-width: 575px) {
    .habit-detail {
        padding: 1.2rem;
    }
    
    .habit-icon {
        width: 50px;
        height: 50px;
        font-size: 1.8rem;
    }
    
    .habit-title {
        font-size: 1.2rem;
    }
}

/* ==========================================
   17. ADMIN LOGIN PAGE RESPONSIVE
   ========================================== */

@media (max-width: 767px) {
    .login-container {
        padding: 1.5rem;
    }
    
    .login-card {
        padding: 2rem 1.5rem;
    }
    
    .login-logo {
        width: 80px;
        height: 80px;
    }
    
    .login-title {
        font-size: 1.5rem;
    }
}

@media (max-width: 575px) {
    .login-container {
        padding: 1rem;
    }
    
    .login-card {
        padding: 1.5rem 1.2rem;
    }
    
    .login-logo {
        width: 70px;
        height: 70px;
    }
    
    .login-title {
        font-size: 1.3rem;
    }
}
