/* Style CSS for SMAN 1 Dolok Panribuan */
:root {
  --primary-color: #1e3a8a;
  --secondary-color: #0284c7;
  --accent-color: #f59e0b;
  --bg-color: #f8fafc;
  --card-bg: #ffffff;
  --text-color: #1e293b;
  --text-muted: #64748b;
  --border-color: #e2e8f0;
  --header-height: 70px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--bg-color);
  color: var(--text-color);
  line-height: 1.6;
  overflow-x: hidden;
}

/* Header & Navigation */
header {
  background-color: var(--primary-color);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.header-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 1rem;
  height: var(--header-height);
}

.brand-logo {
  font-size: 1.25rem;
  font-weight: 700;
  color: #fff;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
}

.brand-logo span {
  color: var(--accent-color);
}

nav ul {
  display: flex;
  list-style: none;
  gap: 1.2rem;
}

nav a {
  color: #f1f5f9;
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  transition: color 0.2s ease;
  padding: 0.5rem 0;
}

nav a:hover, nav a.active {
  color: var(--accent-color);
  border-bottom: 2px solid var(--accent-color);
}

.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  color: #fff;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 5px;
}

/* Main Container */
main {
  max-width: 1200px;
  margin: 2rem auto;
  padding: 0 1rem;
  min-height: calc(100vh - 250px);
}

.page-header {
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  color: white;
  padding: 2.5rem 1.5rem;
  border-radius: 12px;
  margin-bottom: 2rem;
  box-shadow: 0 4px 12px rgba(30, 58, 138, 0.15);
}

.page-header h1 {
  font-size: 1.8rem;
  margin-bottom: 0.5rem;
}

.page-header p {
  color: #e0f2fe;
  font-size: 1rem;
}

.card {
  background: var(--card-bg);
  border-radius: 10px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  border: 1px solid var(--border-color);
  box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}

.card h2 {
  color: var(--primary-color);
  font-size: 1.3rem;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid #f1f5f9;
}

/* Grid & Layouts */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
}

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

.stat-card {
  background: #f0f9ff;
  border-left: 4px solid var(--secondary-color);
  padding: 1.2rem;
  border-radius: 6px;
}

.stat-card .val {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--primary-color);
  margin-top: 0.3rem;
}

.stat-card .label {
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* Tables & Cards for Mobile */
.table-responsive {
  width: 100%;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
}

th, td {
  padding: 12px 15px;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

th {
  background-color: #f1f5f9;
  color: var(--primary-color);
  font-weight: 600;
}

.badge {
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  display: inline-block;
}

.badge-a { background: #dcfce7; color: #166534; }
.badge-b { background: #e0f2fe; color: #075985; }

/* Partner Links (SEO Backlinks) */
#random-links {
  margin-top: 2rem;
  padding: 1.5rem;
  background: #fff;
  border-radius: 10px;
  border: 1px solid var(--border-color);
}

#random-links h3 {
  font-size: 1.1rem;
  color: var(--primary-color);
  margin-bottom: 1rem;
}

.partner-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.partner-grid a {
  display: inline-block;
  padding: 6px 14px;
  background: #f8fafc;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  color: var(--text-color);
  text-decoration: none;
  font-size: 0.9rem;
  transition: all 0.2s;
}

.partner-grid a:hover {
  background: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
}

/* Footer */
footer {
  background-color: var(--primary-color);
  color: #94a3b8;
  text-align: center;
  padding: 1.5rem;
  margin-top: 3rem;
  font-size: 0.9rem;
}

footer p {
  color: #cbd5e1;
}

/* Responsive Styles */
@media (max-width: 768px) {
  .mobile-menu-btn {
    display: block;
  }

  nav {
    display: none;
    position: absolute;
    top: var(--header-height);
    left: 0;
    width: 100%;
    background-color: var(--primary-color);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3);
    padding: 1rem 0;
  }

  nav.show {
    display: block;
  }

  nav ul {
    flex-direction: column;
    gap: 0;
  }

  nav a {
    display: block;
    padding: 0.8rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }

  nav a:hover, nav a.active {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background-color: rgba(255, 255, 255, 0.05);
  }

  .brand-logo {
    font-size: 1rem;
  }

  /* Responsive Table to Cards conversion */
  .responsive-card-table table, 
  .responsive-card-table thead, 
  .responsive-card-table tbody, 
  .responsive-card-table th, 
  .responsive-card-table td, 
  .responsive-card-table tr { 
    display: block; 
  }

  .responsive-card-table thead tr { 
    position: absolute;
    top: -9999px;
    left: -9999px;
  }

  .responsive-card-table tr {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 1rem;
    padding: 10px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
  }

  .responsive-card-table td { 
    border: none;
    border-bottom: 1px solid #f1f5f9; 
    position: relative;
    padding-left: 45%;
    text-align: right;
    font-size: 0.9rem;
  }

  .responsive-card-table td:last-child {
    border-bottom: none;
  }

  .responsive-card-table td:before { 
    position: absolute;
    top: 12px;
    left: 10px;
    width: 40%; 
    padding-right: 10px; 
    white-space: nowrap;
    text-align: left;
    font-weight: bold;
    color: var(--primary-color);
    content: attr(data-label);
  }
}
