/* ==========================================================================
   RESET & GLOBAL STYLES
   ========================================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #4f46e5;
    --primary-hover: #4338ca;
    --secondary-color: #64748b;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --background: #f8fafc;
    --card-bg: #ffffff;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    --radius: 10px;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--background);
    color: var(--text-main);
    line-height: 1.6;
    padding-bottom: 50px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ==========================================================================
   NAVBAR
   ========================================================================== */
.navbar {
    background-color: var(--card-bg);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-color);
    text-decoration: none;
}

.nav-links {
    display: flex;
    gap: 20px;
}

.nav-link {
    text-decoration: none;
    color: var(--text-muted);
    font-weight: 500;
    transition: color 0.3s ease;
}

.nav-link:hover, .nav-link.active {
    color: var(--primary-color);
}

/* ==========================================================================
   HERO SECTION & ALERTS
   ========================================================================== */
.hero-section {
    padding: 40px 0 20px;
    text-align: center;
}

.hero-content h1 {
    font-size: 2.2rem;
    color: var(--text-main);
    margin-bottom: 10px;
}

.hero-content p {
    color: var(--text-muted);
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto 20px;
}

.hero-btns {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 25px;
}

.info-alert {
    background-color: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #1e40af;
    padding: 12px 20px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    gap: 12px;
    text-align: left;
    font-size: 0.9rem;
    max-width: 900px;
    margin: 0 auto;
}

/* ==========================================================================
   BUTTONS
   ========================================================================== */
.btn {
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
}

.btn-outline {
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
    background: transparent;
}

.btn-outline:hover {
    background-color: #eef2ff;
}

.btn-secondary {
    background-color: #e2e8f0;
    color: #475569;
}

.btn-secondary:hover {
    background-color: #cbd5e1;
}

.btn-danger {
    background-color: var(--danger-color);
    color: white;
}

.btn-danger:hover {
    background-color: #dc2626;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.85rem;
}

/* ==========================================================================
   STATISTICS
   ========================================================================== */
.stats-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin: 30px 0;
}

.stat-card {
    background: var(--card-bg);
    padding: 20px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 15px;
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.icon-total { background-color: #e0e7ff; color: var(--primary-color); }
.icon-submitted { background-color: #d1fae5; color: var(--success-color); }
.icon-pending { background-color: #fef3c7; color: var(--warning-color); }
.icon-late { background-color: #fee2e2; color: var(--danger-color); }

.stat-info h3 {
    font-size: 1.5rem;
    line-height: 1.2;
}

.stat-info p {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* ==========================================================================
   SECTIONS & GRID CARDS
   ========================================================================== */
.section {
    margin-top: 40px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 20px;
}

.filter-controls {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.search-box {
    position: relative;
    width: 250px;
}

.search-box i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.search-box input {
    width: 100%;
    padding: 8px 12px 8px 35px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-family: inherit;
    outline: none;
}

.filter-select {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-family: inherit;
    outline: none;
    background: white;
}

.grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

.tugas-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    border: 1px solid var(--border-color);
    transition: transform 0.2s, box-shadow 0.2s;
}

.tugas-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.tugas-header {
    margin-bottom: 12px;
}

.matkul-tag {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--primary-color);
    background: #eef2ff;
    padding: 3px 8px;
    border-radius: 4px;
    margin-bottom: 5px;
}

.tugas-title {
    font-size: 1.1rem;
    color: var(--text-main);
}

.tugas-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 15px;
}

.tugas-meta {
    font-size: 0.8rem;
    background: #f8fafc;
    padding: 10px;
    border-radius: 6px;
    margin-bottom: 15px;
}

.tugas-meta div {
    margin-bottom: 4px;
}

.tugas-meta div:last-child {
    margin-bottom: 0;
}

.countdown {
    font-weight: 600;
    color: var(--danger-color);
}

.badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    display: inline-block;
}

.badge-belum { background: #fef3c7; color: #92400e; }
.badge-sudah { background: #d1fae5; color: #065f46; }
.badge-terlambat { background: #fee2e2; color: #991b1b; }

/* ==========================================================================
   TABLE PENGUMPULAN SAYA
   ========================================================================== */
.table-responsive {
    overflow-x: auto;
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.9rem;
}

.table th, .table td {
    padding: 15px;
    border-bottom: 1px solid var(--border-color);
}

.table th {
    background-color: #f1f5f9;
    color: var(--text-main);
    font-weight: 600;
}

.table-actions {
    display: flex;
    gap: 6px;
}

.empty-state {
    text-align: center;
    padding: 40px 20px;
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.empty-icon {
    font-size: 3rem;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.hidden {
    display: none !important;
}

/* ==========================================================================
   MODAL & FORM
   ========================================================================== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 1000;
}

.modal.show {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    background: white;
    width: 90%;
    max-width: 500px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

.modal-lg { max-width: 800px; }
.modal-sm { max-width: 400px; }

.modal-header {
    padding: 15px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.close-modal {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-muted);
}

.modal-body, form#form-upload {
    padding: 20px;
    overflow-y: auto;
}

.form-group {
    margin-bottom: 15px;
}

.form-row {
    display: flex;
    gap: 15px;
}

.form-row .form-group {
    flex: 1;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 5px;
}

.required { color: var(--danger-color); }

.form-control {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-family: inherit;
    outline: none;
}

.form-control:focus {
    border-color: var(--primary-color);
}

.file-input-hidden { display: none; }

.file-drop-zone {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius);
    padding: 25px;
    text-align: center;
    cursor: pointer;
    background: #fafafa;
    transition: background 0.2s;
}

.file-drop-zone:hover, .file-drop-zone.dragover {
    background: #f0f4ff;
    border-color: var(--primary-color);
}

.drop-icon {
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 5px;
}

.file-info-text {
    font-size: 0.75rem;
    color: var(--text-muted);
    display: block;
    margin-top: 5px;
}

.file-selected {
    margin-top: 8px;
    font-size: 0.85rem;
    color: var(--primary-color);
    font-weight: 500;
}

.modal-footer {
    padding: 15px 20px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    background: #f8fafc;
}

/* ==========================================================================
   TOAST NOTIFICATION
   ========================================================================== */
.toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    background: #333;
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: slideIn 0.3s forwards, fadeOut 0.3s 2.7s forwards;
}

.toast-success { background: #10b981; }
.toast-danger { background: #ef4444; }
.toast-warning { background: #f59e0b; }

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

/* Media Queries */
@media (max-width: 768px) {
    .form-row { flex-direction: column; gap: 0; }
    .hero-content h1 { font-size: 1.75rem; }
    .section-header { flex-direction: column; align-items: stretch; }
    .filter-controls { flex-direction: column; }
    .search-box { width: 100%; }
}

/* Opsi 2 Styling */
.matkul-header {
    text-align: center;
    font-family: 'Poppins', sans-serif;
    margin-bottom: 20px;
}

.matkul-header .sub-heading {
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 1.5px;
    color: #4f46e5;
    margin-bottom: 4px;
    text-transform: uppercase;
}

.matkul-header .main-heading {
    font-size: 1.5rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
}