* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: Arial, Helvetica, sans-serif;
    background-color: #f7f7f7;
    color: #333;
}

header {
    background-color: #315987;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 78px;
    z-index: 1000;
    overflow: hidden;
}

header img {
    float: left;
    height: 70px;
    width: auto;
    margin-top: 4px;
    margin-left: 12%;
}

.judulweb {
    float: left;
    color: #ffffff;
    font-family: Arial, Helvetica, sans-serif;
    font-weight: bold;
    font-size: 25px;
    text-align: left;
    padding: 25px 0 0 12px;
}

header nav {
    float: right;
    height: 78px;
}

header nav a {
    float: left;
    display: block;
    width: auto;
    height: 78px;

    color: #ffffff;
    font-family: Arial, Helvetica, sans-serif;
    font-weight: normal;
    font-size: 18px;

    text-align: center;
    padding: 29px 20px;

    text-decoration: none;
    line-height: 20px;
}


header nav a:hover {
    background-color: #cccccc;
    color: #000000;
}


header nav a.active {
    background-color: #cccccc;
    color: #000000;
}


main {
    padding-top: 92px;
    width: 75%;
    margin: 0 auto;
    padding-bottom: 40px;
}


main h1 {
    color: #333333;
    font-size: 32px;
    font-weight: bold;
    margin-bottom: 28px;
}

main h2 {
    color: #333333;
    font-size: 26px;
    font-weight: bold;
    margin-bottom: 20px;
}


table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;

    background-color: #ffffff;
    border: 1px solid #d5d5d5;
}

th {
    background-color: #315987;
    color: #ffffff;

    text-align: center;
    font-weight: bold;
    font-size: 20px;

    padding: 15px 12px;

    border: 1px solid #d5d5d5;
}

td {
    border: 1px solid #d5d5d5;

    padding: 14px;

    text-align: center;

    font-size: 18px;

    height: 185px;
}

tr:nth-child(even) td {
    background-color: #ffffff;
}

tr:nth-child(odd) td {
    background-color: #f1f1f1;
}

th:first-child,
td:first-child {
    width: 55px;
}

th:nth-child(2),
td:nth-child(2) {
    width: auto;
}

th:nth-child(3),
td:nth-child(3) {
    width: 170px;
}

th:nth-child(4),
td:nth-child(4) {
    width: 140px;
}


td img {
    width: 110px;
    height: 155px;

    object-fit: cover;

    display: block;
    margin: 0 auto;

    border-radius: 4px;
}


td a {
    color: #0000ee;
    text-decoration: underline;
    font-size: 17px;
}

td a:hover {
    color: #551a8b;
}


form {
    width: 60%;

    background-color: #f2f2f2;

    padding: 20px;
    margin-top: 20px;

    border-radius: 5px;
}

input[type="text"],
input[type="number"],
input[type="date"],
input[type="email"],
input[type="file"],
select,
textarea {
    width: 80%;

    padding: 12px;

    border: 1px solid #cccccc;

    background-color: #ffffff;

    border-radius: 4px;

    font-size: 14px;

    margin-top: 4px;
    margin-bottom: 10px;
}


input[type="submit"],
button[type="submit"] {
    padding: 12px 20px;

    border: none;

    background-color: #315987;

    color: #ffffff;

    border-radius: 4px;

    font-size: 14px;

    cursor: pointer;
}

input[type="submit"]:hover,
button[type="submit"]:hover {
    background-color: #24466c;
    cursor: pointer;
}


label {
    font-weight: normal;

    display: inline-block;

    width: 120px;

    vertical-align: top;

    padding-top: 14px;
}

hr {
    border: none;

    border-top: 1px solid #cccccc;

    margin-top: 30px;
}

address {
    background-color: #292929;

    color: #ffffff;

    text-align: center;

    font-style: normal;

    font-size: 18px;

    padding: 20px;

    margin-top: 0;

    width: 75%;
    margin-left: auto;
    margin-right: auto;
}


/* ===== Halaman Login (page10A.php) ===== */

.login-wrapper {
    max-width: 380px;
    margin: 40px auto 0;
    background-color: #ffffff;
    border: 1px solid #d5d5d5;
    border-radius: 8px;
    padding: 24px 28px;
}

.login-wrapper form {
    width: 100%;
    background: none;
    padding: 0;
    margin-top: 0;
    border-radius: 0;
}

.login-wrapper .form-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}

.login-wrapper .form-row label {
    flex: 0 0 100px;
    width: 100px;
    font-weight: bold;
    padding-top: 0;
    display: block;
    margin-top: 0;
    margin-bottom: 0;
}

.login-wrapper .form-row input[type="text"],
.login-wrapper .form-row input[type="password"] {
    flex: 1 1 auto;
    min-width: 0;
    width: auto;
    box-sizing: border-box;
    padding: 6px 8px;
    border: 1px solid #cccccc;
    border-radius: 4px;
    background-color: #ffffff;
    font-size: 14px;
    margin-top: 0;
    margin-bottom: 0;
}

.login-wrapper input[type="submit"] {
    width: auto;
    margin-top: 8px;
    padding: 10px 22px;
}


@media (max-width: 1200px) {

    header img {
        margin-left: 5%;
    }

    .judulweb {
        font-size: 21px;
    }

    header nav a {
        font-size: 16px;
        padding-left: 12px;
        padding-right: 12px;
    }

    main {
        width: 90%;
    }

    address {
        width: 90%;
    }
}


@media (max-width: 800px) {

    header {
        height: auto;
        position: relative;
    }

    header img {
        margin-left: 20px;
        height: 60px;
    }

    .judulweb {
        font-size: 20px;
        padding-top: 20px;
    }

    header nav {
        float: none;
        margin-left: 0;
        clear: both;
        height: auto;
    }

    header nav a {
        height: 50px;
        padding: 15px 10px;
        font-size: 14px;
    }

    main {
        padding-top: 30px;
        width: 95%;
        overflow-x: auto;
    }

    table {
        min-width: 900px;
    }

    address {
        width: 95%;
        font-size: 14px;
    }

    .login-wrapper {
        max-width: 90%;
    }
}

/* =====================================================================
   Tambahan versi Laravel
   Style di bawah ini dulunya ada di tag <style> pada masing-masing file
   .php. Sekarang dikumpulkan di sini dan dibedakan lewat class di <body>.
   ===================================================================== */


/* ===== Tombol Logout di navigasi =====
   Logout sekarang berupa form POST (pakai token CSRF), jadi tombolnya
   dibuat terlihat sama persis dengan link menu lain. */

header nav form {
    float: left;
    width: auto;
    margin: 0;
    padding: 0;
    background: none;
    border-radius: 0;
}

header nav button[type="submit"] {
    float: left;
    display: block;
    height: 78px;
    color: #ffffff;
    background: none;
    border: none;
    border-radius: 0;
    font-family: Arial, Helvetica, sans-serif;
    font-weight: normal;
    font-size: 18px;
    text-align: center;
    padding: 29px 20px;
    line-height: 20px;
    cursor: pointer;
}

header nav button[type="submit"]:hover {
    background-color: #cccccc;
    color: #000000;
}


/* ===== Pesan error validasi dari server ===== */

.pesan-error {
    color: #c00;
    background: #fff3f3;
    border: 1px solid #e00;
    border-left: 4px solid #e00;
    padding: 10px 14px;
    border-radius: 4px;
    margin-bottom: 16px;
    line-height: 1.7;
}


/* ===== Halaman Home (Home.php) ===== */

body.halaman-home {
    background-image: url('../asset/bgbps.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    min-height: 100vh;
    margin: 0;
    display: flex;
    flex-direction: column;
}

.halaman-home main {
    flex: 1;
}

.halaman-home main h2,
.halaman-home main p {
    color: #fff;
    text-shadow: 1px 1px 4px rgba(0, 0, 0, 0.7);
}

.halaman-home footer {
    background-color: rgba(0, 0, 0, 0.75);
    color: #fff;
    text-align: center;
    padding: 15px 20px;
}


/* ===== Halaman Tambah Publikasi (page09C.php) ===== */

.halaman-tambah main h2 {
    text-align: center;
}

form[name="formTambahPublikasi"] {
    margin-left: auto;
    margin-right: auto;
}


/* ===== Halaman Login (page10A.php) ===== */

.login-wrapper h2 {
    text-align: center;
}


/* ===== Halaman Daftar Publikasi (page09A.php) ===== */

.table-wrapper {
    overflow-x: auto;
}

.table-wrapper img {
    width: 80px;
    height: auto;
    display: block;
    border-radius: 3px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.15);
}

.tanggal {
    white-space: nowrap;
}

.aksi {
    white-space: nowrap;
}

.aksi a,
.aksi .btn-hapus {
    display: inline-block;
    padding: 5px 10px;
    text-decoration: none;
    border-radius: 3px;
    margin: 0 2px;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 17px;
    line-height: normal;
}

.aksi .btn-edit {
    color: #fff;
    background: #28a745;
}

.aksi .btn-edit:hover {
    color: #fff;
    background: #218838;
}

/* Hapus sekarang berupa form DELETE, bukan link GET */
.aksi form {
    display: inline;
    width: auto;
    margin: 0;
    padding: 0;
    background: none;
    border-radius: 0;
}

.aksi .btn-hapus {
    color: #fff;
    background: #dc3545;
    border: none;
    cursor: pointer;
}

.aksi .btn-hapus:hover {
    background: #c82333;
}

/* Style untuk pencarian dengan autocomplete */
.search-container {
    margin: 20px 0;
    background: #fff;
    padding: 15px;
    border-radius: 5px;
    border: 1px solid #d5d5d5;
    position: relative;
}

.search-container form {
    display: flex;
    gap: 10px;
    width: 100%;
    margin: 0;
    background: none;
    padding: 0;
}

.search-container input[type="text"] {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 16px;
    min-width: 200px;
}

.search-container input[type="submit"] {
    padding: 10px 25px;
    background: #315987;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
}

.search-container input[type="submit"]:hover {
    background: #24466c;
}

.btn-reset {
    padding: 10px 25px;
    background: #6c757d;
    color: #fff;
    text-decoration: none;
    border-radius: 4px;
    font-size: 16px;
}

.btn-reset:hover {
    background: #5a6268;
}

/* Style untuk autocomplete/suggestion */
.autocomplete-list {
    position: absolute;
    top: 100%;
    left: 15px;
    right: 15px;
    background: #fff;
    border: 1px solid #ccc;
    border-top: none;
    border-radius: 0 0 4px 4px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.autocomplete-list .suggestion-item {
    padding: 10px 15px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.2s;
}

.autocomplete-list .suggestion-item:hover {
    background: #e8f0fe;
}

.autocomplete-list .suggestion-item:last-child {
    border-bottom: none;
}

.autocomplete-list .suggestion-item .highlight {
    background: #ffeb3b;
    font-weight: bold;
}

.no-data {
    text-align: center;
    padding: 40px;
    font-size: 18px;
    color: #666;
}


/* ===== Halaman Galeri Kegiatan (page06E.php) ===== */

.galeri-container {
    display: flex;
    gap: 16px;
    background: #fff;
    border: 1px solid #ccd;
    border-radius: 8px;
    padding: 16px;
    box-shadow: 0 2px 10px rgba(0,0,51,0.08);
    align-items: flex-start;
    flex-wrap: wrap;
}

.galeri-preview {
    flex-shrink: 0;
    width: 502px;
    max-width: 100%;
}

.galeri-preview-img-wrap {
    width: 100%;
    aspect-ratio: 502 / 631;
    border-radius: 6px;
    border: 2px solid #003366;
    overflow: hidden;
    background: #eef0f5;
    position: relative;
}

#previewImg {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    opacity: 0;
    transition: opacity 0.5s ease;
}

#previewImg.tampil {
    opacity: 1;
}

.galeri-caption {
    margin-top: 8px;
    font-size: 0.82rem;
    color: #555;
    font-style: italic;
    text-align: center;
    min-height: 18px;
}

.slide-dots {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.slide-dots span {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #b0bcd8;
    display: inline-block;
    cursor: pointer;
    transition: background 0.3s;
}

.slide-dots span.aktif {
    background: #003366;
}

.galeri-thumbnails {
    flex: 1;
    min-width: 200px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-content: flex-start;
    overflow-y: auto;
    max-height: 660px;
}

.galeri-thumbnails img {
    width: calc(33.33% - 6px);
    aspect-ratio: 502 / 631;
    object-fit: cover;
    border-radius: 4px;
    border: 2px solid transparent;
    cursor: pointer;
    transition: opacity 0.2s, border-color 0.2s;
    display: block;
    background: #eef0f5;
}

.galeri-thumbnails img:hover {
    opacity: 0.6;
    border-color: #003366;
}

.galeri-thumbnails img.aktif {
    border-color: #0055aa;
    box-shadow: 0 0 0 2px #0055aa44;
}

.slide-controls {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.slide-controls button {
    padding: 8px 20px;
    background: #315987;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.slide-controls button:hover {
    background: #24466c;
}


/* ===== Responsif untuk tambahan di atas ===== */

@media (max-width: 1200px) {
    header nav button[type="submit"] {
        font-size: 16px;
        padding-left: 12px;
        padding-right: 12px;
    }
}

@media (max-width: 800px) {
    header nav button[type="submit"] {
        height: 50px;
        padding: 15px 10px;
        font-size: 14px;
    }

    .galeri-container { flex-direction: column; align-items: center; }
    .galeri-preview { width: 100%; }
    .galeri-preview-img-wrap { width: 100%; height: auto; aspect-ratio: 502 / 631; }
    .galeri-thumbnails { width: 100%; max-height: 300px; }
    .galeri-thumbnails img { width: calc(50% - 4px); }
}

@media (max-width: 600px) {
    .table-wrapper img { width: 55px; }
    .search-container form {
        flex-direction: column;
    }
    .search-container input[type="text"] {
        width: 100%;
    }
    .autocomplete-list {
        left: 10px;
        right: 10px;
    }
}
