/* style.css */

/* -------------------------------------------------------------------------- */
/*                                  VARIABLES                                 */
/* -------------------------------------------------------------------------- */
:root {
    --primary-color: #007bff;       /* Biru sebagai warna utama, bisa diganti */
    --primary-color-darker: #0056b3;
    --secondary-color: #6c757d;     /* Abu-abu sekunder */
    --light-color: #f8f9fa;        /* Putih keabuan untuk background lembut */
    --dark-color: #343a40;         /* Hitam keabuan untuk teks utama */
    --success-color: #28a745;
    --error-color: #dc3545;
    --info-color: #17a2b8;
    --warning-color: #ffc107;
    --border-color: #dee2e6;       /* Warna border standar */
    --text-color: #212529;         /* Warna teks standar */
    --body-bg: #ffffff;            /* Latar belakang utama putih bersih */
    --link-color: var(--primary-color);
    --link-hover-color: var(--primary-color-darker);

    --font-family-sans-serif: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
    --font-family-monospace: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    --font-family-base: var(--font-family-sans-serif);

    --base-font-size: 1rem; /* 16px by default */
    --line-height-base: 1.6;
    --border-radius: 0.25rem; /* 4px */
    --box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    --box-shadow-lg: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

/* -------------------------------------------------------------------------- */
/*                                 RESET & BASE                               */
/* -------------------------------------------------------------------------- */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-family: var(--font-family-base);
    line-height: var(--line-height-base);
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}

body {
    font-size: var(--base-font-size);
    color: var(--text-color);
    background-color: var(--body-bg);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* -------------------------------------------------------------------------- */
/*                                  TYPOGRAPHY                                */
/* -------------------------------------------------------------------------- */
h1, h2, h3, h4, h5, h6 {
    margin-top: 0;
    margin-bottom: 0.75rem;
    font-weight: 500;
    line-height: 1.2;
    color: var(--dark-color);
}

h1 { font-size: 2.25rem; } /* ~36px */
h2 { font-size: 1.875rem; } /* ~30px */
h3 { font-size: 1.5rem; }  /* ~24px */
h4 { font-size: 1.125rem; } /* ~18px */
h5 { font-size: 1rem; }    /* ~16px */
h6 { font-size: 0.875rem; } /* ~14px */

p {
    margin-top: 0;
    margin-bottom: 1rem;
}

a {
    color: var(--link-color);
    text-decoration: none;
    background-color: transparent;
}
a:hover {
    color: var(--link-hover-color);
    text-decoration: underline;
}

img {
    vertical-align: middle;
    border-style: none;
    max-width: 100%;
    height: auto;
}

pre {
    font-family: var(--font-family-monospace);
    font-size: 0.875em;
    background-color: var(--light-color);
    padding: 1rem;
    border-radius: var(--border-radius);
    overflow-x: auto;
    border: 1px solid var(--border-color);
    white-space: pre-wrap;
    word-wrap: break-word;
}

hr {
    margin-top: 1rem;
    margin-bottom: 1rem;
    border: 0;
    border-top: 1px solid var(--border-color);
}

ul, ol {
    padding-left: 2rem;
    margin-bottom: 1rem;
}

/* -------------------------------------------------------------------------- */
/*                                   LAYOUT                                   */
/* -------------------------------------------------------------------------- */
.container {
    width: 100%;
    padding-right: 15px;
    padding-left: 15px;
    margin-right: auto;
    margin-left: auto;
}

@media (min-width: 576px) {
    .container { max-width: 540px; }
}
@media (min-width: 768px) {
    .container { max-width: 720px; }
}
@media (min-width: 992px) {
    .container { max-width: 960px; }
}
@media (min-width: 1200px) {
    .container { max-width: 1140px; }
}

.site-header {
    background-color: var(--dark-color);
    color: #fff;
    padding: 0.75rem 0;
    box-shadow: var(--box-shadow);
}

.site-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.site-header .site-title, .site-header .site-title a {
    font-size: 1.5rem;
    color: #fff;
    text-decoration: none;
    margin-bottom: 0;
}

.site-header nav ul {
    list-style: none;
    padding-left: 0;
    margin-bottom: 0;
    display: flex;
}

.site-header nav ul li {
    margin-left: 1rem;
}

.site-header nav ul li a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
}
.site-header nav ul li a:hover,
.site-header nav ul li a.active {
    color: #fff;
    text-decoration: none;
}

.user-info { /* Di header */
    font-size: 0.85em;
    color: rgba(255, 255, 255, 0.7);
    margin-right: 1rem; /* Jarak sebelum link navigasi */
}

.main-content {
    flex-grow: 1;
    padding-top: 1.5rem;
    padding-bottom: 1.5rem;
}

.site-footer {
    background-color: var(--light-color);
    color: var(--secondary-color);
    text-align: center;
    padding: 1.5rem 0;
    border-top: 1px solid var(--border-color);
    font-size: 0.9rem;
    margin-top: auto; /* Mendorong footer ke bawah */
}
.site-footer p {
    margin-bottom: 0;
}

/* -------------------------------------------------------------------------- */
/*                                    FORMS                                   */
/* -------------------------------------------------------------------------- */
.form-group {
    margin-bottom: 1.25rem;
}

label {
    display: inline-block;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

input[type="text"],
input[type="password"],
input[type="email"],
input[type="tel"],
input[type="date"],
input[type="number"],
input[type="search"],
textarea,
select {
    display: block;
    width: 100%;
    padding: 0.65rem 0.75rem;
    font-size: var(--base-font-size);
    font-weight: 400;
    line-height: var(--line-height-base);
    color: var(--text-color);
    background-color: #fff;
    background-clip: padding-box;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="email"]:focus,
input[type="tel"]:focus,
input[type="date"]:focus,
input[type="number"]:focus,
input[type="search"]:focus,
textarea:focus,
select:focus {
    color: var(--text-color);
    background-color: #fff;
    border-color: var(--primary-color); /* Lebih terang dari primary */
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

textarea {
    min-height: 100px;
    resize: vertical;
}

input[type="file"] {
    display: block;
    width: 100%;
    padding: 0.375rem 0.75rem; /* Sedikit berbeda agar pas */
}
input[type="file"]::file-selector-button {
    margin-right: 0.8rem;
    border: 1px solid var(--border-color);
    background: var(--light-color);
    padding: 0.375rem 0.75rem;
    border-radius: var(--border-radius);
    color: var(--text-color);
    cursor: pointer;
    transition: background-color .2s ease-in-out, border-color .2s ease-in-out;
}
input[type="file"]::file-selector-button:hover {
    background: var(--border-color); /* Sedikit lebih gelap */
}


/* Buttons */
.btn {
    display: inline-block;
    font-weight: 600;
    color: #fff;
    text-align: center;
    vertical-align: middle;
    cursor: pointer;
    user-select: none;
    background-color: var(--primary-color);
    border: 1px solid var(--primary-color);
    padding: 0.6rem 1.2rem;
    font-size: var(--base-font-size);
    line-height: var(--line-height-base);
    border-radius: var(--border-radius);
    transition: color .15s ease-in-out, background-color .15s ease-in-out, border-color .15s ease-in-out, box-shadow .15s ease-in-out;
}
.btn:hover {
    color: #fff;
    background-color: var(--primary-color-darker);
    border-color: var(--primary-color-darker);
    text-decoration: none;
}
.btn:focus, .btn.focus {
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.5);
}

.btn-secondary {
    background-color: var(--secondary-color);
    border-color: var(--secondary-color);
}
.btn-secondary:hover {
    background-color: #5a6268;
    border-color: #545b62;
}

.btn-success { background-color: var(--success-color); border-color: var(--success-color); }
.btn-success:hover { background-color: #1e7e34; border-color: #1c7430; }

.btn-danger { background-color: var(--error-color); border-color: var(--error-color); }
.btn-danger:hover { background-color: #bd2130; border-color: #b21f2d; }

.btn-info { background-color: var(--info-color); border-color: var(--info-color); }
.btn-info:hover { background-color: #117a8b; border-color: #10707f; }

.btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
    line-height: 1.5;
    border-radius: 0.2rem;
}


/* Form Auth (Login, Register) */
.auth-container {
    max-width: 450px;
    margin: 3rem auto;
    padding: 2rem;
    background-color: #fff;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow-lg);
}
.auth-container h2 {
    text-align: center;
    margin-bottom: 1.5rem;
}
.auth-container p {
    text-align: center;
    font-size: 0.9rem;
    margin-top: 1rem;
}
.auth-container .form-group:last-of-type {
    margin-bottom: 1.5rem; /* Tambah space sebelum tombol */
}
.auth-container button[type="submit"] {
    width: 100%;
}

/* -------------------------------------------------------------------------- */
/*                                   TABLES                                   */
/* -------------------------------------------------------------------------- */
table {
    width: 100%;
    margin-bottom: 1rem;
    color: var(--text-color);
    background-color: #fff; /* Pastikan putih jika ada background lain di parent */
    border-collapse: collapse;
}
table th,
table td {
    padding: 0.85rem;
    vertical-align: top;
    border: 1px solid var(--border-color);
}
table thead th {
    vertical-align: bottom;
    border-bottom-width: 2px;
    background-color: var(--light-color);
    font-weight: 600;
}
table tbody tr:nth-of-type(odd) {
    background-color: rgba(0,0,0,.025);
}
table tbody tr:hover {
    background-color: rgba(0,0,0,.05);
}
.table-responsive {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* -------------------------------------------------------------------------- */
/*                                  MESSAGES                                  */
/* -------------------------------------------------------------------------- */
.message, .error-message, .success-message, .info-message, .warning-message {
    position: relative;
    padding: 0.9rem 1.25rem;
    margin-bottom: 1rem;
    border: 1px solid transparent;
    border-radius: var(--border-radius);
}
.success-message { color: #0f5132; background-color: #d1e7dd; border-color: #badbcc; }
.error-message { color: #842029; background-color: #f8d7da; border-color: #f5c2c7; }
.info-message { color: #055160; background-color: #cff4fc; border-color: #b6effb; }
.warning-message { color: #664d03; background-color: #fff3cd; border-color: #ffecb5; }

/* -------------------------------------------------------------------------- */
/*                             SPECIFIC COMPONENTS                            */
/* -------------------------------------------------------------------------- */
.dashboard-section {
    background-color: #fff;
    padding: 1.5rem;
    border-radius: var(--border-radius);
    margin-bottom: 1.5rem;
    box-shadow: var(--box-shadow);
}
.dashboard-section h3 {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.75rem;
    margin-bottom: 1rem;
}

.laporan-item, .history-item {
    background-color: #fff;
    border: 1px solid var(--border-color);
    padding: 1.25rem;
    margin-bottom: 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}
.laporan-item h4, .history-item h4 {
    color: var(--primary-color);
    margin-top: 0;
}
.laporan-meta, .history-meta {
    font-size: 0.875em;
    color: var(--secondary-color);
    margin-bottom: 0.75rem;
    display: block;
}

.foto-kegiatan, .existing-photos {
    margin-top: 1rem;
}
.foto-kegiatan img, .existing-photos img {
    max-width: 100px;
    max-height: 100px;
    margin: 0.25rem;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    object-fit: cover;
    display: inline-block;
}
.photo-item {
    display: inline-block;
    position: relative;
    margin: 0.25rem;
}

.komentar-section {
    margin-top: 1rem;
    padding: 1rem;
    background-color: var(--light-color);
    border-left: 4px solid var(--primary-color);
    border-radius: 0 var(--border-radius) var(--border-radius) 0;
}
.komentar-section strong {
    display: block;
    margin-bottom: 0.25rem;
}
.komentar-section p {
    margin-bottom: 0.5rem;
}
.komentar-section p:last-child {
    margin-bottom: 0;
}

.profile-header { /* Untuk halaman histori mahasiswa */
    text-align: center;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background-color: var(--light-color);
    border-radius: var(--border-radius);
}
.profile-header .profile-pic {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 1rem;
    border: 3px solid #fff;
    box-shadow: var(--box-shadow);
}

.semester-group { /* Untuk pengelompokan di histori */
    margin-bottom: 2rem;
    border: 1px solid var(--border-color);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    background-color: #fff;
}
.semester-group > h3 {
    color: var(--primary-color);
    border-bottom: 1px dashed var(--border-color);
    padding-bottom: 0.75rem;
}

/* Search form in dashboards */
.search-form {
    margin-bottom: 1.5rem;
    display: flex;
    gap: 0.5rem;
}
.search-form input[type="search"] {
    flex-grow: 1;
}


/* -------------------------------------------------------------------------- */
/*                                 RESPONSIVE                                 */
/* -------------------------------------------------------------------------- */
@media (max-width: 768px) {
    .site-header .container {
        flex-direction: column;
        text-align: center;
    }
    .site-header .site-title {
        margin-bottom: 0.5rem;
    }
    .site-header nav ul {
        flex-direction: column;
        align-items: center;
    }
    .site-header nav ul li {
        margin-left: 0;
        margin-top: 0.5rem;
    }
    .user-info {
        margin-right: 0;
        margin-bottom: 0.5rem;
    }
    .search-form {
        flex-direction: column;
    }
    .search-form .btn {
        width: 100%;
    }
}

@media (max-width: 576px) {
    body {
        font-size: 0.9375rem; /* ~15px */
    }
    h1 { font-size: 1.875rem; }
    h2 { font-size: 1.625rem; }
    h3 { font-size: 1.375rem; }

    .auth-container {
        margin: 1.5rem auto;
        padding: 1.5rem;
    }
    .foto-kegiatan img, .existing-photos img {
        max-width: 80px;
        max-height: 80px;
    }
}

/* -------------------------------------------------------------------------- */
/*                               UTILITY CLASSES                              */
/* -------------------------------------------------------------------------- */
.text-center { text-align: center !important; }
.text-right { text-align: right !important; }
.text-left { text-align: left !important; }

.mb-0 { margin-bottom: 0 !important; }
.mb-1 { margin-bottom: 0.25rem !important; }
.mb-2 { margin-bottom: 0.5rem !important; }
.mb-3 { margin-bottom: 1rem !important; }
.mb-4 { margin-bottom: 1.5rem !important; }
.mb-5 { margin-bottom: 3rem !important; }

.mt-0 { margin-top: 0 !important; }
.mt-1 { margin-top: 0.25rem !important; }
.mt-2 { margin-top: 0.5rem !important; }
.mt-3 { margin-top: 1rem !important; }
.mt-4 { margin-top: 1.5rem !important; }
.mt-5 { margin-top: 3rem !important; }

.d-block { display: block !important; }
.d-inline-block { display: inline-block !important; }
.d-flex { display: flex !important; }
.justify-content-between { justify-content: space-between !important; }
.align-items-center { align-items: center !important; }

.w-100 { width: 100% !important; }
.p-0 { padding: 0 !important; }
.m-0 { margin: 0 !important; }

.no-shadow { box-shadow: none !important; }
.no-border { border: none !important; }