/* Reset dan variabel */
:root {
    --primary-color: #2c3e7e;
    --primary-dark: #1a2a5e;
    --primary-light: #3b4f94;
    --accent-color: #4361ee;
    --text-color: #333;
    --text-light: #6c757d;
    --text-white: #ffffff;
    --bg-light: #f5f7fa;
    --bg-white: #ffffff;
    --border-color: #dee2e6;
    --success-color: #28a745;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --shadow-sm: 0 .125rem .25rem rgba(0,0,0,.075);
    --shadow: 0 .5rem 1rem rgba(0,0,0,.15);
    --border-radius: 6px;
    --sidebar-width: 250px;
    --sidebar-collapsed-width: 70px;
    --header-height: 60px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', 'Roboto', 'Helvetica Neue', sans-serif;
}

body {
    background-color: var(--bg-light);
    color: var(--text-color);
    font-size: 14px;
    line-height: 1.5;
    overflow-x: hidden;
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-light);
}

::-webkit-scrollbar-thumb {
    background: var(--text-light);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-light);
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 0.5rem;
}

p {
    margin-bottom: 1rem;
}

a {
    color: var(--accent-color);
    text-decoration: none;
}

a:hover {
    text-decoration: none;
}

button {
    cursor: pointer;
    border: none;
    outline: none;
    background: none;
}

/* Utility Classes */
.hidden {
    display: none !important;
}

/* Sidebar Styles */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: var(--sidebar-width);
    background-color: var(--primary-color);
    color: var(--text-white);
    z-index: 1000;
    transition: all 0.3s ease;
    box-shadow: var(--shadow);
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar.collapsed {
    width: var(--sidebar-collapsed-width);
}

.sidebar-header {
    height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    background-color: var(--primary-dark);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.logo-container {
    display: flex;
    align-items: center;
}

.logo-icon {
    font-size: 24px;
    margin-right: 10px;
}

.logo-text {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-white);
    white-space: nowrap;
}

.sidebar-toggle-btn {
    color: var(--text-white);
    font-size: 18px;
    padding: 5px;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.sidebar-toggle-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.sidebar-profile {
    padding: 20px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.profile-image {
    font-size: 36px;
    margin-right: 10px;
    color: var(--text-white);
}

.profile-info {
    white-space: nowrap;
}

.profile-name {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 2px;
}

.profile-status {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
}

.sidebar-menu {
    list-style: none;
    padding: 10px 0;
}

.sidebar-item {
    position: relative;
}

.sidebar-link {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: var(--text-white);
    transition: all 0.2s;
    white-space: nowrap;
}

.sidebar-link:hover {
    background-color: var(--primary-light);
    color: var(--text-white);
}

.sidebar-item.active .sidebar-link {
    background-color: var(--accent-color);
    color: var(--text-white);
    font-weight: 500;
}

.sidebar-icon {
    font-size: 18px;
    width: 24px;
    text-align: center;
    margin-right: 12px;
}

.sidebar-text {
    font-size: 14px;
}

.sidebar-divider {
    height: 1px;
    background-color: rgba(255, 255, 255, 0.1);
    margin: 10px 0;
}

.sidebar-footer {
    padding: 15px 20px;
    text-align: center;
    color: rgba(255, 255, 255, 0.6);
    font-size: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: auto;
}

/* Main Content */
.main-content {
    margin-left: var(--sidebar-width);
    transition: margin-left 0.3s ease;
    min-height: 100vh;
    position: relative;
    background-color: var(--bg-light);
}

.sidebar.collapsed + .main-content {
    margin-left: var(--sidebar-collapsed-width);
}

/* Header */
.main-header {
    height: var(--header-height);
    background-color: var(--bg-white);
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    padding: 0 20px;
    position: sticky;
    top: 0;
    z-index: 999;
}

.menu-toggle {
    display: none;
}

.menu-toggle-btn {
    font-size: 20px;
    padding: 5px;
    border-radius: 4px;
    color: var(--text-color);
}

.header-search {
    flex-grow: 1;
    padding: 0 20px;
}

.search-box {
    position: relative;
    max-width: 500px;
}

.search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
}

#searchInput {
    width: 100%;
    padding: 8px 12px 8px 36px;
    border-radius: 20px;
    border: 1px solid var(--border-color);
    background-color: var(--bg-light);
    font-size: 14px;
    transition: all 0.2s;
}

#searchInput:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 2px rgba(67, 97, 238, 0.25);
    outline: none;
}

/* Container */
.container {
    padding: 20px;
    max-width: 100%;
}

.header {
    margin-bottom: 20px;
}

.header h1 {
    font-size: 24px;
    margin-bottom: 5px;
}

.header p {
    color: var(--text-light);
    font-size: 14px;
}

/* Dashboard Summary */
.dashboard-summary {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.summary-card {
    background-color: var(--bg-white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    padding: 20px;
    display: flex;
    align-items: center;
    transition: transform 0.2s, box-shadow 0.2s;
}

.summary-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow);
}

.summary-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    background-color: rgba(67, 97, 238, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 15px;
    font-size: 24px;
    color: var(--accent-color);
}

.summary-info {
    display: flex;
    flex-direction: column;
}

.summary-title {
    font-size: 14px;
    color: var(--text-light);
    margin-bottom: 5px;
}

.summary-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-color);
}

/* Section Container */
.section-container {
    background-color: var(--bg-white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    padding: 20px;
    margin-bottom: 20px;
}

.section-title {
    font-size: 18px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Upcoming Tasks */
.upcoming-tasks {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 15px;
}

/* Task Card */
.task-card {
    background-color: var(--bg-white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    padding: 15px;
    position: relative;
    border-left: 4px solid var(--primary-color);
    margin-bottom: 15px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.task-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.task-priority-indicator {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.task-card[data-priority="tinggi"] .task-priority-indicator {
    background-color: var(--danger-color);
}

.task-card[data-priority="sedang"] .task-priority-indicator {
    background-color: var(--warning-color);
}

.task-card[data-priority="rendah"] .task-priority-indicator {
    background-color: var(--success-color);
}

.task-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
}

.task-title {
    font-size: 16px;
    margin-right: 15px;
    word-break: break-word;
}

.time-remaining {
    font-size: 12px;
    color: var(--text-light);
    white-space: nowrap;
}

.task-description {
    font-size: 14px;
    color: var(--text-light);
    margin-bottom: 10px;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.task-info {
    display: flex;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.course-name, .instructor-name {
    font-size: 12px;
    background-color: rgba(67, 97, 238, 0.1);
    color: var(--accent-color);
    padding: 3px 8px;
    border-radius: 15px;
    margin-right: 8px;
    margin-bottom: 5px;
}

.task-date-container {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    color: var(--text-light);
    font-size: 12px;
}

.task-date {
    margin-right: 10px;
}

.task-actions {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

.btn-action {
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.btn-action i {
    margin-right: 4px;
}

.btn-edit {
    color: var(--accent-color);
    background-color: rgba(67, 97, 238, 0.1);
}

.btn-edit:hover {
    background-color: rgba(67, 97, 238, 0.2);
}

.btn-complete {
    color: var(--success-color);
    background-color: rgba(40, 167, 69, 0.1);
}

.btn-complete:hover {
    background-color: rgba(40, 167, 69, 0.2);
}

.btn-delete {
    color: var(--danger-color);
    background-color: rgba(220, 53, 69, 0.1);
}

.btn-delete:hover {
    background-color: rgba(220, 53, 69, 0.2);
}

/* Tasks Tabs */
.tasks-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
    overflow-x: auto;
}

.tab-btn {
    padding: 8px 16px;
    border-radius: 20px;
    color: var(--text-light);
    background-color: transparent;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
    white-space: nowrap;
}

.tab-btn:hover {
    color: var(--accent-color);
}

.tab-btn.active {
    color: var(--text-white);
    background-color: var(--accent-color);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-light);
}

.empty-icon {
    font-size: 48px;
    margin-bottom: 15px;
    opacity: 0.5;
}

/* Add Task Container */
.add-task-container {
    background-color: var(--bg-white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    padding: 20px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-color);
}

.form-group label i {
    margin-right: 6px;
    color: var(--accent-color);
}

.form-control, .task-input {
    width: 100%;
    padding: 10px 12px;
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    font-size: 14px;
    transition: all 0.2s;
}

.form-control:focus, .task-input:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 2px rgba(67, 97, 238, 0.25);
    outline: none;
}

.form-row {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.form-group-half {
    flex: 1;
    margin-bottom: 0;
}

/* Buttons */
.btn-container {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.btn {
    padding: 10px 20px;
    border-radius: var(--border-radius);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.btn i {
    margin-right: 8px;
}

.btn-primary {
    background-color: var(--accent-color);
    color: var(--text-white);
}

.btn-primary:hover {
    background-color: var(--primary-light);
}

.btn-outline {
    background-color: transparent;
    color: var(--accent-color);
    border: 1px solid var(--accent-color);
}

.btn-outline:hover {
    background-color: rgba(67, 97, 238, 0.1);
}

.btn-danger {
    background-color: var(--danger-color);
    color: var(--text-white);
}

.btn-danger:hover {
    background-color: #c82333;
}

/* Modal styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1050;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.2s;
}

.modal.show {
    display: block;
}

.modal-content {
    background-color: var(--bg-white);
    margin: 50px auto;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    width: 90%;
    max-width: 600px;
    position: relative;
    animation: slideIn 0.3s;
}

.modal-sm {
    max-width: 400px;
}

.modal-lg {
    max-width: 800px;
}

.modal-header {
    padding: 15px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-title {
    font-size: 18px;
    font-weight: 600;
}

.close-modal {
    font-size: 24px;
    color: var(--text-light);
    cursor: pointer;
    background: none;
    border: none;
    transition: color 0.2s;
}

.close-modal:hover {
    color: var(--text-color);
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    padding: 15px 20px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* Toast notifications */
.toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1060;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    background-color: var(--bg-white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 12px 15px;
    display: flex;
    align-items: center;
    min-width: 250px;
    max-width: 350px;
    animation: slideInRight 0.3s, fadeOut 0.3s 2.7s;
    opacity: 0;
    transform: translateX(100%);
}

.toast.show {
    transform: translateX(0);
    opacity: 1;
}

.toast-icon {
    margin-right: 10px;
    font-size: 18px;
}

.toast-success .toast-icon {
    color: var(--success-color);
}

.toast-error .toast-icon {
    color: var(--danger-color);
}

.toast-info .toast-icon {
    color: var(--accent-color);
}

.toast-message {
    flex-grow: 1;
    font-size: 14px;
}

/* Progress Edit */
.progress-edit {
    margin-bottom: 20px;
}

.progress-edit label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
}

.progress-value-container {
    text-align: center;
    margin-top: 5px;
    color: var(--accent-color);
    font-weight: 500;
}

/* Progress Bar */
.progress-container {
    height: 8px;
    background-color: var(--bg-light);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
    margin-bottom: 5px;
}

.progress-bar {
    height: 100%;
    background-color: var(--accent-color);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.progress-text {
    font-size: 12px;
    color: var(--text-light);
}

/* Dark Mode */
body.dark-mode {
    --bg-light: #1a1d21;
    --bg-white: #282c34;
    --text-color: #e6e6e6;
    --text-light: #a0a0a0;
    --border-color: #3a3f48;
}

body.dark-mode .sidebar {
    background-color: #212529;
}

body.dark-mode .sidebar-header {
    background-color: #191c20;
}

body.dark-mode #searchInput {
    background-color: #3a3f48;
    border-color: #4a4f58;
    color: var(--text-color);
}

/* Responsive styles */
@media (max-width: 991px) {
    .sidebar {
        width: 0;
        box-shadow: none;
    }
    
    .sidebar.open {
        width: var(--sidebar-width);
        box-shadow: var(--shadow);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .menu-toggle {
        display: block;
    }
    
    .dashboard-summary {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    }
}

@media (max-width: 767px) {
    .form-row {
        flex-direction: column;
        gap: 15px;
    }
    
    .dashboard-summary {
        grid-template-columns: 1fr;
    }
    
    .upcoming-tasks {
        grid-template-columns: 1fr;
    }
    
    .modal-content {
        margin: 10px;
        width: calc(100% - 20px);
    }
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideIn {
    from { transform: translateY(-50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

@keyframes slideInRight {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}


/* Tambahan responsif untuk Android atau layar kecil */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.4);
    z-index: 998;
    display: none;
    pointer-events: none;
}

.sidebar-overlay.show {
    display: block;
    pointer-events: auto;
}
