/* ============================================
   PT Lossday Sejahtera Group - Responsive CSS
   Tablet & Mobile Optimizations
   ============================================ */

/* Tablet (768px - 1024px) */
@media (max-width: 1024px) {
    .container {
        padding: 0 30px;
    }
    
    h1 {
        font-size: 2.2rem;
    }
    
    h2 {
        font-size: 1.8rem;
    }
    
    .hero {
        height: 70vh;
        min-height: 500px;
    }
    
    .hero-title {
        font-size: 2.5rem;
    }
    
    .profil-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }
    
    .misi-cards {
        grid-template-columns: 1fr;
    }
    
    .unit-grid {
        grid-template-columns: 1fr;
    }
    
    .paket-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }
    
    .form-grid {
        grid-template-columns: 1fr;
    }
    
    .terms-content {
        grid-template-columns: 1fr;
    }
    
    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 30px;
    }
}

/* Mobile Landscape (576px - 767px) */
@media (max-width: 767px) {
    .container {
        padding: 0 20px;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    h2 {
        font-size: 1.6rem;
    }
    
    h3 {
        font-size: 1.3rem;
    }
    
    .navbar .container {
        padding: 15px;
    }
    
    .nav-toggle {
        display: block;
        z-index: 1001;
    }
    
    .nav-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }
    
    .nav-toggle.active span:nth-child(2) {
        opacity: 0;
    }
    
    .nav-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(7px, -6px);
    }
    
    .nav-menu {
        position: fixed;
        top: 0;
        right: -100%;
        width: 80%;
        max-width: 300px;
        height: 100vh;
        background: white;
        flex-direction: column;
        align-items: flex-start;
        padding: 80px 30px 30px;
        box-shadow: -5px 0 20px rgba(0, 0, 0, 0.1);
        transition: right 0.3s ease;
        z-index: 1000;
    }
    
    .nav-menu.active {
        right: 0;
    }
    
    .nav-link {
        font-size: 1.1rem;
        padding: 15px 0;
    }
    
    .nav-button {
        margin-top: 20px;
    }
    
    .hero {
        height: 60vh;
        min-height: 400px;
        margin-top: 70px;
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-subtitle {
        font-size: 1.1rem;
    }
    
    .hero-buttons {
        flex-direction: column;
        gap: 15px;
    }
    
    .hero-buttons .btn {
        width: 100%;
        justify-content: center;
    }
    
    .page-header {
        padding: 100px 0 40px;
        margin-top: 70px;
    }
    
    .page-title {
        font-size: 2rem;
    }
    
    .section {
        padding: 60px 0;
    }
    
    .services-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .paket-preview-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .paket-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .contact-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .hours-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .faq-grid {
        grid-template-columns: 1fr;
    }
    
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .footer-col:first-child {
        order: -1;
    }
    
    .modal-container {
        max-height: 80vh;
        margin: 20px;
    }
    
    .modal-content {
        padding: 20px;
    }
    
    .modal-details {
        grid-template-columns: 1fr;
    }
    
    .facility-list {
        grid-template-columns: 1fr;
    }
    
    .cta-buttons {
        flex-direction: column;
        gap: 15px;
    }
    
    .cta-buttons .btn {
        width: 100%;
        justify-content: center;
    }
    
    .marquee-track {
        animation: marquee 20s linear infinite;
    }
    
    .whatsapp-float {
        bottom: 20px;
        right: 20px;
        padding: 12px 15px;
        font-size: 0.9rem;
    }
    
    .whatsapp-float svg {
        width: 24px;
        height: 24px;
    }
    
    .profil-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .stat-item {
        padding: 15px;
    }
    
    .stat-number {
        font-size: 1.5rem;
    }
    
    .visi-card {
        padding: 30px 20px;
    }
    
    .misi-card {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }
    
    .nilai-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .nilai-card {
        padding: 20px;
    }
    
    .filter-buttons {
        gap: 10px;
    }
    
    .filter-btn {
        padding: 10px 15px;
        font-size: 0.9rem;
    }
    
    .lightbox-content img {
        max-height: 50vh;
    }
    
    .lightbox-nav {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }
    
    .lightbox-prev {
        left: 10px;
    }
    
    .lightbox-next {
        right: 10px;
    }
}

/* Small Mobile (up to 575px) */
@media (max-width: 575px) {
    .container {
        padding: 0 15px;
    }
    
    h1 {
        font-size: 1.8rem;
    }
    
    h2 {
        font-size: 1.4rem;
    }
    
    .hero {
        height: 50vh;
        min-height: 300px;
    }
    
    .hero-title {
        font-size: 1.8rem;
        margin-bottom: 15px;
    }
    
    .hero-subtitle {
        font-size: 1rem;
        margin-bottom: 15px;
    }
    
    .hero-description {
        font-size: 0.95rem;
        margin-bottom: 20px;
    }
    
    .page-title {
        font-size: 1.8rem;
    }
    
    .section-title {
        font-size: 1.4rem;
    }
    
    .section-subtitle {
        font-size: 1rem;
    }
    
    .gallery-grid {
        grid-template-columns: 1fr;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .nilai-grid {
        grid-template-columns: 1fr;
    }
    
    .profil-stats {
        grid-template-columns: 1fr;
    }
    
    .logo-text h1 {
        font-size: 1rem;
    }
    
    .logo-text p {
        font-size: 0.7rem;
    }
    
    .logo img {
        height: 40px;
    }
    
    .btn {
        padding: 10px 20px;
        font-size: 0.9rem;
    }
    
    .btn-large {
        padding: 12px 24px;
        font-size: 1rem;
    }
    
    .service-card {
        padding: 20px;
    }
    
    .paket-preview-content {
        padding: 15px;
    }
    
    .paket-card-content {
        padding: 15px;
    }
    
    .footer {
        padding: 40px 0 20px;
    }
    
    .footer-logo img {
        height: 40px;
    }
    
    .contact-card {
        padding: 25px;
    }
    
    .hours-card {
        padding: 20px;
    }
    
    .modal-container {
        margin: 10px;
        border-radius: 8px;
    }
    
    .modal-content {
        padding: 15px;
    }
    
    .modal-main-image {
        height: 200px;
    }
    
    .modal-title {
        font-size: 1.4rem;
    }
    
    .whatsapp-float span {
        display: none;
    }
    
    .whatsapp-float {
        padding: 12px;
        border-radius: 50%;
        width: 56px;
        height: 56px;
        justify-content: center;
    }
    
    .nav-menu {
        width: 100%;
        max-width: none;
    }
    
    .partner-logo {
        width: 120px;
        height: 60px;
    }
    
    @keyframes marquee {
        0% {
            transform: translateX(0);
        }
        100% {
            transform: translateX(calc(-120px * 8 - 50px * 7));
        }
    }
    
    .form-group input,
    .form-group select,
    .form-group textarea {
        padding: 12px;
        font-size: 0.95rem;
    }
    
    .term-item h3 {
        font-size: 1.1rem;
    }
    
    .term-item li {
        font-size: 0.9rem;
    }
    
    .faq-question {
        padding: 15px;
        font-size: 0.95rem;
    }
    
    .faq-answer p {
        padding: 15px 0;
        font-size: 0.9rem;
    }
}

/* Touch Device Optimizations */
@media (hover: none) and (pointer: coarse) {
    .hover-lift:hover,
    .hover-scale:hover,
    .card-reveal:hover::before,
    .service-card:hover,
    .paket-card:hover,
    .paket-preview-card:hover,
    .nilai-card:hover,
    .contact-card:hover,
    .hours-card:hover,
    .stat-card:hover,
    .unit-card:hover,
    .misi-card:hover {
        transform: none;
    }
    
    .gallery-item:hover img,
    .paket-card:hover .paket-card-image img,
    .unit-card:hover .unit-image img,
    .paket-preview-card:hover .paket-preview-image img {
        transform: none;
    }
    
    .service-card:hover,
    .paket-card:hover,
    .paket-preview-card:hover,
    .nilai-card:hover,
    .contact-card:hover,
    .hours-card:hover,
    .stat-card:hover,
    .unit-card:hover,
    .misi-card:hover {
        box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
    }
    
    .gallery-item:hover {
        box-shadow: none;
    }
    
    .gallery-item:hover .gallery-item-overlay {
        transform: translateY(100%);
    }
    
    .btn-hover-effect:hover::before {
        width: 0;
        height: 0;
    }
    
    .nav-link:hover::after {
        width: 0;
    }
    
    .filter-btn:hover {
        transform: none;
    }
    
    .nav-button:hover,
    .whatsapp-float:hover,
    .btn:hover,
    .footer-social a:hover {
        transform: none;
    }
}

/* High Resolution Displays */
@media (min-width: 1400px) {
    .container {
        max-width: 1320px;
    }
}

@media (min-width: 1600px) {
    .container {
        max-width: 1500px;
    }
}

/* Print Styles */
@media print {
    .navbar,
    .whatsapp-float,
    .hero,
    .cta,
    .footer {
        display: none !important;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.5;
    }
    
    .container {
        max-width: 100%;
        padding: 0;
    }
    
    a {
        color: #000;
        text-decoration: underline;
    }
    
    .section {
        padding: 20px 0;
        break-inside: avoid;
    }
    
    .page-header {
        padding: 50px 0;
        margin-top: 0;
    }
    
    .btn {
        display: none;
    }
}

/* 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;
    }
    
    .fade-in,
    .slide-up,
    .slide-left,
    .slide-right,
    .scale-up,
    .stagger-item,
    .marquee-track,
    .spinner,
    .pulse,
    .shake,
    .bounce-subtle,
    .text-gradient,
    .float-slow,
    .float-medium,
    .float-fast,
    .attention-pulse,
    .attention-bounce,
    .attention-flash,
    .rotate-slow,
    .rotate-medium,
    .rotate-fast,
    .wave,
    .skeleton,
    .page-transition-logo,
    .ripple-effect,
    .typewriter {
        animation: none !important;
        transition: none !important;
    }
    
    .scroll-trigger {
        opacity: 1;
        transform: none;
    }
    
    .animate-on-scroll {
        opacity: 1;
        transform: none !important;
    }
}

/* Dark Mode Support (for accessibility) */
@media (prefers-color-scheme: dark) {
    body {
        background-color: #ffffff;
        color: #333;
    }
    
    /* Tetap pertahankan white theme sesuai permintaan */
    /* Tapi tambahkan sedikit penyesuaian untuk aksesibilitas */
    
    .navbar {
        background-color: rgba(255, 255, 255, 0.98);
    }
    
    .nav-link {
        color: #333;
    }
    
    .nav-link:hover {
        color: #235abe;
    }
    
    .service-card,
    .paket-card,
    .paket-preview-card,
    .nilai-card,
    .contact-card,
    .hours-card,
    .stat-card,
    .unit-card,
    .misi-card,
    .faq-item,
    .partner-logo,
    .visi-card {
        background: white;
        border-color: #f0f0f0;
    }
    
    .modal-container {
        background: white;
    }
    
    .lightbox {
        background: rgba(0, 0, 0, 0.95);
    }
    
    .footer {
        background-color: #f8f9fa;
    }
}

/* Landscape Mode */
@media (max-height: 600px) and (orientation: landscape) {
    .hero {
        height: 100vh;
        min-height: 400px;
    }
    
    .hero-content {
        padding-top: 50px;
    }
    
    .nav-menu {
        max-height: 80vh;
        overflow-y: auto;
    }
    
    .modal-container {
        max-height: 80vh;
    }
}

/* Very Small Screens */
@media (max-width: 360px) {
    .container {
        padding: 0 10px;
    }
    
    .logo-text h1 {
        font-size: 0.9rem;
    }
    
    .logo img {
        height: 35px;
    }
    
    .hero-title {
        font-size: 1.6rem;
    }
    
    .page-title {
        font-size: 1.6rem;
    }
    
    .btn {
        padding: 8px 16px;
        font-size: 0.85rem;
    }
    
    .whatsapp-float {
        bottom: 15px;
        right: 15px;
        width: 50px;
        height: 50px;
    }
    
    .whatsapp-float svg {
        width: 20px;
        height: 20px;
    }
}

/* Fix for iOS Safari */
@supports (-webkit-touch-callout: none) {
    .hero {
        height: -webkit-fill-available;
    }
    
    .modal-container {
        max-height: -webkit-fill-available;
    }
}

/* Fix for Firefox */
@-moz-document url-prefix() {
    .navbar {
        backdrop-filter: none;
        background-color: rgba(255, 255, 255, 0.98);
    }
}

/* Loading Optimization */
@media (max-width: 768px) {
    .lazy-load {
        opacity: 0;
        transition: opacity 0.3s ease;
    }
    
    .lazy-load.loaded {
        opacity: 1;
    }
}

/* Performance Optimizations */
.will-change {
    will-change: transform, opacity;
}

/* Accessibility Improvements */
@media (prefers-contrast: high) {
    .btn-primary,
    .btn-secondary {
        border: 2px solid #000;
    }
    
    .nav-link.active {
        font-weight: 700;
    }
}

@media (prefers-contrast: more) {
    * {
        color-scheme: light;
    }
}

/* Custom Scrollbar */
@media (min-width: 768px) {
    ::-webkit-scrollbar {
        width: 10px;
    }
    
    ::-webkit-scrollbar-track {
        background: #f1f1f1;
        border-radius: 5px;
    }
    
    ::-webkit-scrollbar-thumb {
        background: #235abe;
        border-radius: 5px;
    }
    
    ::-webkit-scrollbar-thumb:hover {
        background: #1d4a9d;
    }
}