/* RESET & VARIABLE MONOKROM */
:root {
    --bg-color: #FFFFFF;          /* Background Utama Putih Bersih */
    --card-color: #F8F9FA;        /* Kartu Abu-abu Sangat Muda (Light Grey) */
    --text-main: #1A1A1A;         /* Teks Utama Abu-abu Sangat Gelap (Dark Grey) */
    --text-sub: #666666;          /* Teks Sub-informasi Muted Grey */
    --border-color: #E5E5E5;      /* Garis Batas Ringan (Light Border) */
    
    /* Aksentuasi Monokrom */
    --primary-color: #333333;     /* Dark Grey Accent */
    --primary-light: #F1F3F5;     /* Light Grey Accent modern premium (Pengganti Beige) */
    
    /* Status Pastel */
    --status-todo-bg: #FFE3E3;    /* Soft Red */
    --status-todo-text: #5C1E1E;
    
    --status-process-bg: #FFF3CD; /* Soft Yellow */
    --status-process-text: #664D03;
    
    --status-done-bg: #D1E7DD;    /* Soft Green */
    --status-done-text: #0F5132;
    
    --transition-speed: 0.25s;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Plus Jakarta Sans', sans-serif;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.5;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* KONTROL HEADER GLOBAL */
.app-header {
    background-color: var(--card-color);
    border-bottom: 1px solid var(--border-color);
    padding: 1.2rem;
    position: sticky;
    top: 0;
    z-index: 100;
    text-align: center;
}

body.on-welcome .app-header {
    display: none;
}

.header-content h1 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-main);
}

.header-content p {
    font-size: 0.8rem;
    color: var(--text-sub);
}

/* CONTAINER UTAMA */
.app-container {
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    padding: 1rem;
    flex: 1;
}

/* SEKSI VIEW */
.view-section {
    animation: fadeIn var(--transition-speed) ease-in-out;
}

.hidden {
    display: none !important;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* GREETINGS FULLSCREEN CENTERING (Responsive Frame - Optimized) */
#welcome-view {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 2rem);
    width: 100%;
}

.welcome-frame {
    background-color: var(--card-color);
    border: 1px solid var(--border-color);
    border-radius: 28px;
    width: 100%;
    min-height: 80vh; /* Menggunakan min-height agar elastis di HP kecil */
    height: auto;
    max-width: 500px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    padding: 2.5rem 1.5rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.02);
    margin: 1.5rem auto;
}

.welcome-top, 
.welcome-bottom {
    width: 100%;
    text-align: center;
}

.welcome-top h1 {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--text-main);
    letter-spacing: -0.5px;
}

.welcome-subtitle {
    font-size: 0.9rem;
    color: var(--text-sub);
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 2px;
    margin-top: 0.2rem;
}

/* PORTAL CARD DI TENGAH */
.welcome-center {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    margin: 1.5rem 0;
}

.portal-card {
    background-color: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    width: 85%;
    padding: 2rem 1.5rem;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.portal-card-icon {
    font-size: 2.5rem;
    background-color: var(--primary-light);
    width: 70px;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 20px;
    margin-bottom: 1.2rem;
}

.portal-card h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 0.5rem;
}

.portal-card p {
    font-size: 0.8rem;
    color: var(--text-sub);
    text-align: center;
    line-height: 1.4;
    margin-bottom: 1.5rem;
    max-width: 250px;
}

/* GAYA KHUSUS KARTU AUTENTIKASI & INPUTNYA */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    width: 100%;
    margin-bottom: 1.2rem;
}

.auth-input {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    outline: none;
    font-size: 0.9rem;
    background-color: var(--card-color);
    color: var(--text-main);
    transition: border-color var(--transition-speed);
}

.auth-input:focus {
    border-color: var(--primary-color);
}

.btn-auth {
    width: 100%;
    font-weight: 700;
}

.auth-toggle {
    font-size: 0.8rem;
    color: var(--text-sub);
}

.auth-toggle span {
    color: var(--text-main);
    font-weight: 700;
    text-decoration: underline;
    cursor: pointer;
}

.welcome-bottom h2 {
    font-size: 1.4rem;
    color: var(--text-main);
    font-weight: 700;
    line-height: 1.4;
    margin-bottom: 0.5rem;
}

.welcome-motto {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--text-sub);
    letter-spacing: 1.5px;
}

/* TOMBOL UTAMA MONOKROM */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.6rem 1rem;
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    transition: all var(--transition-speed);
    min-height: 44px;
}

.btn-primary {
    background-color: var(--primary-color);
    color: var(--bg-color);
}

.btn-primary:active {
    transform: scale(0.97);
}

.btn-secondary {
    background-color: var(--primary-light);
    color: var(--text-main);
}

.btn-back {
    background: none;
    border: none;
    color: var(--text-main);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    padding: 0.5rem 0;
    display: inline-block;
    margin-bottom: 1rem;
}

/* DAFTAR HEADER & GRID */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    margin-top: 1.5rem;
}

.section-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
}

.grid-list {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

/* KARTU ITEM */
.item-card {
    background-color: var(--card-color);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0,0,0,0.01);
    position: relative;
    transition: transform 0.1s ease, box-shadow 0.2s ease;
}

.item-card:active {
    transform: scale(0.98);
}

.item-info {
    flex: 1;
}

.item-info h4 {
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 0.2rem;
    color: var(--text-main);
}

.item-info p {
    font-size: 0.8rem;
    color: var(--text-sub);
}

.card-actions {
    display: flex;
    align-items: center;
    margin-left: 1rem;
}

.btn-delete {
    background-color: #FFE6E6;
    color: #C0392B;
    border: none;
    padding: 0.5rem 0.9rem;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    position: relative;
    z-index: 5;
}

/* LAMPIRAN DOKUMEN / PDF */
.document-section {
    background-color: var(--card-color);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.2rem;
    margin-bottom: 1.5rem;
}

.document-section h4 {
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text-main);
}

.document-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.8rem;
}

@media (max-width: 480px) {
    .document-grid {
        grid-template-columns: 1fr;
    }
}

.document-card {
    background-color: var(--bg-color);
    border: 1px dashed var(--border-color);
    border-radius: 12px;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.5rem;
}

.document-card h5 {
    font-size: 0.85rem;
    font-weight: 600;
}

.file-status {
    font-size: 0.75rem;
    color: var(--text-sub);
    word-break: break-all;
    max-width: 100%;
}

.btn-file-label {
    background-color: var(--primary-light);
    color: var(--text-main);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.4rem 0.8rem;
    border-radius: 8px;
    cursor: pointer;
    display: inline-block;
    transition: background-color var(--transition-speed);
}

.btn-file-label input[type="file"] {
    display: none;
}

.btn-delete-file {
    background-color: #FFE6E6;
    color: #C0392B;
    border: none;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.3rem 0.6rem;
    border-radius: 6px;
    cursor: pointer;
}

/* PROGRESS BAR */
.progress-container-main {
    margin-top: 0.8rem;
    font-size: 0.8rem;
}

.progress-container-main span {
    color: var(--text-sub);
}

.progress-bar-bg {
    background-color: var(--primary-light);
    border-radius: 8px;
    height: 8px;
    width: 100%;
    margin-top: 0.3rem;
    overflow: hidden;
}

.progress-bar-fill {
    background-color: var(--primary-color);
    height: 100%;
    width: 0%;
    border-radius: 8px;
    transition: width 0.4s ease-out;
}

/* DETAIL SEMESTER & COURSE BOX */
.semester-header-box, .course-header-box {
    background-color: var(--card-color);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.2rem;
    margin-bottom: 1.5rem;
}

.course-header-box p {
    font-size: 0.85rem;
    color: var(--text-sub);
}

.semester-header-box h2, .course-header-box h2 {
    color: var(--text-main);
}

/* SELEKTOR TIPE KULIAH */
.form-group {
    margin-top: 1rem;
    margin-bottom: 1.2rem;
    text-align: left;
}

.form-label {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-main);
    display: block;
    margin-bottom: 0.5rem;
}

.type-selector-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.8rem;
}

.type-option {
    cursor: pointer;
    position: relative;
}

.type-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.type-box {
    background-color: var(--bg-color);
    border: 1.5px solid var(--border-color);
    border-radius: 12px;
    padding: 0.8rem;
    text-align: center;
    transition: all var(--transition-speed);
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.type-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-main);
}

.type-desc {
    font-size: 0.7rem;
    color: var(--text-sub);
}

.type-option input[type="radio"]:checked + .type-box {
    border-color: var(--primary-color);
    background-color: var(--primary-light);
}

.type-option input[type="radio"]:checked + .type-box .type-title {
    color: var(--text-main);
}

/* SESSIONS & NOTES */
.session-section-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.8rem;
}

.session-list-container {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.session-card {
    background-color: var(--card-color);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.session-main-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.session-title h5 {
    font-size: 0.9rem;
    font-weight: 600;
}

.session-title span {
    font-size: 0.75rem;
    color: var(--text-sub);
}

/* GAYA TOMBOL LENCANA PEMILIH STATUS (Dengan Warna Pastel Eksplisit) */
.status-badge-trigger {
    padding: 0.45rem 0.8rem;
    font-size: 0.8rem;
    font-weight: 700;
    border-radius: 8px;
    border: 1.5px solid var(--border-color);
    cursor: pointer;
    text-align: center;
    min-width: 110px;
    display: inline-block;
    transition: transform var(--transition-speed) ease;
}

.status-badge-trigger:active {
    transform: scale(0.95);
}

/* Warna Pastel untuk Lencana Status di Daftar Sesi Sesuai Pilihan (Fixing) */
.status-badge-trigger.status-todo {
    background-color: var(--status-todo-bg) !important;
    color: var(--status-todo-text) !important;
    border-color: #FFC1C1 !important;
}

.status-badge-trigger.status-process {
    background-color: var(--status-process-bg) !important;
    color: var(--status-process-text) !important;
    border-color: #FFE4A0 !important;
}

.status-badge-trigger.status-done {
    background-color: var(--status-done-bg) !important;
    color: var(--status-done-text) !important;
    border-color: #C3E6CB !important;
}

/* KUSTOM STATUS OPTION BUTTONS PADA DIALOG */
.status-options-container {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    width: 100%;
}

.status-option-btn {
    width: 100%;
    padding: 0.8rem;
    border: none;
    border-radius: 12px;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    transition: transform var(--transition-speed) ease;
}

.status-option-btn:active {
    transform: scale(0.97);
}

/* Warna Pastel Eksplisit pada Dialog Status Picker */
.status-option-btn.status-todo {
    background-color: var(--status-todo-bg) !important;
    color: var(--status-todo-text) !important;
    border: 1.5px solid #FFC1C1;
}

.status-option-btn.status-process {
    background-color: var(--status-process-bg) !important;
    color: var(--status-process-text) !important;
    border: 1.5px solid #FFE4A0;
}

.status-option-btn.status-done {
    background-color: var(--status-done-bg) !important;
    color: var(--status-done-text) !important;
    border: 1.5px solid #C3E6CB;
}

/* Kolom Catatan */
.session-note-row {
    width: 100%;
}

.session-note-input {
    width: 100%;
    min-height: 48px;
    padding: 0.6rem;
    font-size: 0.8rem;
    border: 1px solid var(--border-color);
    background-color: var(--bg-color);
    border-radius: 10px;
    resize: vertical;
    outline: none;
    color: var(--text-main);
    transition: border-color var(--transition-speed);
}

.session-note-input:focus {
    border-color: var(--primary-color);
}

/* MODAL BOX */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.4);
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1rem;
    z-index: 1000;
    animation: fadeIn var(--transition-speed) ease-out;
}

.modal-content {
    background-color: var(--bg-color);
    width: 100%;
    max-width: 400px;
    border-radius: 20px;
    padding: 1.5rem;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    border: 1px solid var(--border-color);
}

.modal-content h3 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

.modal-content input[type="text"] {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    margin-bottom: 1.2rem;
    outline: none;
    font-size: 0.95rem;
    background-color: var(--card-color);
}

.modal-content input[type="text"]:focus {
    border-color: var(--primary-color);
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.6rem;
}

/* KUSTOM DIALOG & OVERLAY */
.dialog-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.45);
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1rem;
    z-index: 2000;
    animation: fadeIn 0.2s ease-out;
}

.dialog-card {
    background-color: var(--bg-color);
    width: 100%;
    max-width: 360px;
    border-radius: 18px;
    padding: 1.5rem;
    text-align: center;
    box-shadow: 0 8px 24px rgba(0,0,0,0.1);
    border: 1px solid var(--border-color);
}

.dialog-card h3 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    color: var(--text-main);
}

.dialog-card p {
    font-size: 0.85rem;
    color: var(--text-sub);
    margin-bottom: 1.2rem;
    line-height: 1.4;
}

.dialog-actions {
    display: flex;
    justify-content: center;
    gap: 0.8rem;
}

.dialog-actions .btn {
    flex: 1;
}

/* GAYA KLIK DOKUMEN PDF */
.file-link {
    color: var(--text-main);
    font-weight: 600;
    cursor: pointer;
    text-decoration: underline;
    transition: color var(--transition-speed);
}

.file-link:hover {
    color: var(--text-sub);
}
