/* ===================================================
   style.css - OPTIMASI FINAL DESKTOP & INTERAKSI
   =================================================== */

/* === 1. GLOBAL & RESET === */
body, html {
    margin: 0;
    padding: 0;
    font-family: "Poppins", "Segoe UI", sans-serif;
    height: 100%;
    width: 100%;
    color: #333;
    overflow: hidden; /* Mencegah scroll body utama */
}

/* === 2. APLIKASI UTAMA (FIXED LAYOUT) === */
.app-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    width: 100%;
    background: linear-gradient(135deg, #75928d, #999caa);
    overflow: hidden;
}

/* Header Sticky */
.top-header {
    flex-shrink: 0; 
    z-index: 100;
    padding: 10px 30px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

.header-row {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    margin-bottom: 8px;
}

.header-row h1 {
    font-size: 1.5em;
    color: #2c3e50;
    margin: 0;
    font-weight: 700;
}

.user-area-container {
    position: absolute;
    right: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-label {
    font-weight: 600;
    font-size: 12px;
    background: white;
    padding: 5px 12px;
    border-radius: 20px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.logout-btn {
    padding: 5px 15px;
    border-radius: 20px;
    border: none;
    background: #e74c3c;
    color: white;
    font-weight: bold;
    cursor: pointer;
    font-size: 11px;
    transition: 0.2s;
}

.logout-btn:hover { background: #c0392b; }

/* === 3. NAVIGATION & SEARCH === */
.week-nav {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    position: relative;
}

.week-nav button {
    background: white;
    color: #3498db;
    border: 1px solid #3498db;
    padding: 6px 16px;
    border-radius: 25px;
    font-weight: 600;
    cursor: pointer;
    font-size: 12px;
    transition: 0.3s;
}

.week-nav button:hover {
    background: #3498db;
    color: white;
}

#searchInput {
    width: 200px;
    padding: 8px 15px;
    border-radius: 20px;
    border: none;
    background: rgba(255, 255, 255, 0.9);
    font-size: 12px;
    outline: none;
}

.suggestions-box {
    position: absolute;
    top: 110%;
    right: 0;
    width: 300px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    z-index: 2000;
    max-height: 350px;
    overflow-y: auto;
    display: none;
    border: 1px solid #eee;
}

/* === 4. GRID AREA & DRAG INTERACTION === */
.schedule-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 12px;
    padding: 15px;
    flex: 1;
    min-height: 0; 
}

.day-column {
    background: rgba(255, 255, 255, 0.6);
    border-radius: 12px;
    padding: 12px 0 0 0;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 15px rgba(0,0,0,0.03);
    height: 100%;
    overflow: hidden;
    transition: background 0.3s;
}

/* Visual saat ada item drag di atas kolom */
.day-column.drag-over {
    background: rgba(52, 152, 219, 0.2);
    border: 2px dashed #3498db;
}

.day-header {
    flex-shrink: 0;
    font-weight: 800;
    color: #2c3e50;
    font-size: 13px;
    margin-bottom: 10px;
    text-align: center;
    text-transform: uppercase;
}

.task-list {
    list-style: none;
    padding: 0 8px 15px 8px;
    margin: 0;
    flex: 1;
    overflow-y: auto;
    scrollbar-width: thin;
    min-height: 50px; /* Area drop tetap ada meski list kosong */
}

/* === 5. TASK ITEM & EDITING === */
.task-item {
    background: white;
    margin-bottom: 6px;
    padding: 8px 10px;
    border-radius: 8px;
    font-size: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.04);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: grab; /* Indikator bisa ditarik */
    user-select: none;
}

.task-item:active { cursor: grabbing; }

/* Visual saat sedang di-drag */
.task-item.dragging {
    opacity: 0.4;
    transform: scale(0.95);
    border: 1px dashed #3498db;
}

.task-item:hover { transform: translateY(-1px); box-shadow: 0 4px 8px rgba(0,0,0,0.08); }

.task-main { display: flex; align-items: center; gap: 8px; flex: 1; overflow: hidden; }

/* Gaya Input saat Edit Inline (Double Klik) */
.edit-inline-input {
    width: 100%;
    border: 1px solid #3498db;
    border-radius: 4px;
    padding: 4px 6px;
    font-family: inherit;
    font-size: 12px;
    outline: none;
    background: #fff;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.1);
}

.task-actions { display: flex; gap: 4px; opacity: 0; transition: 0.2s; }
.task-item:hover .task-actions { opacity: 1; }

.move-btn, .delete-btn {
    border: none; background: none; cursor: pointer; font-size: 14px; padding: 2px 4px;
}
.move-btn { color: #3498db; }
.delete-btn { color: #e74c3c; }

/* === 6. FOOTER & MODAL === */
.add-task-section {
    flex-shrink: 0;
    padding: 15px 20px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    display: flex;
    justify-content: center;
    gap: 10px;
}

.modal {
    display: none;
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10001;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 20px;
    width: 90%;
    max-width: 350px;
    text-align: center;
}

/* === 7. LOGIN PAGE === */
.login-wrapper {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(135deg, #2c3e50, #455a64);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

/* === 8. UTILS & COLORS === */
.completed { opacity: 0.5; text-decoration: line-through; }

.task-item:nth-child(7n + 1) { border-left: 4px solid #ff6384; }
.task-item:nth-child(7n + 2) { border-left: 4px solid #ff9f40; }
.task-item:nth-child(7n + 3) { border-left: 4px solid #ffcd56; }
.task-item:nth-child(7n + 4) { border-left: 4px solid #4bc0c0; }
.task-item:nth-child(7n + 5) { border-left: 4px solid #36a2eb; }
.task-item:nth-child(7n + 6) { border-left: 4px solid #9966ff; }
.task-item:nth-child(7n + 7) { border-left: 4px solid #f67280; }

/* Sembunyikan navigasi mobile saat di desktop */
.mobile-day-nav { display: none !important; }

/* Scrollbar Styles */
.task-list::-webkit-scrollbar { width: 4px; }
.task-list::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.1); border-radius: 10px; }