/* assets/css/index-style.css */

/* Base Styles */
body {
    background-color: #f0f2f5; /* Latar belakang lebih lembut */
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    font-family: 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif; /* Font modern */
    transition: background-color 0.3s ease, color 0.3s ease;
    padding: 20px; /* Padding global untuk mencegah konten menempel tepi */
    box-sizing: border-box; /* Pastikan padding tidak menambah lebar elemen */
}

/* Main Container - Card Wrapper */
.main-container {
    background-color: #ffffff;
    padding: 35px; /* Padding di dalam container */
    border-radius: 12px; /* Sudut lebih membulat */
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1); /* Bayangan lebih halus dan dalam */
    width: 100%;
    max-width: 1100px; /* Lebar maksimum yang lebih besar */
    display: flex;
    flex-wrap: wrap; /* Memungkinkan wrap di layar kecil */
    gap: 30px; /* Jarak antara panel */
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid rgba(0, 0, 0, 0.05); /* Border tipis */
    overflow: hidden; /* Penting untuk pseudo-element */
    position: relative; /* Untuk positioning absolute elemen lain jika dibutuhkan */
}

.main-container::before { /* Elemen pseudo untuk garis di atas */
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 6px; /* Tinggi garis */
    background: linear-gradient(to right, #007bff, #0056b3); /* Gradasi biru */
    border-top-left-radius: 12px;
    border-top-right-radius: 12px;
}

/* Left Panel - Welcome Section */
.left-panel {
    flex: 1.2; /* Berikan lebih banyak ruang untuk panel kiri */
    padding: 30px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    min-width: 300px; /* Jaga ukuran minimum */
    /* background-color: #fcfcfc; /* Warna latar belakang sedikit berbeda */
    border-radius: 8px; /* Sudut membulat */
}

.left-panel img {
    max-width: 180px; /* Logo sedikit lebih besar */
    height: auto;
    margin-bottom: 30px; /* Jarak dengan judul */
    filter: drop-shadow(0 5px 8px rgba(0,0,0,0.1)); /* Efek bayangan pada logo */
}

.left-panel h1 {
    font-weight: 700; /* Lebih tebal */
    color: #343a40; /* Warna judul lebih gelap */
    margin-bottom: 15px;
    font-size: 2.2rem; /* Ukuran font lebih besar */
    line-height: 1.3;
    transition: color 0.3s ease;
}

.left-panel p {
    color: #6c757d; /* Warna teks deskripsi */
    line-height: 1.7;
    font-size: 1rem; /* Ukuran font standar */
    max-width: 500px; /* Batasi lebar teks agar tidak terlalu panjang */
    transition: color 0.3s ease;
}

/* Right Panel - Search Form */
.right-panel {
    flex: 1; /* Ambil sisa ruang */
    padding: 30px;
    border-left: 1px solid #e9ecef; /* Border pemisah yang lebih halus */
    display: flex;
    flex-direction: column;
    min-width: 380px; /* Jaga ukuran minimum form */
    transition: border-color 0.3s ease;
}

.right-panel h4 {
    color: #343a40;
    font-weight: 600;
    font-size: 1.6rem; /* Ukuran judul form */
    margin-bottom: 25px;
    transition: color 0.3s ease;
}

.form-label {
    font-weight: 600;
    color: #495057;
    margin-bottom: 8px;
    transition: color 0.3s ease;
}

.form-control {
    border: 1px solid #ced4da;
    border-radius: 8px; /* Sudut input yang lebih modern */
    padding: 12px 15px;
    font-size: 1rem;
    color: #495057;
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-control::placeholder {
    color: #888;
    opacity: 0.7;
}

.form-control:focus {
    border-color: #80bdff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
    outline: none;
}

.btn-secondary {
    background-color: #6c757d; /* Warna abu-abu yang lebih modern */
    border-color: #6c757d;
    padding: 12px 20px;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 8px; /* Sudut tombol lebih membulat */
    transition: background-color 0.3s ease, border-color 0.3s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-secondary:hover {
    background-color: #5a6268;
    border-color: #5a6268;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(108, 117, 125, 0.3);
}

.btn-outline-secondary { /* Untuk tombol Reset Pencarian */
    border-color: #6c757d;
    color: #6c757d;
    padding: 12px 20px;
    font-size: 1rem;
    font-weight: 500;
    border-radius: 8px;
    transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease, transform 0.2s ease;
}

.btn-outline-secondary:hover {
    background-color: #6c757d;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(108, 117, 125, 0.3);
}


/* Search Results Card */
.search-results-card {
    background-color: #f8f9fa; /* Latar belakang kartu hasil */
    padding: 25px;
    border-radius: 10px; /* Sudut membulat */
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    margin-top: 30px; /* Jarak dari form */
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.search-results-card h6 {
    color: #28a745; /* Warna hijau untuk pesan sukses */
    font-weight: 600;
    font-size: 1.1rem;
    margin-bottom: 20px;
}

.list-group-item {
    padding: 15px 0; /* Padding vertikal untuk setiap item */
    border-bottom: 1px solid #dee2e6; /* Border bawah setiap item */
    font-size: 0.95rem;
    color: #343a40;
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

.list-group-item:last-child {
    border-bottom: none; /* Hapus border bawah item terakhir */
}

.list-group-item strong {
    display: inline-block;
    min-width: 140px; /* Lebar minimum untuk label */
    color: #495057; /* Warna teks label */
    font-weight: 600;
    transition: color 0.3s ease;
}

.list-group-item a {
    color: #007bff;
    text-decoration: none;
    word-break: break-all; /* Memecah teks URL panjang */
}

.list-group-item a:hover {
    text-decoration: underline;
}

/* Pagination */
.pagination-container {
    margin-top: 25px;
}

.pagination .page-item .page-link {
    border-radius: 8px !important; /* Sudut tombol paginasi */
    margin: 0 4px; /* Jarak antar tombol paginasi */
    min-width: 38px; /* Pastikan ukuran tombol cukup besar */
    text-align: center;
    color: #007bff;
    border-color: #dee2e6;
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

.pagination .page-item .page-link:hover {
    background-color: #e9ecef;
    border-color: #dee2e6;
    color: #0056b3;
}

.pagination .page-item.active .page-link {
    background-color: #007bff;
    border-color: #007bff;
    color: white;
    box-shadow: 0 2px 5px rgba(0, 123, 255, 0.2);
}

.pagination .page-item.active .page-link:hover {
    background-color: #0056b3;
    border-color: #0056b3;
}


/* Links Container (Login / Registrasi) */
.links-container {
    text-align: center;
    margin-top: 30px;
    font-size: 0.95rem;
}

.links-container a {
    margin: 0 12px;
    color: #007bff;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.links-container a:hover {
    color: #0056b3;
    text-decoration: underline;
}


/* Theme Toggle Button (Global, copied from login-style for consistency) */
.theme-toggle-container {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 1000;
}

.theme-toggle-button {
    background-color: #6c757d; /* Warna abu-abu yang netral */
    color: white;
    border: none;
    padding: 10px 15px; /* Padding sedikit lebih besar */
    border-radius: 8px; /* Lebih membulat */
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px; /* Jarak antara ikon dan teks */
    font-size: 1rem; /* Ukuran font lebih besar */
    font-weight: 500;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1); /* Bayangan tipis */
    transition: background-color 0.3s ease, box-shadow 0.3s ease, transform 0.2s ease;
}

.theme-toggle-button:hover {
    background-color: #5a6268; /* Warna abu-abu lebih gelap saat hover */
    transform: translateY(-1px); /* Efek naik kecil */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

/* ============================================== */
/* DARK MODE ADJUSTMENTS FOR INDEX PAGE           */
/* ============================================== */

body.dark-mode {
    background-color: #2c3e50; /* Latar belakang gelap */
    color: #ecf0f1; /* Warna teks terang */
}

body.dark-mode .main-container {
    background-color: #34495e; /* Latar belakang container gelap */
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    border-color: rgba(255, 255, 255, 0.1);
}

body.dark-mode .main-container::before {
    background: linear-gradient(to right, #00aced, #0084b4); /* Gradasi biru dark mode */
}

body.dark-mode .left-panel h1,
body.dark-mode .right-panel h4 {
    color: #ecf0f1; /* Warna judul terang */
}

body.dark-mode .left-panel p {
    color: #abb3bb; /* Warna deskripsi terang */
}

body.dark-mode .right-panel {
    border-left-color: #45627f; /* Border pemisah dark mode */
}

body.dark-mode .form-label {
    color: #bdc3c7; /* Warna label terang */
}

body.dark-mode .form-control {
    background-color: #45627f;
    border-color: #5f7a9a;
    color: #ecf0f1;
}

body.dark-mode .form-control::placeholder {
    color: #a0a6aa;
}

body.dark-mode .form-control:focus {
    border-color: #00aced;
    box-shadow: 0 0 0 0.2rem rgba(0, 172, 237, 0.25);
}

body.dark-mode .btn-secondary {
    background-color: #5a6268;
    border-color: #5a6268;
}

body.dark-mode .btn-secondary:hover {
    background-color: #495057;
    border-color: #495057;
    box-shadow: 0 4px 10px rgba(89, 96, 102, 0.3);
}

body.dark-mode .btn-outline-secondary {
    border-color: #5a6268;
    color: #abb3bb;
}

body.dark-mode .btn-outline-secondary:hover {
    background-color: #5a6268;
    color: white;
    border-color: #5a6268;
    box-shadow: 0 4px 10px rgba(89, 96, 102, 0.3);
}

body.dark-mode .search-results-card {
    background-color: #3e5872;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

body.dark-mode .search-results-card h6 {
    color: #2ecc71; /* Warna hijau dark mode */
}

body.dark-mode .list-group-item {
    background-color: transparent; /* Transparan agar latar belakang card terlihat */
    border-bottom-color: #4a6582;
    color: #ecf0f1;
}

body.dark-mode .list-group-item strong {
    color: #bdc3c7;
}

body.dark-mode .list-group-item a {
    color: #00aced;
}

body.dark-mode .list-group-item a:hover {
    color: #0084b4;
}

body.dark-mode .pagination .page-item .page-link {
    background-color: #45627f;
    border-color: #5f7a9a;
    color: #ecf0f1;
}

body.dark-mode .pagination .page-item .page-link:hover {
    background-color: #5a7796;
    border-color: #5a7796;
    color: #ecf0f1;
}

body.dark-mode .pagination .page-item.active .page-link {
    background-color: #00aced;
    border-color: #00aced;
    color: white;
}

body.dark-mode .pagination .page-item.active .page-link:hover {
    background-color: #0084b4;
    border-color: #0084b4;
}

body.dark-mode .links-container a {
    color: #00aced;
}

body.dark-mode .links-container a:hover {
    color: #0084b4;
}

body.dark-mode .theme-toggle-button {
    background-color: #5a6268;
    color: white;
}

body.dark-mode .theme-toggle-button:hover {
    background-color: #495057;
}


/* ============================================== */
/* RESPONSIVE ADJUSTMENTS FOR INDEX PAGE          */
/* ============================================== */

@media (max-width: 991.98px) { /* Untuk tablet dan mobile, tata letak dua kolom ke satu kolom */
    .main-container {
        flex-direction: column; /* Ubah tata letak menjadi kolom */
        padding: 25px; /* Kurangi padding di mobile */
        gap: 25px; /* Kurangi jarak antar panel */
        max-width: 600px; /* Batasi lebar di tablet */
        margin-top: 30px; /* Tambahkan margin atas untuk tampilan mobile */
        margin-bottom: 30px; /* Tambahkan margin bawah */
    }

    .left-panel, .right-panel {
        padding: 20px; /* Kurangi padding di panel */
        min-width: unset; /* Hapus min-width agar elemen bisa menyesuaikan */
        width: 100%; /* Ambil lebar penuh */
    }

    .left-panel {
        border-bottom: 1px solid #e9ecef; /* Tambahkan border bawah untuk pemisah */
        padding-bottom: 25px; /* Tambahkan padding bawah */
    }
    
    body.dark-mode .left-panel {
        border-bottom-color: #45627f; /* Border dark mode */
    }

    .right-panel {
        border-left: none; /* Hapus border kiri */
        padding-top: 0; /* Hapus padding atas tambahan */
    }

    .left-panel img {
        max-width: 150px; /* Logo sedikit lebih kecil di mobile */
        margin-bottom: 20px;
    }

    .left-panel h1 {
        font-size: 1.8rem; /* Ukuran judul lebih kecil */
    }

    .left-panel p {
        font-size: 0.9rem; /* Ukuran teks deskripsi lebih kecil */
    }

    .right-panel h4 {
        font-size: 1.4rem; /* Ukuran judul form lebih kecil */
        margin-bottom: 20px;
    }

    .theme-toggle-container {
        top: 15px;
        right: 15px;
    }

    .theme-toggle-button {
        padding: 8px 12px;
        font-size: 0.85rem;
        gap: 6px;
        border-radius: 6px;
    }

    .theme-toggle-button .d-none.d-md-inline {
        display: none !important; /* Pastikan teks "Mode Gelap" disembunyikan di bawah md */
    }
}

@media (max-width: 575.98px) { /* Untuk layar ponsel yang sangat kecil */
    body {
        padding: 10px;
        align-items: flex-start; /* Untuk mencegah konten terlalu tinggi di tengah */
        min-height: auto; /* Izinkan body memanjang jika konten banyak */
    }

    .main-container {
        padding: 20px;
        border-radius: 10px;
        margin-top: 20px;
        margin-bottom: 20px;
    }
    
    .main-container::before {
        height: 4px;
        border-top-left-radius: 10px;
        border-top-right-radius: 10px;
    }

    .left-panel {
        padding: 15px;
    }

    .left-panel img {
        max-width: 120px;
        margin-bottom: 15px;
    }

    .left-panel h1 {
        font-size: 1.6rem;
    }

    .left-panel p {
        font-size: 0.85rem;
    }

    .right-panel {
        padding: 15px;
    }

    .right-panel h4 {
        font-size: 1.2rem;
        margin-bottom: 15px;
    }

    .form-control {
        padding: 10px 12px;
        font-size: 0.95rem;
    }

    .btn-secondary, .btn-outline-secondary {
        padding: 10px 15px;
        font-size: 0.95rem;
    }

    .search-results-card {
        padding: 18px;
        margin-top: 20px;
        border-radius: 8px;
    }
    
    .search-results-card h6 {
        font-size: 1rem;
    }

    .list-group-item {
        font-size: 0.9rem;
        padding: 12px 0;
    }

    .list-group-item strong {
        min-width: 110px; /* Kurangi sedikit min-width untuk label */
    }
    
    .links-container {
        margin-top: 25px;
        font-size: 0.9rem;
    }

    .links-container a {
        margin: 0 8px;
    }

    .pagination .page-item .page-link {
        margin: 0 2px;
        min-width: 32px;
        font-size: 0.9rem;
        border-radius: 6px !important;
    }

    .theme-toggle-container {
        top: 10px;
        right: 10px;
    }

    .theme-toggle-button {
        padding: 6px 10px;
        font-size: 0.8rem;
        border-radius: 5px;
        gap: 5px;
    }
}