/* style.css - Clean Glassmorphism Theme */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
  --gold-primary: #e5a928;
  --gold-secondary: #fcd367;
  --bg-overlay: rgba(5, 7, 15, 0.65);
  --glass-bg: rgba(255, 255, 255, 0.08);
  --glass-border: rgba(255, 255, 255, 0.18);
  --glass-hover: rgba(255, 255, 255, 0.15);
  --text-main: #ffffff;
  --text-muted: #d0d7e2;
  --shadow-main: 0 20px 50px rgba(0, 0, 0, 0.6);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Plus Jakarta Sans', sans-serif;
  -webkit-tap-highlight-color: transparent;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  color: var(--text-main);
  background-color: #0c0f1d;
  background-image: url('background.png');
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  background-repeat: no-repeat;
  position: relative;
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  background-color: var(--bg-overlay);
  z-index: -1;
}

.glass {
  background: var(--glass-bg);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-main);
  border-radius: 20px;
}

/* NAVBAR */
header {
  position: sticky;
  top: 15px;
  z-index: 100;
  padding: 0 20px;
}

.navbar {
  max-width: 1150px;
  margin: 0 auto;
  padding: 0.6rem 1.8rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 70px;
}

.logo {
  display: flex;
  align-items: center;
  text-decoration: none;
}

.logo img {
  max-height: 58px;
  max-width: 240px;
  width: auto;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.6));
  transition: transform 0.3s ease;
}

.logo img:hover {
  transform: scale(1.04);
}

.nav-links {
  display: flex;
  gap: 0.8rem;
  list-style: none;
}

.nav-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.6rem 1.3rem;
  border-radius: 12px;
  transition: all 0.3s ease;
  white-space: nowrap;
}

.nav-links a:hover, .nav-links a.active {
  color: var(--text-main);
  background: var(--glass-hover);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

/* LAYOUT & CARDS */
.container {
  max-width: 1050px;
  width: 90%;
  margin: 40px auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.card {
  width: 100%;
  padding: 3rem 2.5rem;
  text-align: center;
}

h1 {
  font-size: 2.5rem;
  font-weight: 800;
  margin-bottom: 1rem;
  color: #ffffff;
  text-shadow: 0 4px 15px rgba(0, 0, 0, 0.7);
  letter-spacing: -0.5px;
}

h2 {
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 0.8rem;
  color: #ffffff;
}

p.subtitle {
  color: var(--text-muted);
  font-size: 1.05rem;
  line-height: 1.7;
  max-width: 680px;
  margin: 0 auto 2.2rem auto;
}

/* BUTTONS */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--gold-primary), var(--gold-secondary));
  color: #111;
  padding: 0.95rem 2.2rem;
  border: none;
  border-radius: 14px;
  font-weight: 800;
  font-size: 1rem;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 8px 25px rgba(229, 169, 40, 0.35);
}

.btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 35px rgba(229, 169, 40, 0.5);
}

.btn-danger {
  background: linear-gradient(135deg, #ef4444, #dc2626) !important;
  color: white !important;
  box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3) !important;
}

.btn-success {
  background: linear-gradient(135deg, #10b981, #059669) !important;
  color: white !important;
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3) !important;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

/* FORMS */
.form-card { text-align: left; }

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.2rem;
}

.form-group { margin-bottom: 1rem; }

label {
  display: block;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

input, select {
  width: 100%;
  padding: 0.9rem 1rem;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  color: #fff;
  font-size: 0.95rem;
  outline: none;
  transition: all 0.3s ease;
}

input:focus, select:focus {
  border-color: var(--gold-primary);
  box-shadow: 0 0 15px rgba(229, 169, 40, 0.25);
  background: rgba(0, 0, 0, 0.6);
}

option { background: #121624; color: #fff; }

/* TABLES */
.table-card { text-align: left; }

.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 8px;
  min-width: 500px;
}

th {
  padding: 0.9rem 1.1rem;
  color: var(--text-muted);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.78rem;
  letter-spacing: 1px;
  text-align: left;
}

td {
  padding: 1rem 1.1rem;
  background: rgba(255, 255, 255, 0.04);
  border-top: 1px solid var(--glass-border);
  border-bottom: 1px solid var(--glass-border);
  font-size: 0.92rem;
}

td:first-child {
  border-left: 1px solid var(--glass-border);
  border-top-left-radius: 12px;
  border-bottom-left-radius: 12px;
}

td:last-child {
  border-right: 1px solid var(--glass-border);
  border-top-right-radius: 12px;
  border-bottom-right-radius: 12px;
}

tr:hover td { background: var(--glass-hover); }

.badge {
  display: inline-block;
  padding: 0.35rem 0.8rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
}
.badge-admin { background: rgba(239, 68, 68, 0.25); color: #f87171; border: 1px solid rgba(239, 68, 68, 0.4); }
.badge-racer { background: rgba(245, 158, 11, 0.25); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.4); }

/* GRID JADWAL & MODAL */
.schedule-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
  width: 100%;
}

.schedule-card {
  text-align: left;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.schedule-tag {
  color: var(--gold-primary);
  font-weight: 800;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 0.5rem;
}

.modal-overlay {
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 15px;
}

.modal-content {
  max-width: 520px;
  width: 100%;
  position: relative;
  text-align: left;
}

.close-modal {
  position: absolute;
  top: 20px; right: 25px;
  font-size: 1.8rem;
  color: var(--text-muted);
  cursor: pointer;
}

.close-modal:hover { color: #fff; }

.alert {
  padding: 1rem;
  border-radius: 12px;
  margin-bottom: 1.5rem;
  font-weight: 600;
  font-size: 0.9rem;
  display: none;
  text-align: center;
}
.alert-success { background: rgba(16, 185, 129, 0.2); border: 1px solid #10b981; color: #34d399; }
.alert-error { background: rgba(239, 68, 68, 0.2); border: 1px solid #ef4444; color: #f87171; }

footer {
  text-align: center;
  padding: 2rem;
  color: var(--text-muted);
  font-size: 0.85rem;
  border-top: 1px solid var(--glass-border);
  margin-top: auto;
}

@media (max-width: 768px) {
  header { padding: 0 10px; top: 10px; }
  .navbar { flex-direction: column; gap: 0.8rem; padding: 0.8rem 1rem; }
  .logo img { max-height: 48px; }
  .nav-links { gap: 0.3rem; width: 100%; justify-content: center; }
  .nav-links a { padding: 0.5rem 0.85rem; font-size: 0.85rem; }
  .container { width: 94%; margin: 20px auto; }
  .card { padding: 2rem 1.25rem; }
  h1 { font-size: 1.8rem; }
  p.subtitle { font-size: 0.95rem; }
  .btn { width: 100%; }
}