@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
  --primary: #3b82f6;
  --primary-hover: #2563eb;
  --bg-color: #f0f4f8;
  --card-bg: #ffffff;
  --text-main: #1e293b;
  --text-muted: #64748b;
  --border-color: #e2e8f0;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --sidebar-width: 250px;
  --bottom-nav-height: 60px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Inter', sans-serif;
}

body {
  background-color: var(--bg-color);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.5;
}

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

/* Typography */
h1, h2, h3, h4 {
  font-weight: 600;
  color: var(--text-main);
}

.text-muted {
  color: var(--text-muted);
  font-size: 0.875rem;
}

/* Forms & Buttons */
.input-group {
  margin-bottom: 1rem;
}

.input-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
}

.input-control {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 0.875rem;
  outline: none;
  transition: border-color 0.2s;
  background-color: #fff;
}

.input-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-weight: 500;
  font-size: 0.875rem;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
  width: 100%;
}

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

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

/* Layout */
.app-container {
  display: flex;
  min-height: 100vh;
}

.main-content {
  flex: 1;
  padding: 2rem 3rem;
}

/* Sidebar (Desktop) */
.sidebar {
  width: var(--sidebar-width);
  background-color: var(--card-bg);
  height: 100vh;
  position: fixed;
  top: 0;
  left: 0;
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  padding: 2rem 1rem;
  z-index: 100;
}

.sidebar .logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 2rem;
  padding-left: 1rem;
  color: var(--text-main);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  color: var(--text-muted);
  font-weight: 500;
  margin-bottom: 0.5rem;
  transition: all 0.2s;
}

.nav-item:hover, .nav-item.active {
  background-color: #eff6ff;
  color: var(--primary);
}

.nav-item svg {
  width: 20px;
  height: 20px;
}

.sidebar-bottom {
  margin-top: auto;
  padding-top: 1rem;
  border-top: 1px solid var(--border-color);
}

/* Bottom Nav (Mobile) */
.bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--bottom-nav-height);
  background-color: var(--card-bg);
  border-top: 1px solid var(--border-color);
  z-index: 100;
  justify-content: space-around;
  align-items: center;
}

.bottom-nav-item {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  color: var(--text-muted);
  font-size: 0.7rem;
  font-weight: 500;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), color 0.2s ease;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  padding: 0 4px;
}

.bottom-nav-item:active {
  transform: scale(0.85);
}

.bottom-nav-item.active {
  color: var(--primary);
  animation: popNav 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes popNav {
  0% { transform: scale(1); }
  50% { transform: scale(1.15); }
  100% { transform: scale(1); }
}

.bottom-nav-item svg {
  width: 24px;
  height: 24px;
}

/* Floating Action Button (Mobile) */
.fab {
  display: none;
  position: fixed;
  bottom: calc(var(--bottom-nav-height) + 1rem);
  right: 1rem;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background-color: var(--primary);
  color: white;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
  z-index: 99;
  border: none;
  cursor: pointer;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s ease;
}

.fab:active {
  transform: scale(0.85);
  box-shadow: 0 2px 6px rgba(59, 130, 246, 0.3);
}

.fab svg {
  width: 24px;
  height: 24px;
}

/* Desktop spacing adjustment */
.has-sidebar .main-content {
  margin-left: var(--sidebar-width);
}

/* Cards */
.card {
  background-color: var(--card-bg);
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  margin-bottom: 1.5rem;
}

/* Priority Labels */
.priority-tinggi { color: var(--danger); background-color: #fee2e2; }
.priority-sedang { color: var(--warning); background-color: #fef3c7; }
.priority-rendah { color: var(--success); background-color: #d1fae5; }

.badge {
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

/* Header Dashboard */
.header-dashboard {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 2rem;
  position: relative;
  z-index: 1000;
}

.user-avatar {
  width: 40px;
  height: 40px;
  min-width: 40px;
  border-radius: 50%;
  background-color: var(--primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  flex-shrink: 0;
}

/* Progress Card */
.progress-card {
  background: linear-gradient(135deg, #2563eb, #3b82f6);
  color: white;
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 2rem;
  position: relative;
  overflow: hidden;
}
.progress-bar-bg {
  background-color: rgba(255,255,255,0.2);
  height: 8px;
  border-radius: 4px;
  margin: 1rem 0;
  width: 100%;
}
.progress-bar-fill {
  background-color: #34d399;
  height: 100%;
  border-radius: 4px;
}

/* Responsive Media Queries */
@media (max-width: 768px) {
  .sidebar {
    display: none;
  }
  
  .has-sidebar .main-content {
    margin-left: 0;
    padding: 1.5rem 1rem calc(var(--bottom-nav-height) + 1.5rem) 1rem;
  }
  
  .bottom-nav {
    display: flex;
  }
  
  .fab {
    display: flex;
  }

  /* Stats Grid Mobile styling */
  .stats-grid {
    gap: 0.75rem;
    margin-bottom: 1.5rem;
  }
  .stat-card {
    padding: 1rem 0.5rem;
  }
  .stat-value {
    font-size: 1.25rem;
  }
  .stat-label {
    font-size: 0.7rem;
  }

  /* Progress Card Mobile styling */
  .progress-card {
    padding: 1.25rem;
    margin-bottom: 1.5rem;
  }
  .progress-card > div:first-child {
    flex-wrap: wrap;
    gap: 0.75rem;
  }
  .progress-card > div:first-child > div:first-child {
    gap: 0.75rem;
  }
  .progress-card svg {
    width: 24px;
    height: 24px;
  }
  .progress-card div[style*="font-size: 2.5rem"] {
    font-size: 1.75rem !important;
  }
  .progress-badges {
    flex-wrap: wrap;
    gap: 0.35rem;
  }
  .progress-badges .badge-btn {
    font-size: 0.7rem;
    padding: 0.35rem 0.6rem;
  }

  /* Schedule and Task Cards Mobile layout */
  .schedule-card {
    padding: 1rem;
    gap: 1rem;
  }
  .schedule-time {
    padding-right: 1rem;
    min-width: 70px;
  }
  .time-start {
    font-size: 1.1rem;
  }
  .time-end {
    font-size: 0.75rem;
  }
  
  /* Modals */
  .modal-content {
    width: 95%;
    max-height: 85vh;
  }

  /* Header Dashboard Mobile */
  .header-dashboard {
    flex-wrap: wrap;
    gap: 1rem;
  }
  .header-dashboard > div:first-child {
    width: 100%;
  }
  .header-dashboard h1 {
    font-size: 1.5rem;
  }
  .header-dashboard p {
    font-size: 0.8rem;
  }
  .header-actions {
    width: 100%;
    justify-content: space-between;
  }
  .user-avatar {
    display: none !important;
  }
  .search-container {
    flex: 1;
    max-width: none;
    margin-right: 0.5rem;
  }
}

@media (max-width: 576px) {
  /* Forms & Buttons */
  .priority-group {
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
  }
  .priority-btn {
    width: 100%;
    padding: 0.6rem;
  }
  
  .grid-2 {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  /* Calendar compact styling */
  .calendar-day {
    min-height: 65px;
    padding: 0.15rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
  }
  .calendar-date {
    width: 22px;
    height: 22px;
    line-height: 22px;
    font-size: 0.8rem;
    margin-bottom: 0;
  }
  .task-indicator {
    padding: 2px;
    margin-top: 2px;
    width: 100%;
    border-radius: 4px;
  }
  .task-indicator-text {
    display: none;
  }
  .task-indicator-badge {
    display: inline-block;
    font-weight: 700;
    font-size: 0.7rem;
  }
  
  .calendar-header h2 {
    font-size: 1.25rem;
  }
  
  /* Feature grid on login screen */
  .features-grid {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }
  .feature-card {
    flex-direction: row;
    justify-content: flex-start;
    padding: 0.75rem 1rem;
    gap: 1rem;
  }
  .feature-card svg {
    margin-bottom: 0;
  }
}

/* Base styling helper classes */
.task-indicator-badge {
  display: none;
}
.task-indicator-text {
  display: inline;
}

/* Styles untuk Drag-and-Drop File Upload Card */
.file-upload-wrapper {
  margin-top: 0.5rem;
  position: relative;
}
.file-upload-card {
  border: 2px dashed var(--border-color);
  border-radius: 12px;
  background-color: white;
  padding: 1.5rem 1rem;
  text-align: center;
  position: relative;
  cursor: pointer;
  transition: border-color 0.2s ease, background-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}
.file-upload-card:hover {
  border-color: var(--primary);
  background-color: #f8fafc;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.05);
}
.file-upload-card input[type="file"] {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0 !important;
  cursor: pointer;
  z-index: 10;
}
.file-upload-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  pointer-events: none;
}
.upload-icon {
  width: 32px;
  height: 32px;
  color: var(--primary);
  margin-bottom: 0.25rem;
  transition: transform 0.2s ease;
}
.file-upload-card:hover .upload-icon {
  transform: translateY(-3px);
}
.upload-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-main);
}
.upload-subtitle {
  font-size: 0.75rem;
  color: var(--text-muted);
}
.selected-file-badge {
  margin-top: 0.75rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background-color: #ecfdf5;
  border: 1px solid #a7f3d0;
  color: var(--success);
  padding: 0.5rem 0.85rem;
  border-radius: 20px;
  font-size: 0.825rem;
  font-weight: 500;
  box-shadow: 0 2px 4px rgba(16, 185, 129, 0.05);
  animation: popIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes popIn {
  0% { transform: scale(0.9); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}
.selected-file-badge svg {
  color: var(--success);
  flex-shrink: 0;
}
.selected-file-badge span {
  max-width: 250px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.remove-file-btn {
  background: none;
  border: none;
  color: #065f46;
  font-size: 1.25rem;
  font-weight: bold;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
  margin-left: 0.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s;
}
.remove-file-btn:hover {
  color: var(--danger);
}

@media (min-width: 769px) {
  .desktop-only-flex {
    display: flex !important;
    flex-direction: column;
    justify-content: center;
  }
}

/* Premium Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(15, 23, 42, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    
    /* Hidden state for animation */
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}
.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}
.modal-content {
    background: var(--card-bg);
    border-radius: 16px;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    
    /* Hidden state for animation */
    transform: scale(0.9) translateY(20px);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.modal-overlay.active .modal-content {
    transform: scale(1) translateY(0);
}
.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.modal-header h3 {
    margin: 0;
    font-size: 1.25rem;
}
.close-modal {
    background: var(--bg-color);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-muted);
    transition: background 0.2s, color 0.2s, transform 0.2s;
}
.close-modal:hover {
    background: #e2e8f0;
    color: var(--text-main);
    transform: rotate(90deg);
}
.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    flex: 1;
}
