/*
 * File: mobile.css
 * Versi: 18.0 (Tambah Logo & Nama Aplikasi)
 * Deskripsi: Menambahkan judul aplikasi di atas bilah pencarian mobile.
*/

@media (max-width: 768px) {

    /* ======================================================= */
    /* === PENYESUAIAN GLOBAL & PADDING === */
    /* ======================================================= */
    body {
        padding: 4px 12px; 
        font-size: 14px;
        overflow-x: hidden;
    }

    .main-container {
        padding: 2px;
    }

    /* ======================================================= */
    /* === HEADER: LOGO/NAMA DI ATAS SEARCH BAR === */
    /* ======================================================= */
    
    #tombolTambah,
    #downloadExcelBtn,
    #mapBtn,
    #uploadExcelBtn,
    #maintenanceBtn,
    #trashBtn,
    #userControlBtn,
    #logoutBtn,
    #themeToggle,
    #jenisCount,
    #jaringanCountContainer {
        display: none !important;
    }

    /* PERUBAHAN DI SINI: Menggunakan Flexbox untuk menumpuk item secara vertikal */
    .header-section {
        display: flex;
        flex-direction: column;
        align-items: center; /* Membuat semua item (judul & search bar) ke tengah */
        padding-top: 30px;
        margin-bottom: 10px;
    }

    /* ATURAN BARU: Membuat blok judul dengan pseudo-element */
    .header-section::before {
        content: 'CoreLink'; /* Teks nama aplikasi */
        display: block;
        font-size: 1.5em;
        font-weight: 600;
        color: var(--fg);
        
        /* Mengatur logo sebagai background dari teks */
        background-image: url(../icon.png); /* Sesuaikan path jika perlu */
        background-repeat: no-repeat;
        background-size: contain; /* Ukuran logo menyesuaikan tinggi elemen */
        background-position: left center;

        /* Memberi ruang di kiri untuk logo */
        padding-left: 32px; 
        
        /* Mengatur tinggi elemen untuk mengontrol ukuran logo */
        height: 28px;
        line-height: 28px; /* Menengahkan teks secara vertikal */
        
        /* Memberi jarak ke bilah pencarian di bawahnya */
        margin-bottom: 15px;
    }
    
    .header-section .right-content {
        width: 100%;
        margin: 0;
    }

    .header-section #search {
        box-sizing: border-box;
        -webkit-appearance: none;
        appearance: none;
        width: 100%;
        max-width: none;
        margin: 0;
        padding-top: 8px;
        padding-bottom: 8px;
        font-size: 14px;
        border: 1px solid var(--border);
        border-radius: 8px; 
    }
    
    .header-section > div {
        display: contents;
    }
    
    /* ======================================================= */
    /* === TRANSFORMASI TABEL MENJADI KARTU (TETAP SAMA) === */
    /* ======================================================= */
    .table-container {
        height: 70vh;
        overflow-y: auto;
        resize: vertical;
        scroll-snap-type: y mandatory;
    }

    #tabel thead {
        display: none;
    }

    #tabel tr {
        display: block;
        padding: 5px 5px 12px 5px;
        margin-bottom: 12px;
        border: none;
        border-bottom: 10px solid var(--border);
        border-radius: 0;
        box-shadow: none;
        scroll-snap-align: start;
    }

    #tabel td {
        display: block;
        width: 100%;
        text-align: right;
        padding: 4px 2px;
        border-bottom: 1px dashed var(--border);
        position: relative;
    }

    #tabel td:last-child {
        border-bottom: none;
    }
    
    #tabel td:nth-of-type(1),
    #tabel td:nth-of-type(3) {
        display: none;
    }

    #tabel td::before {
        content: attr(data-label);
        float: left;
        font-weight: 600;
        text-align: left;
        color: var(--fg);
        margin-right: 5px;
    }

    /* Label untuk kolom yang tersisa di tampilan kartu */
    #tabel td:nth-of-type(2)::before { content: "Segmentasi:"; }
    #tabel td:nth-of-type(4)::before { content: "Link A:"; }
    #tabel td:nth-of-type(5)::before { content: "Link B:"; }
    #tabel td:nth-of-type(6)::before { content: "Data Core:"; }
    #tabel td:nth-of-type(7)::before { content: "Tanggal:"; }
    #tabel td:nth-of-type(8)::before { content: "Teknisi:"; }
    #tabel td:nth-of-type(9)::before { content: "Jenis:"; }
    #tabel td:nth-of-type(10) { display: none; }

    /* ======================================================= */
    /* === MODAL & ELEMEN LAIN (TIDAK BERUBAH) === */
    /* ======================================================= */
    .modal-content {
        width: calc(100% - 10px);
        max-width: calc(100% - 10px);
        padding: 10px 8px;
        max-height: 90vh;
    }
    
    .btn-row {
        flex-direction: column;
        gap: 5px;
    }

    .btn-row button {
        width: 100%;
        margin: 0;
    }

    .input-group {
        flex-direction: column;
        align-items: stretch;
        border: none;
        background: transparent;
        box-shadow: none;
        padding: 0;
        width: 100%;
        gap: 5px;
    }

    .input-group input, .input-group button {
        width: 100%;
        margin: 2px 0;
    }

    .maintenance-container {
        grid-template-columns: 1fr;
    }

    .button-container {
        flex-direction: column;
        padding: 5px;
    }
    .button-container .search-form,
    .button-container .map-button,
    .button-container #clusterFilter {
        width: 100%;
        max-width: 100%;
    }

    .login-card {
        width: 90%;
        padding: 2rem 1.5rem;
    }
    #notificationContainer {
        right: auto; 
        left: 50%;
        transform: translateX(-50%);
        width: 90%;
        max-width: 400px;
    }
}