/* ==================== MOBILE RESPONSIVE STYLESHEET ==================== */
/* Desain khusus tampilan HP (max-width: 767px) */
/* Semua styling di sini HANYA berlaku untuk HP, desktop tidak terpengaruh */

@media (max-width: 767px) {
    /* ==================== GENERAL MOBILE STYLES ==================== */
    :root {
        --border-radius: 10px;
        --shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
        --shadow-lg: 0 6px 12px rgba(0, 0, 0, 0.12);
    }

    html, body {
        font-size: 14px;
    }

    /* ==================== IMAGES & MEDIA ==================== */
    img {
        max-width: 100%;
        height: auto;
        display: block;
    }

    /* ==================== SPACING UTILITIES ==================== */
    .container, .max-width-container {
        max-width: 100%;
        padding-left: 1rem;
        padding-right: 1rem;
    }

    section {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }

    /* ==================== TEXT SIZING FOR MOBILE ==================== */
    h1 {
        font-size: 1.75rem !important;
        line-height: 1.2;
    }

    h2 {
        font-size: 1.4rem !important;
        line-height: 1.3;
    }

    h3 {
        font-size: 1.15rem !important;
        line-height: 1.3;
    }

    h4 {
        font-size: 1rem !important;
    }

    p {
        font-size: 0.95rem !important;
        line-height: 1.6;
    }

    small {
        font-size: 0.8rem !important;
    }

    /* ==================== BUTTONS ==================== */
    .btn, button, input[type="button"], input[type="submit"] {
        padding: 10px 16px !important;
        font-size: 0.9rem !important;
        border-radius: 10px !important;
        min-height: 44px;
        min-width: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
    }

    .btn-sm, button.sm {
        padding: 8px 12px !important;
        font-size: 0.85rem !important;
        min-height: auto;
    }

    .btn-large, button.large {
        padding: 12px 20px !important;
        font-size: 1rem !important;
    }

    /* ==================== FORMS ==================== */
    input, textarea, select {
        min-height: 44px;
        padding: 12px 14px !important;
        font-size: 16px !important; /* Prevents zoom on iOS */
        border-radius: 10px !important;
        border: 1px solid #d1d5db !important;
    }

    textarea {
        min-height: 100px;
    }

    label {
        display: block;
        margin-bottom: 8px;
        font-weight: 600;
        font-size: 0.95rem;
    }

    .form-group {
        margin-bottom: 16px;
    }

    /* ==================== TABLES ==================== */
    table {
        font-size: 0.85rem;
        border-collapse: collapse;
        width: 100%;
    }

    table th, table td {
        padding: 10px 8px !important;
        border-bottom: 1px solid #e5e7eb;
        text-align: left;
    }

    table th {
        background-color: #f9fafb;
        font-weight: 700;
        font-size: 0.8rem;
    }

    /* Horizontal scroll untuk tabel yang terlalu lebar */
    .table-responsive {
        overflow-x: auto;
        border-radius: 10px;
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
    }

    table {
        min-width: 100%;
    }

    /* ==================== CARDS ==================== */
    .card, .panel {
        border-radius: 12px !important;
        padding: 16px !important;
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08) !important;
    }

    /* ==================== GRIDS ==================== */
    .grid {
        display: grid;
        gap: 12px;
    }

    .grid-2 {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    .grid-3 {
        grid-template-columns: 1fr !important; /* Stack to 1 column on mobile */
    }

    /* ==================== MODALS & DIALOGS ==================== */
    .modal, .dialog {
        border-radius: 16px !important;
        max-height: 90vh !important;
        overflow-y: auto;
        padding: 16px !important;
    }

    .modal-header, .dialog-header {
        margin-bottom: 16px;
    }

    .modal-body, .dialog-body {
        padding: 0 !important;
    }

    /* ==================== DROPDOWNS & SELECTS ==================== */
    select {
        appearance: none;
        background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
        background-repeat: no-repeat;
        background-position: right 10px center;
        background-size: 20px;
        padding-right: 36px !important;
    }

    /* ==================== PAGINATION ==================== */
    .pagination {
        display: flex;
        justify-content: center;
        gap: 6px;
        margin: 20px 0;
        flex-wrap: wrap;
    }

    .pagination a, .pagination button {
        padding: 8px 12px;
        border: 1px solid #d1d5db;
        border-radius: 8px;
        text-decoration: none;
        cursor: pointer;
        font-size: 0.85rem;
        min-width: 36px;
        text-align: center;
    }

    .pagination .active {
        background-color: #0052CC;
        color: white;
        border-color: #0052CC;
    }

    /* ==================== ALERTS & NOTIFICATIONS ==================== */
    .alert, .notification, .message {
        padding: 12px 14px !important;
        border-radius: 10px !important;
        margin-bottom: 12px;
        font-size: 0.9rem;
        border-left: 4px solid;
    }

    .alert-success {
        background-color: #ecfdf5;
        border-left-color: #10b981;
        color: #065f46;
    }

    .alert-error, .alert-danger {
        background-color: #fee2e2;
        border-left-color: #ef4444;
        color: #991b1b;
    }

    .alert-warning {
        background-color: #fffbeb;
        border-left-color: #f59e0b;
        color: #92400e;
    }

    .alert-info {
        background-color: #eff6ff;
        border-left-color: #3b82f6;
        color: #0c4a6e;
    }

    /* ==================== BADGES & LABELS ==================== */
    .badge, .label, .tag {
        display: inline-flex;
        align-items: center;
        padding: 6px 10px;
        border-radius: 999px;
        font-size: 0.75rem;
        font-weight: 700;
    }

    /* ==================== LINKS ==================== */
    a {
        color: #0052CC;
        text-decoration: none;
        transition: color 0.2s ease;
    }

    a:active {
        opacity: 0.7;
    }

    /* ==================== OVERFLOW & SCROLLING ==================== */
    .overflow-auto, .overflow-x-auto, .overflow-y-auto {
        -webkit-overflow-scrolling: touch;
    }

    /* Prevent content from flowing outside screen */
    * {
        max-width: 100vw;
    }

    /* ==================== TOUCH-FRIENDLY SPACING ==================== */
    .touch-target {
        min-height: 44px;
        min-width: 44px;
    }

    /* ==================== TYPOGRAPHY ADJUSTMENTS ==================== */
    .text-center { text-align: center; }
    .text-left { text-align: left; }
    .text-right { text-align: right; }

    /* ==================== VISIBILITY ==================== */
    .mobile-hidden {
        display: none !important;
    }

    .mobile-visible {
        display: block !important;
    }

    /* ==================== RESPONSIVE COLUMNS ==================== */
    [class*="col-"] {
        width: 100% !important;
    }

    .row {
        display: flex;
        flex-wrap: wrap;
        gap: 12px;
    }

    .row > * {
        flex: 1 1 calc(50% - 6px);
        min-width: 0;
    }

    /* ==================== DISPLAY & FLEX ==================== */
    .flex {
        display: flex;
    }

    .flex-col {
        flex-direction: column;
    }

    .flex-wrap {
        flex-wrap: wrap;
    }

    .gap-1 { gap: 8px; }
    .gap-2 { gap: 12px; }
    .gap-3 { gap: 16px; }
    .gap-4 { gap: 20px; }

    /* ==================== MARGIN & PADDING UTILITIES ==================== */
    .m-0 { margin: 0 !important; }
    .m-1 { margin: 8px !important; }
    .m-2 { margin: 12px !important; }
    .m-3 { margin: 16px !important; }

    .p-0 { padding: 0 !important; }
    .p-1 { padding: 8px !important; }
    .p-2 { padding: 12px !important; }
    .p-3 { padding: 16px !important; }

    .mb-0 { margin-bottom: 0 !important; }
    .mb-1 { margin-bottom: 8px !important; }
    .mb-2 { margin-bottom: 12px !important; }
    .mb-3 { margin-bottom: 16px !important; }

    .mt-0 { margin-top: 0 !important; }
    .mt-1 { margin-top: 8px !important; }
    .mt-2 { margin-top: 12px !important; }
    .mt-3 { margin-top: 16px !important; }

    /* ==================== BORDER RADIUS ==================== */
    .rounded { border-radius: 10px !important; }
    .rounded-lg { border-radius: 12px !important; }
    .rounded-xl { border-radius: 16px !important; }
    .rounded-full { border-radius: 999px !important; }

    /* ==================== SHADOWS ==================== */
    .shadow { box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08) !important; }
    .shadow-lg { box-shadow: 0 6px 12px rgba(0, 0, 0, 0.12) !important; }
    .shadow-xl { box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15) !important; }

    /* ==================== BACKGROUND COLORS ==================== */
    .bg-white { background-color: #ffffff !important; }
    .bg-gray-50 { background-color: #f9fafb !important; }
    .bg-blue-50 { background-color: #eff6ff !important; }

    /* ==================== DISPLAY UTILS ==================== */
    .inline { display: inline !important; }
    .inline-block { display: inline-block !important; }
    .block { display: block !important; }
    .hidden { display: none !important; }

    /* ==================== SEARCH & FILTER ==================== */
    .search-form, .filter-form {
        display: flex;
        flex-direction: column;
        gap: 12px;
    }

    .search-input, .filter-input, .filter-select {
        width: 100%;
        padding: 12px;
        font-size: 16px;
        border-radius: 10px;
        border: 1px solid #d1d5db;
    }

    /* ==================== HEADER & FOOTER MOBILE ==================== */
    header {
        padding: 1rem;
    }

    footer {
        padding: 1.5rem 1rem;
    }

    /* ==================== RESPONSIVE IMAGES ==================== */
    img.responsive {
        max-width: 100%;
        height: auto;
        display: block;
    }

    .image-container {
        overflow: hidden;
        border-radius: 10px;
    }

    /* ==================== LOADING STATE ==================== */
    .loading {
        opacity: 0.6;
        pointer-events: none;
    }

    /* ==================== BREAKPOINT SPECIFIC ==================== */
    @media (max-width: 480px) {
        html, body {
            font-size: 13px;
        }

        h1 {
            font-size: 1.5rem !important;
        }

        h2 {
            font-size: 1.25rem !important;
        }

        h3 {
            font-size: 1.05rem !important;
        }

        .container, .max-width-container {
            padding-left: 0.75rem;
            padding-right: 0.75rem;
        }

        section {
            padding-left: 0.75rem !important;
            padding-right: 0.75rem !important;
        }

        .grid-2 {
            grid-template-columns: 1fr !important;
        }

        .row > * {
            flex: 1 1 100%;
        }
    }

    @media (max-width: 374px) {
        html, body {
            font-size: 12px;
        }

        h1 {
            font-size: 1.4rem !important;
        }

        h2 {
            font-size: 1.15rem !important;
        }

        input, textarea, select {
            font-size: 14px !important;
        }

        .btn, button {
            font-size: 0.85rem !important;
            padding: 8px 12px !important;
        }
    }
}
