/* ==============================================================
   PRODUKSI PAKAN BUATAN - MEDIA PEMBELAJARAN INTERAKTIF
   Mata Pelajaran: Agribisnis Perikanan Air Tawar (APAT)
   SMK Negeri 1 Mundu
   ============================================================== */

:root {
  --primary: #0284c7;
  --primary-hover: #0369a1;
  --primary-light: #e0f2fe;
  --primary-dark: #075985;
  --secondary: #0d9488;
  --secondary-hover: #0f766e;
  --accent: #f59e0b;
  --accent-light: #fef3c7;
  --success: #10b981;
  --success-light: #d1fae5;
  --warning: #f59e0b;
  --danger: #ef4444;
  --danger-light: #fee2e2;

  --bg-main: #f8fafc;
  --bg-card: #ffffff;
  --bg-sidebar: #0f172a;
  --border: #e2e8f0;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-2xl: 1.5rem;
}

[data-theme="dark"] {
  --bg-main: #090d16;
  --bg-card: #131b2e;
  --bg-sidebar: #060911;
  --border: #1e293b;
  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --primary-light: #082f49;
  --accent-light: #451a03;
  --success-light: #064e3b;
  --danger-light: #450a0a;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Scrollbar Modern */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-main);
}
::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}
[data-theme="dark"] ::-webkit-scrollbar-thumb {
  background: #334155;
}

/* Header & Top Bar */
.top-header {
  background-color: var(--bg-card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: var(--shadow-sm);
}

.header-container {
  max-width: 1380px;
  margin: 0 auto;
  padding: 0.75rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand-badge {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: inherit;
}

.brand-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, #0284c7, #0d9488);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  box-shadow: 0 4px 10px rgba(2, 132, 199, 0.3);
}

.brand-title {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--primary-dark);
}
[data-theme="dark"] .brand-title {
  color: #38bdf8;
}

.brand-subtitle {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* Navigation Tabs */
.nav-bar {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  overflow-x: auto;
  padding: 0.25rem 0;
  scrollbar-width: none;
}
.nav-bar::-webkit-scrollbar {
  display: none;
}

.nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.5rem 0.85rem;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-muted);
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

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

.nav-btn.active {
  color: #ffffff;
  background-color: var(--primary);
  box-shadow: 0 2px 6px rgba(2, 132, 199, 0.35);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.action-icon-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.action-icon-btn:hover {
  background: var(--bg-main);
  color: var(--text-main);
  border-color: var(--primary);
}

/* Main Container */
.main-wrapper {
  max-width: 1380px;
  width: 100%;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 4rem;
  flex: 1;
}

/* Page View Visibility */
.page-view {
  display: none;
  animation: fadeIn 0.3s ease-out forwards;
}

.page-view.active {
  display: block;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Cards & Containers */
.glass-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.glass-card:hover {
  box-shadow: var(--shadow-md);
}

/* Hero Section */
.hero-box {
  background: linear-gradient(135deg, #0369a1 0%, #0d9488 100%);
  color: #ffffff;
  border-radius: var(--radius-2xl);
  padding: 3rem 2.25rem;
  position: relative;
  overflow: hidden;
  box-shadow: 0 15px 30px -5px rgba(2, 132, 199, 0.35);
  margin-bottom: 2rem;
}

.hero-box::before {
  content: "";
  position: absolute;
  top: -40%;
  right: -10%;
  width: 450px;
  height: 450px;
  background: radial-gradient(circle, rgba(255,255,255,0.15) 0%, rgba(255,255,255,0) 70%);
  border-radius: 50%;
  pointer-events: none;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(8px);
  padding: 0.35rem 0.9rem;
  border-radius: 9999px;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  margin-bottom: 1rem;
}

.hero-title {
  font-size: 2.25rem;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 0.75rem;
  letter-spacing: -0.02em;
}

.hero-desc {
  font-size: 1.05rem;
  max-width: 780px;
  color: #e0f2fe;
  margin-bottom: 1.75rem;
  line-height: 1.6;
}

.hero-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1.25rem;
  font-size: 0.9375rem;
  font-weight: 600;
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
  text-decoration: none;
}

.btn-primary {
  background-color: var(--primary);
  color: white;
  box-shadow: 0 4px 10px rgba(2, 132, 199, 0.25);
}
.btn-primary:hover {
  background-color: var(--primary-hover);
  transform: translateY(-1px);
}

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

.btn-accent {
  background-color: var(--accent);
  color: #1e1e1e;
  font-weight: 700;
}
.btn-accent:hover {
  background-color: #d97706;
  color: white;
}

.btn-white {
  background-color: #ffffff;
  color: #0369a1;
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
.btn-white:hover {
  background-color: #f8fafc;
  transform: translateY(-2px);
}

.btn-outline {
  background-color: transparent;
  border: 1px solid rgba(255, 255, 255, 0.5);
  color: white;
}
.btn-outline:hover {
  background-color: rgba(255, 255, 255, 0.15);
}

.btn-outline-primary {
  background-color: transparent;
  border: 1.5px solid var(--primary);
  color: var(--primary);
}
.btn-outline-primary:hover {
  background-color: var(--primary-light);
}

/* Feature Grid */
.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(310px, 1fr));
  gap: 1.25rem;
}

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

.grid-4 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

/* Steps & Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.65rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
}
.badge-blue { background: #dbeafe; color: #1e40af; }
.badge-green { background: #d1fae5; color: #065f46; }
.badge-amber { background: #fef3c7; color: #92400e; }
.badge-purple { background: #ede9fe; color: #5b21b6; }
.badge-rose { background: #ffe4e6; color: #9f1239; }

[data-theme="dark"] .badge-blue { background: #1e3a8a; color: #93c5fd; }
[data-theme="dark"] .badge-green { background: #064e3b; color: #6ee7b7; }
[data-theme="dark"] .badge-amber { background: #78350f; color: #fde68a; }
[data-theme="dark"] .badge-purple { background: #4c1d95; color: #c4b5fd; }
[data-theme="dark"] .badge-rose { background: #881337; color: #fda4af; }

/* Sub-tabs in Material */
.sub-nav {
  display: flex;
  gap: 0.5rem;
  border-bottom: 2px solid var(--border);
  margin-bottom: 1.5rem;
  overflow-x: auto;
  padding-bottom: 0.25rem;
}

.sub-tab-btn {
  padding: 0.65rem 1rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-muted);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}

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

.sub-tab-btn.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

/* Material Content Box */
.content-section {
  display: none;
}
.content-section.active {
  display: block;
}

/* Interactive Table */
.data-table-container {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  margin: 1rem 0;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
  text-align: left;
}

.data-table th {
  background-color: var(--bg-main);
  padding: 0.75rem 1rem;
  font-weight: 700;
  color: var(--text-main);
  border-bottom: 2px solid var(--border);
}

.data-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
}

.data-table tr:hover td {
  background-color: var(--primary-light);
}

/* Pearson Square Visualizer */
.pearson-grid {
  display: grid;
  grid-template-columns: 1fr 120px 1fr;
  align-items: center;
  gap: 1.5rem;
  margin: 1.5rem 0;
}

.pearson-center-box {
  width: 110px;
  height: 110px;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, #0284c7, #0369a1);
  color: white;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
  font-weight: 700;
  box-shadow: 0 8px 16px rgba(2, 132, 199, 0.3);
  position: relative;
}

/* FIFO Warehouse Visualizer */
.warehouse-bay {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
  margin: 1.5rem 0;
}

.pallet-rack {
  border: 2px dashed var(--border);
  border-radius: var(--radius-xl);
  padding: 1.25rem;
  background-color: var(--bg-card);
  transition: all 0.2s ease;
  position: relative;
}

.pallet-rack.fifo-highlight {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

.pallet-base {
  background: #d97706;
  height: 14px;
  border-radius: 4px;
  margin-top: 1rem;
  display: flex;
  align-items: center;
  justify-content: space-around;
  color: white;
  font-size: 0.65rem;
  font-weight: 700;
}

.feed-bag-item {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 0.85rem;
  margin-bottom: 0.65rem;
  background-color: var(--bg-main);
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.feed-bag-item:hover {
  transform: translateY(-2px);
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
}

/* Quiz Styles */
.quiz-option-card {
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1rem 1.25rem;
  margin-bottom: 0.75rem;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 1rem;
  background-color: var(--bg-card);
}

.quiz-option-card:hover {
  border-color: var(--primary);
  background-color: var(--primary-light);
}

.quiz-option-card.selected {
  border-color: var(--primary);
  background-color: var(--primary-light);
  box-shadow: 0 0 0 2px var(--primary);
}

.quiz-option-letter {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  border: 1.5px solid var(--border);
  color: var(--text-muted);
}

.quiz-option-card.selected .quiz-option-letter {
  background-color: var(--primary);
  color: white;
  border-color: var(--primary);
}

/* Certificate & Print Card */
.certificate-frame {
  border: 4px double #0284c7;
  border-radius: var(--radius-2xl);
  padding: 2.5rem;
  background: var(--bg-card);
  position: relative;
  box-shadow: var(--shadow-lg);
  margin: 1.5rem 0;
}

/* Media Queries */
@media (max-width: 768px) {
  .header-container {
    flex-wrap: wrap;
  }
  .nav-bar {
    order: 3;
    width: 100%;
  }
  .hero-box {
    padding: 2rem 1.25rem;
  }
  .hero-title {
    font-size: 1.75rem;
  }
  .pearson-grid {
    grid-template-columns: 1fr;
  }
  .grid-2, .grid-3 {
    grid-template-columns: 1fr;
  }
}

/* Print Friendly Styles */
@media print {
  .top-header, .nav-bar, .header-actions, .no-print {
    display: none !important;
  }
  body, .main-wrapper {
    background: white !important;
    color: black !important;
    padding: 0 !important;
    margin: 0 !important;
  }
  .glass-card, .certificate-frame {
    box-shadow: none !important;
    border: 1px solid #999 !important;
  }
}
