/* --- DESIGN SYSTEM: The Tactile Oasis --- */
:root {
    --primary: #486744;
    --primary-dim: #3a5336;
    --background: #f8faf8;
    --surface: #eaefec;
    --surface-lowest: #ffffff;
    --text-main: #1a2421;
    --text-muted: #5e7368;
    --radius-lg: 1.5rem;
    --radius-xl: 3rem;
    --shadow-light: #ffffff;
    --shadow-dark: #d4dcd9;
    --accent-red: #d35d5d;
}

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

body, .mobile-frame, .clay-card, .floating-dock, .dock-item, .view, .task-card, .announcement-card, .profile-info {
    transition: background-color 0.4s ease, color 0.4s ease, box-shadow 0.4s ease, border-color 0.4s ease;
}

/* Dark Mode Variables */
body.dark-mode {
    --primary: #8ab886;
    --primary-dim: #6d9669;
    --background: #111412;
    --surface: #181d1a;
    --surface-lowest: #131715;
    --text-main: #e8eee9;
    --text-muted: #8b9992;
    --shadow-light: #1c221e;
    --shadow-dark: #080a09;
    --accent-red: #ff8a8a;
    background-color: #111412;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: #e0e5e2; 
    display: flex; justify-content: center; align-items: center;
    min-height: 100vh; color: var(--text-main);
}

.mobile-frame {
    width: 390px; height: 844px;
    background-color: var(--background);
    border-radius: 40px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    position: relative; overflow: hidden;
    display: flex; flex-direction: column;
}

/* --- CLAYMORPHISM MIXINS --- */
.clay-card {
    background-color: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: 
        15px 15px 30px var(--shadow-dark), 
        -15px -15px 30px var(--shadow-light),
        inset -5px -5px 10px rgba(72, 103, 68, 0.05),
        inset 5px 5px 15px rgba(255, 255, 255, 0.8);
    padding: 20px; transition: transform 0.2s ease, box-shadow 0.4s ease, background-color 0.4s ease;
}
body.dark-mode .clay-card {
    box-shadow: 
        15px 15px 30px var(--shadow-dark), 
        -15px -15px 30px var(--shadow-light),
        inset -5px -5px 10px rgba(0, 0, 0, 0.4),
        inset 5px 5px 15px rgba(255, 255, 255, 0.02);
}

/* --- HEADER --- */
.top-bar {
    padding: 40px 30px 10px 30px;
    display: flex; align-items: center;
}
.page-title { font-size: 24px; font-weight: 700; letter-spacing: -0.5px; }

/* --- CONTENT --- */
.content {
    padding: 0 30px; flex: 1;
    overflow-y: auto; padding-bottom: 120px;
}

/* Views Management */
.view { display: none; animation: fadeIn 0.3s ease; }
.view.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* --- DASHBOARD VIEW --- */
.greeting-section { margin-bottom: 25px; margin-top: 10px;}
.greeting { font-size: 16px; color: var(--text-muted); font-weight: 500; }
.user-name { font-size: 26px; font-weight: 700; color: var(--primary); }

.task-summary { display: flex; gap: 20px; margin-bottom: 30px; }
.task-summary .clay-card { flex: 1; display: flex; flex-direction: column; justify-content: center; align-items: center; padding: 25px 15px;}
.primary-card {
    background: linear-gradient(135deg, var(--primary), var(--primary-dim));
    color: white;
    box-shadow: 15px 15px 30px var(--shadow-dark), -15px -15px 30px var(--shadow-light), inset -5px -5px 15px rgba(0, 0, 0, 0.2), inset 5px 5px 15px rgba(255, 255, 255, 0.2);
}
.primary-card .card-icon, .primary-card .card-label { color: rgba(255, 255, 255, 0.9); }
.card-icon { font-size: 28px; margin-bottom: 5px; color: var(--primary); }
.card-value { font-size: 36px; font-weight: 800; }
.card-label { font-size: 14px; font-weight: 500; color: var(--text-muted); }

.section-title { font-size: 18px; font-weight: 600; margin-bottom: 15px; color: var(--text-main); }
.schedule-item { display: flex; gap: 15px; margin-bottom: 15px; align-items: center; background-color: var(--surface-lowest); padding: 15px; }
.time-block { display: flex; flex-direction: column; align-items: flex-end; min-width: 45px; border-right: 2px solid var(--surface); padding-right: 15px;}
.time { font-size: 15px; font-weight: 700; color: var(--primary); }
.end-time { font-size: 12px; font-weight: 500; color: var(--text-muted); }
.course-info h4 { font-size: 16px; font-weight: 600; margin-bottom: 4px; }
.course-info p { font-size: 13px; color: var(--text-muted); }

/* --- JADWAL VIEW --- */
.day-group { margin-bottom: 25px; }
.day-title { font-size: 18px; font-weight: 600; margin-bottom: 15px; color: var(--primary); }

/* --- TUGAS VIEW --- */
.task-card { margin-bottom: 20px; background-color: var(--surface-lowest); }
.task-card.urgent { border-left: 5px solid var(--accent-red); }
.task-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 10px; }
.task-header h4 { font-size: 16px; font-weight: 600; line-height: 1.3; flex: 1; padding-right: 10px;}
.badge { padding: 4px 8px; border-radius: 12px; font-size: 11px; font-weight: 700; }
.badge.urgent { background-color: #fee2e2; color: var(--accent-red); }
.task-desc { font-size: 14px; color: var(--text-muted); margin-bottom: 15px; line-height: 1.4; }
.task-meta { font-size: 13px; font-weight: 500; color: var(--primary); display: flex; align-items: center; gap: 5px; }

/* --- PENGUMUMAN VIEW --- */
.announcement-card { margin-bottom: 20px; background-color: var(--surface-lowest); }
.announcement-header { display: flex; gap: 15px; align-items: center; margin-bottom: 12px; }
.icon-circle { width: 40px; height: 40px; border-radius: 50%; display: flex; justify-content: center; align-items: center; font-size: 20px; background-color: #fee2e2; color: var(--accent-red); }
.icon-circle.normal { background-color: var(--surface); color: var(--primary); }
.announcement-header h4 { font-size: 16px; font-weight: 600; margin-bottom: 3px; }
.date { font-size: 12px; color: var(--text-muted); }
.announcement-card p { font-size: 14px; color: var(--text-muted); line-height: 1.5; }

/* --- PROFIL VIEW --- */
.profile-header { display: flex; flex-direction: column; align-items: center; margin: 20px 0 30px 0; }
.avatar { width: 80px; height: 80px; border-radius: 50%; background-color: var(--surface); color: var(--primary); font-size: 40px; display: flex; justify-content: center; align-items: center; margin-bottom: 15px; box-shadow: 15px 15px 30px var(--shadow-dark), -15px -15px 30px var(--shadow-light), inset -5px -5px 10px rgba(72, 103, 68, 0.05), inset 5px 5px 15px rgba(255, 255, 255, 0.8);}
body.dark-mode .avatar {
    box-shadow: 15px 15px 30px var(--shadow-dark), -15px -15px 30px var(--shadow-light), inset -5px -5px 10px rgba(0, 0, 0, 0.4), inset 5px 5px 15px rgba(255, 255, 255, 0.02);
}
.profile-header h2 { font-size: 24px; font-weight: 700; margin-bottom: 5px; }
.profile-header p { font-size: 14px; color: var(--text-muted); }

.profile-info { background-color: var(--surface-lowest); border-radius: var(--radius-lg); padding: 20px; margin-bottom: 30px; box-shadow: 15px 15px 30px var(--shadow-dark), -15px -15px 30px var(--shadow-light); }
.info-row { display: flex; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid var(--surface); }
.info-row:last-child { border-bottom: none; padding-bottom: 0; }
.info-row:first-child { padding-top: 0; }
.label { color: var(--text-muted); font-size: 14px; }
.value { font-weight: 600; font-size: 14px; }

.profile-actions { display: flex; flex-direction: column; gap: 15px; }
.clay-btn-wide {
    width: 100%; padding: 16px; border-radius: var(--radius-xl); border: none;
    font-size: 16px; font-weight: 600; display: flex; justify-content: center; align-items: center; gap: 10px; cursor: pointer;
    font-family: inherit; transition: all 0.2s;
}
.clay-btn-wide.primary {
    background-color: var(--primary); color: white;
    box-shadow: 10px 10px 20px var(--shadow-dark), -10px -10px 20px var(--shadow-light), inset -3px -3px 8px rgba(0,0,0,0.2), inset 3px 3px 8px rgba(255,255,255,0.2);
}
.clay-btn-wide.secondary {
    background-color: transparent; color: var(--primary);
    box-shadow: inset 3px 3px 8px var(--shadow-dark), inset -3px -3px 8px var(--shadow-light);
}
.clay-btn-wide:active { transform: scale(0.98); }

/* --- FLOATING DOCK --- */
.floating-dock {
    position: absolute; bottom: 30px; left: 25px; right: 25px; height: 75px;
    background-color: var(--surface-lowest); border-radius: var(--radius-xl);
    display: flex; justify-content: space-around; align-items: center; padding: 0 10px;
    box-shadow: 20px 20px 60px var(--shadow-dark), -20px -20px 60px var(--shadow-light), inset -2px -2px 5px rgba(72, 103, 68, 0.05), inset 2px 2px 5px rgba(255, 255, 255, 0.9);
    z-index: 10;
}
body.dark-mode .floating-dock {
    box-shadow: 20px 20px 60px var(--shadow-dark), -20px -20px 60px var(--shadow-light), inset -2px -2px 5px rgba(0, 0, 0, 0.4), inset 2px 2px 5px rgba(255, 255, 255, 0.02);
}
.active-indicator {
    position: absolute;
    width: 55px; height: 55px;
    border-radius: 50%;
    background-color: var(--surface);
    box-shadow: inset 5px 5px 10px var(--shadow-dark), inset -5px -5px 10px var(--shadow-light);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 0;
    left: 0;
    pointer-events: none;
}

/* --- MODAL OVERLAY --- */
.modal-overlay {
    position: absolute; top: 0; left: 0; right: 0; bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    z-index: 100;
    display: flex; justify-content: center; align-items: center;
    opacity: 0; pointer-events: none; transition: opacity 0.3s ease;
    padding: 30px;
}
.modal-overlay.active {
    opacity: 1; pointer-events: all;
}
.modal-card {
    width: 100%; max-height: 80%; overflow-y: auto;
    position: relative;
    transform: translateY(30px) scale(0.95); transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    background-color: var(--surface-lowest);
}
.modal-overlay.active .modal-card {
    transform: translateY(0) scale(1);
}
.close-btn {
    position: absolute; top: 15px; right: 15px;
    background: var(--surface); border: none;
    width: 35px; height: 35px; border-radius: 50%;
    display: flex; justify-content: center; align-items: center;
    font-size: 18px; color: var(--text-muted); cursor: pointer;
    box-shadow: inset 2px 2px 5px var(--shadow-dark), inset -2px -2px 5px var(--shadow-light);
    transition: all 0.2s;
}
.close-btn:active { transform: scale(0.9); }
.modal-header { display: flex; align-items: center; gap: 15px; margin-bottom: 20px; padding-right: 35px; }
.modal-icon {
    width: 45px; height: 45px; border-radius: 50%; flex-shrink: 0;
    display: flex; justify-content: center; align-items: center;
    font-size: 24px; background-color: var(--surface); color: var(--primary);
    box-shadow: 5px 5px 10px var(--shadow-dark), -5px -5px 10px var(--shadow-light);
}
.modal-header h3 { font-size: 18px; font-weight: 600; color: var(--text-main); line-height: 1.3; }
.modal-body { font-size: 15px; color: var(--text-muted); line-height: 1.6; }
.modal-body p { margin-bottom: 12px; }
.modal-body p:last-child { margin-bottom: 0; }
.modal-body strong { color: var(--text-main); font-weight: 600; }

.clickable-card { cursor: pointer; }
.clickable-card:active { transform: scale(0.96) !important; }

.dock-item {
    width: 55px; height: 55px; border-radius: 50%;
    display: flex; justify-content: center; align-items: center;
    font-size: 26px; color: var(--text-muted); cursor: pointer; transition: all 0.3s ease;
    z-index: 1; position: relative;
}
.dock-item:active {
    transform: scale(0.85) !important;
}
.dock-item.active {
    color: var(--primary);
}
.dock-item:not(.active):hover { color: var(--primary); transform: translateY(-3px); }

/* --- AUTH & FORMS --- */
.auth-container { display: flex; flex-direction: column; height: 100%; justify-content: center; padding: 0 30px; overflow-y: auto; }
.auth-header { text-align: center; margin-bottom: 40px; }
.auth-logo { font-size: 50px; color: var(--primary); margin-bottom: 15px; }
.auth-title { font-size: 28px; font-weight: 700; margin-bottom: 10px; }
.auth-subtitle { color: var(--text-muted); font-size: 14px; }
.input-group { margin-bottom: 20px; }
.input-label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 8px; color: var(--text-muted); }
.clay-input {
    width: 100%; padding: 15px; border-radius: var(--radius-lg); border: none;
    background-color: var(--surface-lowest); color: var(--text-main); font-family: inherit; font-size: 15px;
    box-shadow: inset 5px 5px 10px var(--shadow-dark), inset -5px -5px 10px var(--shadow-light);
    outline: none; transition: all 0.3s ease;
    -webkit-appearance: none; appearance: none;
}
.clay-input:focus {
    box-shadow: inset 7px 7px 14px var(--shadow-dark), inset -7px -7px 14px var(--shadow-light);
}
.auth-footer { text-align: center; margin-top: 30px; margin-bottom: 30px; font-size: 14px; color: var(--text-muted); }
.auth-link { color: var(--primary); font-weight: 600; text-decoration: none; }
body.dark-mode .clay-input {
    box-shadow: inset 4px 4px 10px rgba(0, 0, 0, 0.4), inset -4px -4px 10px rgba(255, 255, 255, 0.02);
}
body.dark-mode .clay-input:focus {
    box-shadow: inset 6px 6px 14px rgba(0, 0, 0, 0.6), inset -6px -6px 14px rgba(255, 255, 255, 0.03);
}

/* --- ADMIN PANEL --- */
.admin-stat { text-align: center; padding: 20px; }
.admin-stat h2 { font-size: 32px; color: var(--primary); margin-bottom: 5px; }
.admin-stat p { font-size: 13px; color: var(--text-muted); font-weight: 600; }
.admin-form-group { margin-bottom: 15px; }
textarea.clay-input { resize: none; height: 100px; }

/* --- TOGGLE SWITCH --- */
.clay-toggle {
    position: relative;
    width: 50px;
    height: 28px;
}
.clay-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}
.toggle-label {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: var(--surface);
    border-radius: 34px;
    cursor: pointer;
    box-shadow: inset 3px 3px 6px var(--shadow-dark), inset -3px -3px 6px var(--shadow-light);
    transition: .4s;
}
.toggle-label:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 4px;
    bottom: 4px;
    background-color: var(--primary);
    border-radius: 50%;
    box-shadow: 2px 2px 5px rgba(0,0,0,0.2);
    transition: .4s;
}
.clay-toggle input:checked + .toggle-label {
    background-color: var(--primary);
    box-shadow: inset 3px 3px 6px rgba(0,0,0,0.2), inset -3px -3px 6px rgba(255,255,255,0.1);
}
.clay-toggle input:checked + .toggle-label:before {
    transform: translateX(22px);
    background-color: var(--surface-lowest);
}
