* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary: #6366f1;
  --primary-dark: #4f46e5;
  --secondary: #8b5cf6;
  --success: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;
  --dark: #1e293b;
  --light: #f1f5f9;
  --white: #ffffff;
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  color: var(--dark);
}

/* Auth Pages */
.auth-container {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  padding: 20px;
}

.auth-card {
  background: var(--white);
  border-radius: 20px;
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 450px;
  padding: 40px;
  animation: slideUp 0.5s ease;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.auth-logo {
  text-align: center;
  margin-bottom: 30px;
}

.auth-logo h1 {
  font-size: 2.5rem;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  -moz-text-fill-color: transparent;
  color: transparent;
  font-weight: 800;
}

.auth-logo p {
  color: #64748b;
  margin-top: 8px;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: var(--dark);
}

.form-control {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid #e2e8f0;
  border-radius: 10px;
  font-size: 1rem;
  transition: all 0.3s;
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.form-check {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 15px 0;
}

.btn {
  padding: 12px 24px;
  border: none;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  text-decoration: none;
  display: inline-block;
  text-align: center;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: var(--white);
  width: 100%;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.btn-secondary {
  background: var(--light);
  color: var(--dark);
}

.btn-success {
  background: var(--success);
  color: var(--white);
}

.btn-danger {
  background: var(--danger);
  color: var(--white);
}

.btn-sm {
  padding: 8px 16px;
  font-size: 0.875rem;
}

.auth-links {
  text-align: center;
  margin-top: 20px;
}

.auth-links a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
}

/* Dashboard Layout */
.dashboard {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 280px;
  background: var(--white);
  box-shadow: var(--shadow);
  position: fixed;
  height: 100vh;
  overflow-y: auto;
  transition: transform 0.3s;
}

.sidebar-header {
  padding: 30px 20px;
  text-align: center;
  border-bottom: 2px solid var(--light);
}

.sidebar-header h2 {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  -moz-text-fill-color: transparent;
  color: transparent;
  font-size: 1.8rem;
}

.profile-section {
  padding: 20px;
  text-align: center;
  border-bottom: 2px solid var(--light);
}

.profile-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 10px;
  font-size: 2rem;
  color: var(--white);
  font-weight: 700;
}

.nav-menu {
  padding: 20px 0;
}

.nav-item {
  padding: 15px 25px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--dark);
  text-decoration: none;
  transition: all 0.3s;
  border-left: 3px solid transparent;
}

.nav-item:hover,
.nav-item.active {
  background: var(--light);
  border-left-color: var(--primary);
  color: var(--primary);
}

.nav-icon {
  font-size: 1.2rem;
}

.main-content {
  flex: 1;
  margin-left: 280px;
  padding: 30px;
}

.top-bar {
  background: var(--white);
  padding: 20px 30px;
  border-radius: 15px;
  box-shadow: var(--shadow);
  margin-bottom: 30px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.class-id-badge {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: var(--white);
  padding: 10px 20px;
  border-radius: 10px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

/* Cards Grid */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 25px;
  margin-top: 20px;
}

.card {
  background: var(--white);
  border-radius: 15px;
  padding: 25px;
  box-shadow: var(--shadow);
  transition: all 0.3s;
  position: relative;
  overflow: hidden;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
}

.card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  margin-bottom: 15px;
}

.card-title {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--dark);
}

.card-subtitle {
  color: #64748b;
  margin-top: 5px;
  font-size: 0.9rem;
}

.card-actions {
  display: flex;
  gap: 10px;
}

.icon-btn {
  width: 35px;
  height: 35px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s;
  border: none;
  background: var(--light);
}

.icon-btn:hover {
  background: var(--primary);
  color: var(--white);
}

.add-card {
  border: 2px dashed #cbd5e1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  cursor: pointer;
  transition: all 0.3s;
}

.add-card:hover {
  border-color: var(--primary);
  background: rgba(99, 102, 241, 0.05);
}

.add-icon {
  font-size: 3rem;
  color: var(--primary);
  margin-bottom: 10px;
}

/* Groups */
.groups-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.group-card {
  background: var(--white);
  border-radius: 12px;
  padding: 20px;
  box-shadow: var(--shadow);
  position: relative;
}

.group-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
  padding-bottom: 15px;
  border-bottom: 2px solid var(--light);
}

.group-number {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: var(--white);
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.2rem;
}

.members-list {
  margin: 15px 0;
}

.member-item {
  background: var(--light);
  padding: 10px;
  border-radius: 8px;
  margin-bottom: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.member-info h4 {
  font-size: 0.95rem;
  margin-bottom: 3px;
}

.member-info p {
  font-size: 0.8rem;
  color: #64748b;
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  animation: fadeIn 0.3s;
}

.modal.show {
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-content {
  background: var(--white);
  border-radius: 15px;
  padding: 30px;
  width: 90%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  animation: slideUp 0.3s;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 2px solid var(--light);
}

.close-btn {
  font-size: 1.5rem;
  cursor: pointer;
  color: #64748b;
  background: none;
  border: none;
}

/* Alert */
.alert {
  padding: 15px 20px;
  border-radius: 10px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.alert-success {
  background: #d1fae5;
  color: #065f46;
  border-left: 4px solid var(--success);
}

.alert-danger {
  background: #fee2e2;
  color: #991b1b;
  border-left: 4px solid var(--danger);
}

.alert-warning {
  background: #fef3c7;
  color: #92400e;
  border-left: 4px solid var(--warning);
}

/* Badge */
.badge {
  display: inline-block;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
}

.badge-primary {
  background: var(--primary);
  color: var(--white);
}

.badge-success {
  background: var(--success);
  color: var(--white);
}

/* Responsive */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.active {
    transform: translateX(0);
  }

  .main-content {
    margin-left: 0;
  }

  .cards-grid {
    grid-template-columns: 1fr;
  }

  .groups-container {
    grid-template-columns: 1fr;
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Tambahan untuk kompatibilitas gradient text */
.gradient-text {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  -moz-text-fill-color: transparent;
  color: transparent;
}

/* Style untuk toggle sidebar mobile (jika diperlukan) */
.mobile-menu-toggle {
  display: none;
  position: fixed;
  top: 20px;
  left: 20px;
  z-index: 1001;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 10px 15px;
  cursor: pointer;
  font-size: 1.2rem;
}

@media (max-width: 768px) {
  .mobile-menu-toggle {
    display: block;
  }

  .top-bar {
    flex-direction: column;
    gap: 15px;
    align-items: flex-start;
  }

  .auth-card {
    padding: 25px;
  }
}
