@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700&display=swap');

:root {
  --primary: #0d47a1;
  --primary-dark: #062b6c;
  --accent: #ffc107;
  --text: #1f2933;
  --muted: #6b7280;
  --bg: #f5f7fb;
  --card: #ffffff;
  --border: #e5e7eb;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Poppins', Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}

body.require-auth {
  min-height: 100vh;
}

body.user-login {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
  background: radial-gradient(circle at top, rgba(13, 71, 161, 0.12), transparent 45%),
    radial-gradient(circle at bottom, rgba(255, 193, 7, 0.18), transparent 35%), var(--bg);
}

img {
  max-width: 100%;
  display: block;
}

a {
  text-decoration: none;
  color: inherit;
}

header.hero {
  background: linear-gradient(120deg, rgba(13, 71, 161, 0.85), rgba(30, 136, 229, 0.85)),
              url('https://1.bp.blogspot.com/-3-deGbpxr58/XvP67qoE-iI/AAAAAAAABKU/TwFwqe6nmTIH9fZIypR8QbAefNcV8CWpgCK4BGAsYHg/s720/FB_IMG_15930474825921655.jpg') center/cover no-repeat;
  color: #fff;
  padding: 48px 0 80px;
  position: relative;
  background-attachment: fixed;
  min-height: 500px;
  display: flex;
  align-items: center;
  margin-left: 280px;
  width: calc(100% - 280px);
}

header.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(120deg, rgba(13, 71, 161, 0.75), rgba(30, 136, 229, 0.75));
  z-index: 0;
}

header.hero .container {
  position: relative;
  z-index: 1;
  width: 100%;
}

.container {
  width: min(1200px, 92%);
  margin: 0 auto;
}

/* Sidebar Menu untuk User */
.sidebar {
  width: 280px;
  background: linear-gradient(180deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: #fff;
  min-height: 100vh;
  position: fixed;
  left: 0;
  top: 0;
  padding: 0;
  box-shadow: 4px 0 20px rgba(0, 0, 0, 0.15);
  z-index: 100;
  display: flex;
  flex-direction: column;
}

.sidebar__brand {
  font-size: 1.5rem;
  font-weight: 700;
  padding: 28px 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.05);
}

.sidebar__brand i {
  font-size: 1.8rem;
  color: var(--accent);
}

.sidebar__nav {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px 12px;
  flex: 1;
}

.sidebar__nav li {
  margin: 0;
}

.sidebar__nav a {
  padding: 14px 18px;
  border-radius: 12px;
  color: rgba(255, 255, 255, 0.85);
  font-weight: 500;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 14px;
  transition: all 0.3s ease;
  position: relative;
  text-decoration: none;
}

.sidebar__nav a i {
  width: 20px;
  text-align: center;
  font-size: 1.1rem;
  opacity: 0.9;
}

.sidebar__nav a::before {
  content: '';
  width: 4px;
  height: 0;
  background: var(--accent);
  border-radius: 0 4px 4px 0;
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  transition: height 0.3s ease;
}

.sidebar__nav a:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  transform: translateX(4px);
  padding-left: 22px;
}

.sidebar__nav a.active {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.sidebar__nav a.active::before {
  height: 60%;
}

.sidebar__nav a.active:hover {
  transform: translateX(0);
  padding-left: 18px;
}

/* Icon hover effects */
.sidebar__nav a:hover i,
.sidebar__nav a.active i {
  opacity: 1;
  transform: scale(1.1);
  color: var(--accent);
}

/* Sidebar Footer */
.sidebar__footer {
  padding: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.1);
  margin-top: auto;
}

.sidebar__user {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
}

.sidebar__user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--primary-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.sidebar__user-info {
  flex: 1;
  min-width: 0;
}

.sidebar__user-name {
  font-weight: 600;
  font-size: 0.9rem;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar__user-role {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.7);
  margin-top: 2px;
}

.sidebar__logout {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 10px;
  color: rgba(255, 255, 255, 0.85);
  font-weight: 500;
  font-size: 0.9rem;
  text-decoration: none;
  transition: all 0.3s ease;
  background: rgba(220, 38, 38, 0.2);
  border: 1px solid rgba(220, 38, 38, 0.3);
}

.sidebar__logout i {
  font-size: 1.2rem;
  margin-right: 8px;
}

.sidebar__logout:hover {
  background: rgba(220, 38, 38, 0.3);
  color: #fff;
  transform: translateX(4px);
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
  display: none;
  background: var(--primary);
  border: none;
  color: #fff;
  padding: 12px 16px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1.2rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  transition: all 0.3s ease;
  z-index: 1001;
  position: fixed;
  top: 16px;
  left: 16px;
}

.mobile-menu-toggle:hover {
  background: var(--primary-dark);
  transform: scale(1.05);
}

/* Layout dengan sidebar */
.layout-with-sidebar {
  margin-left: 280px;
  padding: 32px;
  width: calc(100% - 280px);
  min-height: 100vh;
}

/* Nav untuk header (jika masih digunakan) */
.nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 48px;
  gap: 24px;
}

.nav__logo {
  font-weight: 700;
  font-size: 1.4rem;
  letter-spacing: 0.04em;
}

.nav__menu {
  display: none; /* Hidden karena menggunakan sidebar */
}

.nav__actions {
  display: none; /* Hidden karena menggunakan sidebar */
}

.hero__content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 32px;
  align-items: center;
}

.hero__title {
  font-size: clamp(2rem, 4vw, 3rem);
  margin-bottom: 16px;
}

.hero__subtitle {
  font-size: 1.05rem;
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 24px;
}

.hero__cta {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.btn {
  border: none;
  border-radius: 999px;
  padding: 14px 28px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.btn-primary {
  background: var(--accent);
  color: #1b2838;
}

.btn-outline {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.7);
  color: #fff;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2);
}

.section {
  padding: 80px 0;
}


.section__header {
  text-align: center;
  margin-bottom: 48px;
}

.section__title {
  font-size: 2rem;
  margin-bottom: 12px;
}

.section__subtitle {
  color: var(--muted);
  max-width: 680px;
  margin: 0 auto;
}

.grid {
  display: grid;
  gap: 24px;
}

.grid-3 {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.card {
  background: var(--card);
  border-radius: 18px;
  padding: 24px;
  box-shadow: 0 25px 60px rgba(15, 32, 68, 0.08);
  border: 1px solid rgba(13, 71, 161, 0.08);
}

.features__icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: rgba(13, 71, 161, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  color: var(--primary);
  margin-bottom: 16px;
}

.stats {
  background: #fff;
  border-radius: 24px;
  padding: 32px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 32px;
  margin-top: -48px;
  box-shadow: 0 25px 50px rgba(15, 23, 42, 0.1);
}

.stats__item {
  text-align: center;
}

.stats__value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary);
}

.stats__label {
  color: var(--muted);
}

.highlight {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 32px;
  align-items: center;
}

.table-wrapper {
  overflow-x: auto;
  background: var(--card);
  border-radius: 18px;
  box-shadow: 0 20px 45px rgba(15, 32, 68, 0.08);
  border: 1px solid rgba(13, 71, 161, 0.08);
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 640px;
}

th,
td {
  padding: 16px 20px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

th {
  background: rgba(13, 71, 161, 0.05);
  font-size: 0.85rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
}

tr:hover td {
  background: rgba(13, 71, 161, 0.04);
}

.filter-group {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.filter-group input,
.filter-group select {
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 12px 18px;
  font-size: 0.95rem;
  background: #fff;
}

.badge {
  padding: 6px 12px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 0.85rem;
}

.badge-positive {
  background: rgba(16, 185, 129, 0.15);
  color: #065f46;
}

.badge-neutral {
  background: rgba(59, 130, 246, 0.15);
  color: #1d4ed8;
}

.contact-card {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
  align-items: center;
}

.contact-card address {
  font-style: normal;
  color: var(--muted);
  line-height: 1.6;
}

.contact-card form {
  display: grid;
  gap: 16px;
}

.contact-card input,
.contact-card textarea {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px 16px;
  font-family: inherit;
}

footer {
  background: var(--primary-dark);
  color: rgba(255, 255, 255, 0.85);
  padding: 32px 0;
  text-align: center;
  margin-top: 48px;
}

footer p {
  margin: 0;
  font-size: 0.9rem;
}

.login-student-card {
  width: min(960px, 100%);
  background: #fff;
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 40px 80px rgba(15, 32, 68, 0.15);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  position: relative;
}

.login-student__visual {
  background: linear-gradient(160deg, var(--primary), #1e88e5);
  color: #fff;
  padding: 48px 36px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}

.login-student__visual h2 {
  font-size: 2rem;
  line-height: 1.3;
}

.login-student__visual p {
  opacity: 0.85;
  margin-top: 12px;
}

.login-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 28px;
}

.login-pill {
  padding: 6px 16px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.login-pill--muted {
  color: var(--primary);
  border-color: rgba(13, 71, 161, 0.25);
  background: rgba(13, 71, 161, 0.08);
}

.login-student__form {
  padding: 48px 40px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.login-feature-list {
  margin-top: 24px;
  list-style: none;
  display: grid;
  gap: 12px;
}

.login-feature-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.95rem;
}

.login-feature-list li::before {
  content: '';
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid #fff;
}

.login-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 32px;
}

.login-stat {
  background: rgba(255, 255, 255, 0.14);
  border-radius: 16px;
  padding: 16px;
  text-align: center;
}

.login-stat strong {
  display: block;
  font-size: 1.5rem;
}

.login-stat span {
  font-size: 0.85rem;
  opacity: 0.8;
}

.login-cred-hint {
  padding: 14px 18px;
  background: rgba(13, 71, 161, 0.08);
  border: 1px solid rgba(13, 71, 161, 0.12);
  border-radius: 16px;
  font-size: 0.9rem;
  color: var(--primary);
  line-height: 1.5;
}

.login-student__form h1 {
  font-size: 1.8rem;
}

.student-login-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.student-login-form label {
  font-weight: 600;
  margin-bottom: 6px;
}

.student-login-form input {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px 16px;
  font-size: 1rem;
}

.student-login-form button {
  border: none;
  border-radius: 14px;
  background: linear-gradient(120deg, var(--primary), var(--primary-dark));
  color: #fff;
  padding: 14px 18px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 18px 36px rgba(13, 71, 161, 0.25);
  transition: transform 0.15s ease;
}

.student-login-form button:hover {
  transform: translateY(-1px);
}

.student-login-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.9rem;
  color: var(--muted);
}

.student-login-meta a {
  color: var(--primary);
  font-weight: 600;
}

.login-footer {
  text-align: center;
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 16px;
}

/* Mobile Menu Toggle */
.mobile-nav-toggle {
  display: none;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #fff;
  padding: 10px 14px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1.2rem;
}

.mobile-nav-toggle:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* Alert Messages */
.alert {
  padding: 14px 18px;
  border-radius: 12px;
  margin-bottom: 20px;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 12px;
  animation: slideDown 0.3s ease;
}

.alert-error {
  background: #fee;
  color: #c33;
  border: 1px solid #fcc;
}

.alert-success {
  background: #efe;
  color: #3a3;
  border: 1px solid #cfc;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Smooth Transitions */
* {
  transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

/* Better Focus States */
input:focus,
select:focus,
textarea:focus,
button:focus {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* Improved Card Hover */
.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 20px 50px rgba(15, 32, 68, 0.12);
}

/* Better Responsive Design */
@media (max-width: 1024px) {
  .hero__content {
    grid-template-columns: 1fr;
  }

  .highlight {
    grid-template-columns: 1fr;
  }

  .stats {
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
  }
}

@media (max-width: 768px) {
  .nav {
    flex-wrap: wrap;
    gap: 12px;
  }

  .nav__menu {
    display: none;
    width: 100%;
    flex-direction: column;
    gap: 8px;
    margin-top: 16px;
  }

  .nav__menu.active {
    display: flex;
  }

  .mobile-nav-toggle {
    display: block;
  }

  .nav__actions {
    flex-wrap: wrap;
    gap: 8px;
  }

  .hero__cta {
    width: 100%;
    flex-direction: column;
  }

  .btn {
    width: 100%;
    text-align: center;
  }

  .login-student-card {
    grid-template-columns: 1fr;
    margin: 16px;
  }

  .login-student__visual {
    padding: 32px 24px;
  }

  .login-student__form {
    padding: 32px 24px;
  }

  .login-topbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .login-stats {
    grid-template-columns: 1fr;
  }

  .stats {
    grid-template-columns: 1fr;
    gap: 20px;
    padding: 24px;
    margin-top: -32px;
  }

  .section {
    padding: 48px 0;
  }

  .table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  table {
    font-size: 0.85rem;
    min-width: 600px;
  }

  th, td {
    padding: 12px 14px;
  }
}

@media (max-width: 1024px) {
  .sidebar {
    position: fixed;
    left: -280px;
    top: 0;
    z-index: 1000;
    transition: left 0.3s ease;
    height: 100vh;
    overflow-y: auto;
  }

  .sidebar.active {
    left: 0;
  }

  .mobile-menu-toggle {
    display: block;
  }

  .layout-with-sidebar {
    margin-left: 0;
    width: 100%;
    padding: 24px 18px 48px;
  }

  header.hero {
    margin-left: 0;
    width: 100%;
    padding: 32px 0 60px;
  }

  .page-header {
    margin-top: 60px;
  }
}

@media (max-width: 768px) {
  header.hero {
    background-attachment: scroll;
    min-height: 400px;
  }
  
  .card img {
    height: 250px !important;
  }
}

@media (max-width: 480px) {
  .hero {
    padding: 32px 0 60px;
  }
  
  header.hero {
    background-attachment: scroll;
  }

  .hero__title {
    font-size: 1.75rem;
  }

  .hero__subtitle {
    font-size: 0.95rem;
  }

  .section__title {
    font-size: 1.5rem;
  }

  .stats__value {
    font-size: 1.5rem;
  }

  .card {
    padding: 18px;
  }

  .nav__logo {
    font-size: 1.2rem;
  }

  .nav__student {
    font-size: 0.9rem;
  }

  .logout-btn {
    padding: 6px 14px;
    font-size: 0.85rem;
  }
}

