/* RESET & VARIABLE DEFINITION */
:root {
  --primary-color: #8b0000;
  --secondary-color: #d9534f;
  --accent-color: #d4af37;
  --bg-color: #f4f5f7;
  --card-bg: #ffffff;
  --text-dark: #2c3e50;
  --text-muted: #6c757d;
  --border-radius: 8px;
  --transition-speed: 0.3s;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
  background-color: var(--bg-color);
  color: var(--text-dark);
  line-height: 1.6;
}

.container {
  max-width: 1200px;
  margin: 20px auto;
  padding: 0 15px;
}

/* NAVIGATION */
.navbar {
  background-color: var(--primary-color);
  color: white;
  padding: 15px 30px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.nav-brand {
  font-size: 1.2rem;
  font-weight: bold;
  letter-spacing: 1px;
}

.nav-links {
  list-style: none;
  display: flex;
  gap: 15px;
}

.nav-links a {
  color: white;
  text-decoration: none;
  font-size: 0.9rem;
  transition: color var(--transition-speed);
}

.nav-links a:hover {
  color: var(--accent-color);
}

.nav-user {
  display: flex;
  align-items: center;
  gap: 15px;
}

/* CARDS & LAYOUT */
.card {
  background: var(--card-bg);
  padding: 20px;
  border-radius: var(--border-radius);
  box-shadow: 0 2px 5px rgba(0,0,0,0.05);
  margin-bottom: 20px;
  border-left: 4px solid var(--primary-color);
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
}

.grid-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  margin-top: 15px;
}

.progress-bar-container {
  background: #e0e0e0;
  border-radius: 20px;
  height: 20px;
  width: 100%;
  margin: 10px 0;
  overflow: hidden;
}

.progress-bar {
  background: var(--primary-color);
  height: 100%;
  color: white;
  text-align: center;
  font-size: 0.8rem;
  line-height: 20px;
  transition: width 0.4s ease;
}

/* BUTTONS */
.btn-primary {
  background-color: var(--primary-color);
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: var(--border-radius);
  cursor: pointer;
  font-weight: bold;
  transition: background var(--transition-speed);
}

.btn-primary:hover {
  background-color: #6a0000;
}

.btn-danger {
  background-color: #dc3545;
  color: white;
  border: none;
  padding: 8px 15px;
  border-radius: var(--border-radius);
  cursor: pointer;
}

.btn-block {
  width: 100%;
}

.btn-logout {
  background: transparent;
  border: 1px solid white;
  color: white;
  padding: 5px 10px;
  border-radius: 4px;
  cursor: pointer;
}

/* AUTHENTICATION */
.auth-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 80vh;
}

.auth-card {
  background: white;
  padding: 30px;
  border-radius: var(--border-radius);
  box-shadow: 0 8px 16px rgba(0,0,0,0.1);
  width: 100%;
  max-width: 420px;
}

.auth-tabs {
  display: flex;
  margin-bottom: 20px;
  border-bottom: 2px solid #ddd;
}

.auth-tab-btn {
  flex: 1;
  padding: 10px;
  border: none;
  background: none;
  cursor: pointer;
  font-weight: bold;
  color: var(--text-muted);
}

.auth-tab-btn.active {
  color: var(--primary-color);
  border-bottom: 3px solid var(--primary-color);
}

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

.form-group label {
  display: block;
  margin-bottom: 5px;
  font-weight: 600;
}

.form-group input, .form-group select, .text-essay {
  width: 100%;
  padding: 10px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 0.95rem;
}

.password-input-container {
  position: relative;
}

.btn-toggle-pw {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
}

/* SUB NAVIGATION MATERI */
.sub-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
}

.sub-btn {
  background: #e0e0e0;
  border: none;
  padding: 8px 16px;
  border-radius: 20px;
  cursor: pointer;
  font-weight: 600;
}

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

/* INTERACTIVE COMPONENTS */
.timeline-vertical {
  border-left: 3px solid var(--primary-color);
  padding-left: 20px;
  margin-left: 10px;
}

.tl-item {
  margin-bottom: 20px;
  position: relative;
}

.tl-date {
  font-weight: bold;
  color: var(--primary-color);
}

.interactive-timeline {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin: 20px 0;
  flex-wrap: wrap;
}

.tl-node {
  flex: 1;
  background: #fff;
  border: 2px solid var(--primary-color);
  padding: 15px 10px;
  border-radius: var(--border-radius);
  cursor: pointer;
  font-weight: bold;
  text-align: center;
}

.map-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 20px 0;
}

.map-region {
  padding: 20px;
  color: white;
  font-weight: bold;
  border: none;
  border-radius: var(--border-radius);
  cursor: pointer;
  text-align: left;
}

.reg-sumatra { background-color: #2c3e50; }
.reg-jawa { background-color: #8b0000; }
.reg-timur { background-color: #16a085; }

.info-card-box {
  background: #eef2f5;
  padding: 20px;
  border-radius: var(--border-radius);
  margin-top: 15px;
}

/* POLICY CARDS */
.policy-card {
  background: white;
  padding: 15px;
  border-radius: var(--border-radius);
  box-shadow: 0 2px 4px rgba(0,0,0,0.08);
}

.card-icon {
  font-size: 1.8rem;
  color: var(--primary-color);
  margin-bottom: 10px;
}

/* FLOWCHART & INFOGRAPHICS */
.flowchart-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-top: 20px;
}

.flow-step {
  background: white;
  border: 2px solid var(--primary-color);
  padding: 12px 20px;
  border-radius: var(--border-radius);
  width: 100%;
  max-width: 500px;
  text-align: center;
  font-weight: bold;
}

.flow-arrow {
  font-size: 1.2rem;
  color: var(--primary-color);
}

.infographic-box {
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
}

.info-step {
  flex: 1;
  min-width: 200px;
  background: white;
  padding: 20px;
  border-radius: var(--border-radius);
  text-align: center;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.info-step i {
  font-size: 2rem;
  color: var(--primary-color);
  margin-bottom: 10px;
}

/* TABLES */
.table-responsive {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 15px;
  background: white;
}

.data-table th, .data-table td {
  border: 1px solid #ddd;
  padding: 12px;
  text-align: left;
}

.data-table th {
  background-color: var(--primary-color);
  color: white;
}

/* SCORE & FEEDBACK */
.score-card {
  text-align: center;
  background: white;
  padding: 40px;
  border-radius: var(--border-radius);
}

.score-icon {
  font-size: 4rem;
  color: var(--accent-color);
}

.score-display {
  font-size: 2rem;
  font-weight: bold;
  margin: 20px 0;
}

.security-note {
  background: #fff3cd;
  color: #856404;
  padding: 10px;
  border-radius: 4px;
  margin: 15px 0;
  font-size: 0.85rem;
}

.feedback-msg {
  margin-top: 10px;
  font-weight: bold;
}

.dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

/* MODAL */
.modal {
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0,0,0,0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 2000;
}

.modal-content {
  background: white;
  padding: 25px;
  border-radius: var(--border-radius);
  max-width: 600px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
}

.close-modal {
  float: right;
  font-size: 1.5rem;
  cursor: pointer;
}

/* RESPONSIVE DESIGN */
@media (max-width: 768px) {
  .navbar {
    flex-direction: column;
    gap: 10px;
  }
  .nav-links {
    flex-wrap: wrap;
    justify-content: center;
  }
  .interactive-timeline {
    flex-direction: column;
  }
}