/* Responsive Design for All Pages */

/* Mobile First Approach */
@media (max-width: 576px) {
    /* Typography */
    h1, .h1 { font-size: 1.8rem !important; }
    h2, .h2 { font-size: 1.5rem !important; }
    h3, .h3 { font-size: 1.3rem !important; }
    h4, .h4 { font-size: 1.1rem !important; }
    h5, .h5 { font-size: 1rem !important; }
    h6, .h6 { font-size: 0.9rem !important; }
    
    /* Buttons */
    .btn {
        padding: 0.7rem 1.2rem !important;
        font-size: 0.9rem !important;
    }
    
    .btn-lg {
        padding: 0.8rem 1.5rem !important;
        font-size: 1rem !important;
    }
    
    /* Cards */
    .card {
        margin-bottom: 1rem;
    }
    
    .card-body {
        padding: 1rem 0.8rem !important;
    }
    
    /* Forms */
    .form-control {
        font-size: 0.9rem !important;
        padding: 0.7rem 0.8rem !important;
    }
    
    .form-label {
        font-size: 0.9rem !important;
    }
    
    /* Tables */
    .table {
        font-size: 0.8rem !important;
    }
    
    .table-responsive {
        font-size: 0.8rem !important;
    }
    
    /* Navigation */
    .btn-header {
        text-decoration: none;
        color: #fff;
        font-weight: 600;
        padding: 0.5rem 1rem;
        border-radius: 0.5rem;
        transition: all 0.3s ease;
    }
    
    .btn-header:hover {
        color: #ffd700;
    }
    
    .btn-header.active {
        color: #ffd700;
        font-weight: 700;
        text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
    }
    
    /* Navigation */
    .navbar-brand {
        font-size: 1.2rem !important;
    }
    
    .navbar-nav .nav-link {
        font-size: 0.9rem !important;
        padding: 0.5rem 0.8rem !important;
    }
    
    /* Containers */
    .container {
        padding-left: 0.5rem !important;
        padding-right: 0.5rem !important;
    }
    
    /* Spacing */
    .my-5 { margin-top: 1.5rem !important; margin-bottom: 1.5rem !important; }
    .py-5 { padding-top: 1.5rem !important; padding-bottom: 1.5rem !important; }
    .mt-5 { margin-top: 1.5rem !important; }
    .mb-5 { margin-bottom: 1.5rem !important; }
    .pt-5 { padding-top: 1.5rem !important; }
    .pb-5 { padding-bottom: 1.5rem !important; }
}

/* Tablet */
@media (min-width: 577px) and (max-width: 767px) {
    h1, .h1 { font-size: 2.2rem !important; }
    h2, .h2 { font-size: 1.8rem !important; }
    h3, .h3 { font-size: 1.5rem !important; }
    h4, .h4 { font-size: 1.3rem !important; }
    h5, .h5 { font-size: 1.1rem !important; }
    h6, .h6 { font-size: 1rem !important; }
    
    .btn {
        padding: 0.8rem 1.5rem !important;
        font-size: 1rem !important;
    }
    
    .container {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }
}

/* Small Desktop */
@media (min-width: 768px) and (max-width: 991px) {
    h1, .h1 { font-size: 2.8rem !important; }
    h2, .h2 { font-size: 2.2rem !important; }
    h3, .h3 { font-size: 1.8rem !important; }
    h4, .h4 { font-size: 1.5rem !important; }
    h5, .h5 { font-size: 1.3rem !important; }
    h6, .h6 { font-size: 1.1rem !important; }
}

/* Large Desktop */
@media (min-width: 992px) {
    h1, .h1 { font-size: 3.2rem !important; }
    h2, .h2 { font-size: 2.5rem !important; }
    h3, .h3 { font-size: 2rem !important; }
    h4, .h4 { font-size: 1.7rem !important; }
    h5, .h5 { font-size: 1.4rem !important; }
    h6, .h6 { font-size: 1.2rem !important; }
}

/* Form Responsive */
@media (max-width: 767px) {
    .form-row {
        flex-direction: column;
    }
    
    .form-row > * {
        margin-bottom: 1rem;
    }
    
    .form-check {
        margin-bottom: 0.5rem;
    }
}

/* Table Responsive */
@media (max-width: 767px) {
    .table-responsive {
        border: 0;
    }
    
    .table-responsive .table {
        border: 0;
    }
    
    .table-responsive .table thead {
        display: none;
    }
    
    .table-responsive .table tbody tr {
        display: block;
        margin-bottom: 1rem;
        border: 1px solid #dee2e6;
        border-radius: 0.375rem;
        padding: 0.5rem;
    }
    
    .table-responsive .table tbody td {
        display: block;
        text-align: right;
        padding: 0.5rem;
        border: none;
    }
    
    .table-responsive .table tbody td::before {
        content: attr(data-label) ": ";
        font-weight: bold;
        float: left;
    }
}

/* Navigation Responsive */
@media (max-width: 767px) {
    .navbar-collapse {
        background: rgba(255,255,255,0.95);
        border-radius: 0.5rem;
        margin-top: 0.5rem;
        padding: 1rem;
    }
    
    .navbar-nav {
        text-align: center;
    }
    
    .navbar-nav .nav-link {
        border-bottom: 1px solid #eee;
        padding: 0.8rem 0 !important;
    }
    
    .navbar-nav .nav-link:last-child {
        border-bottom: none;
    }
}

/* Modal Responsive */
@media (max-width: 767px) {
    .modal-dialog {
        margin: 0.5rem;
        max-width: calc(100% - 1rem);
    }
    
    .modal-content {
        border-radius: 0.5rem;
    }
    
    .modal-header {
        padding: 1rem;
    }
    
    .modal-body {
        padding: 1rem;
    }
    
    .modal-footer {
        padding: 1rem;
    }
}

/* Image Responsive */
@media (max-width: 767px) {
    img {
        max-width: 100%;
        height: auto;
    }
    
    .img-fluid {
        width: 100%;
    }
}

/* Grid System Enhancement */
@media (max-width: 767px) {
    .row > * {
        margin-bottom: 1rem;
    }
    
    .col-md-6,
    .col-lg-4,
    .col-lg-6 {
        margin-bottom: 1rem;
    }
}

/* Utility Classes for Mobile */
@media (max-width: 767px) {
    .d-mobile-none {
        display: none !important;
    }
    
    .d-mobile-block {
        display: block !important;
    }
    
    .text-mobile-center {
        text-align: center !important;
    }
    
    .text-mobile-left {
        text-align: left !important;
    }
    
    .text-mobile-right {
        text-align: right !important;
    }
}

/* Touch-friendly elements */
@media (max-width: 767px) {
    .btn,
    .nav-link,
    .form-control,
    .dropdown-item {
        min-height: 44px;
        display: flex;
        align-items: center;
    }
    
    .btn {
        justify-content: center;
    }
}

/* Landscape orientation for mobile */
@media (max-width: 767px) and (orientation: landscape) {
    .hero {
        padding: 1rem 0 !important;
    }
    
    .hero h1 {
        font-size: 1.5rem !important;
    }
    
    .hero .lead {
        font-size: 0.9rem !important;
    }
}

/* High DPI displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .btn,
    .form-control,
    .card {
        border-width: 0.5px;
    }
}

/* Print styles */
@media print {
    .no-print {
        display: none !important;
    }
    
    .container {
        max-width: 100% !important;
        width: 100% !important;
    }
    
    .table {
        font-size: 0.8rem !important;
    }
}

/* Specific styles for form_booking.php */
@media (max-width: 767px) {
    .form-booking-card {
        padding: 1rem;
        margin-top: 1rem !important;
    }

    .form-booking-card .card-title {
        font-size: 1.5rem;
        text-align: center;
    }

    .form-booking-card .form-label {
        font-size: 0.95rem;
    }

    .form-booking-card .form-control,
    .form-booking-card .form-select {
        font-size: 1rem;
    }

    .form-booking-card .btn {
        font-size: 1rem;
        padding: 0.8rem;
    }

    .jadwal-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 0.5rem;
    }

    .jadwal-radio label {
        padding: 0.6rem 0.5rem;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .jadwal-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Invoice responsive adjustments */
@media (max-width: 600px) {
    .invoice-box {
        margin: 1rem auto;
        border-radius: 0;
    }

    .invoice-header, .invoice-section, .invoice-footer {
        padding: 1.2rem 1rem !important;
    }

    .invoice-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .invoice-header .info {
        text-align: left;
        width: 100%;
    }

    .section-flex {
        flex-direction: column;
        gap: 1rem;
    }

    .invoice-actions {
        flex-direction: column;
    }

    .invoice-actions .btn-invoice,
    .invoice-actions .btn-back {
        width: 100%;
        text-align: center;
    }
}