:root {
  --maroon: #800000;
  --maroon-dark: #5a0000;
  --gold: #ffd700;
  --gold-dark: #d4af37;
  --bg-light: #f4f6f9;
  --text-dark: #2c3e50;
  --card-bg: #ffffff;
  --border-color: #e2e8f0;
}

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

body {
  background-color: var(--bg-light);
  color: var(--text-dark);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* HEADER */
.school-header {
  background: linear-gradient(135deg, var(--maroon) 0%, var(--maroon-dark) 100%);
  color: white;
  padding: 18px 25px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  border-bottom: 3px solid var(--gold);
}

.header-content {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 15px;
}

.brand-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-circle {
  width: 45px;
  height: 45px;
  background-color: var(--gold);
  color: var(--maroon);
  font-weight: 800;
  font-size: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid white;
}

.school-header h1 {
  font-size: 20px;
  letter-spacing: 1px;
  color: var(--gold);
  margin-bottom: 2px;
}

.school-header .subtitle {
  font-size: 11px;
  color: #e0e0e0;
  letter-spacing: 0.5px;
}

/* USER PROFILE BADGE */
.user-badge {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 215, 0, 0.4);
  padding: 6px 14px;
  border-radius: 50px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-info {
  display: flex;
  flex-direction: column;
  text-align: right;
}

.user-label {
  font-size: 10px;
  color: var(--gold);
  text-transform: uppercase;
}

.user-name {
  font-size: 13px;
  font-weight: bold;
}

.user-email {
  font-size: 11px;
  color: #ddd;
}

.btn-logout {
  background: transparent;
  border: 1px solid #ff6b6b;
  color: #ff6b6b;
  padding: 5px 10px;
  border-radius: 4px;
  font-size: 11px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-logout:hover {
  background: #ff6b6b;
  color: white;
}

/* MAIN LAYOUT */
.main-container {
  max-width: 1100px;
  width: 100%;
  margin: 30px auto;
  padding: 0 20px;
  flex-grow: 1;
}

.card {
  background: var(--card-bg);
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  border: 1px solid var(--border-color);
  padding: 24px;
  margin-bottom: 25px;
}

/* LOGIN CARD */
.login-card {
  max-width: 480px;
  margin: 60px auto;
  text-align: center;
}

.login-banner h2 {
  color: var(--maroon);
  font-size: 18px;
  margin-bottom: 10px;
}

.login-banner p {
  font-size: 13px;
  color: #555;
  line-height: 1.5;
  margin-bottom: 25px;
}

.google-login-wrapper {
  display: flex;
  justify-content: center;
}

/* FORM STYLING */
.form-card h3 {
  color: var(--maroon);
  font-size: 16px;
  border-bottom: 2px solid var(--gold);
  padding-bottom: 8px;
  margin-bottom: 18px;
}

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

.form-group label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text-dark);
}

.form-group input[type="text"],
.form-group input[type="url"] {
  width: 100%;
  padding: 10px 12px;
  font-size: 13px;
  border: 1px solid #ccc;
  border-radius: 4px;
  outline: none;
  transition: border-color 0.2s;
}

.form-group input:focus {
  border-color: var(--maroon);
}

.slug-input-wrapper {
  display: flex;
  align-items: center;
  border: 1px solid #ccc;
  border-radius: 4px;
  overflow: hidden;
}

.slug-prefix {
  background: #eaeff5;
  padding: 10px 12px;
  font-size: 13px;
  color: #555;
  font-weight: 600;
  border-right: 1px solid #ccc;
  user-select: none;
}

.slug-input-wrapper input {
  border: none !important;
  flex-grow: 1;
}

.form-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

/* BUTTONS */
.btn {
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 600;
  border-radius: 4px;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
}

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

.btn-primary:hover {
  background: var(--maroon-dark);
}

.btn-secondary {
  background: #6c757d;
  color: white;
}

.btn-refresh {
  background: #e9ecef;
  color: var(--text-dark);
  border: 1px solid #ced4da;
}

/* CARDS GRID (MY LINKS) */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}

.section-header h3 {
  font-size: 16px;
  color: var(--maroon);
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 18px;
}

.link-card {
  background: white;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 16px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.05);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 0.2s, box-shadow 0.2s;
}

.link-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  border-color: var(--gold);
}

.link-title {
  font-size: 15px;
  font-weight: bold;
  color: var(--maroon);
  margin-bottom: 6px;
  word-break: break-word;
}

.link-original {
  font-size: 11px;
  color: #666;
  margin-bottom: 12px;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

.slug-badge-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #f8f9fa;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  padding: 8px 10px;
  margin-bottom: 14px;
}

.slug-url {
  font-size: 13px;
  font-weight: 700;
  color: #0d6efd;
  word-break: break-all;
}

.btn-copy {
  background: #eaeff5;
  border: 1px solid #cbd5e1;
  padding: 4px 8px;
  font-size: 11px;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 600;
}

.btn-copy:hover {
  background: #cbd5e1;
}

.card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px dashed #e2e8f0;
  padding-top: 12px;
  font-size: 12px;
}

.stat-counter {
  background: #fff3cd;
  color: #856404;
  padding: 4px 10px;
  border-radius: 20px;
  font-weight: bold;
  font-size: 11px;
}

.card-actions {
  display: flex;
  gap: 6px;
}

.btn-action {
  padding: 4px 8px;
  font-size: 11px;
  border-radius: 4px;
  border: none;
  cursor: pointer;
}

.btn-edit { background: #0dcaf0; color: #000; }
.btn-delete { background: #dc3545; color: #fff; }

.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 40px;
  color: #777;
  background: white;
  border-radius: 8px;
  border: 1px dashed #ccc;
}

/* FOOTER */
.school-footer {
  background: #1e293b;
  color: white;
  text-align: center;
  padding: 25px 20px;
  margin-top: auto;
  border-top: 3px solid var(--gold);
}

.btn-privacy {
  background: transparent;
  color: var(--gold);
  border: 1px solid var(--gold);
  padding: 6px 14px;
  border-radius: 4px;
  font-size: 11px;
  cursor: pointer;
  margin-bottom: 12px;
}

.copyright {
  font-size: 12px;
  margin-bottom: 4px;
}

.sub-copyright {
  font-size: 11px;
  color: #94a3b8;
}

/* MODALS */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-box {
  background: white;
  border-radius: 8px;
  max-width: 500px;
  width: 100%;
  box-shadow: 0 10px 25px rgba(0,0,0,0.3);
  overflow: hidden;
}

.modal-header {
  background: var(--maroon);
  color: white;
  padding: 14px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h4 {
  margin: 0;
  font-size: 15px;
}

.modal-close {
  background: none;
  border: none;
  color: white;
  font-size: 20px;
  cursor: pointer;
}

.modal-body {
  padding: 20px;
  font-size: 13px;
  line-height: 1.6;
  color: #444;
}

.modal-body ul {
  margin-left: 20px;
  margin-top: 10px;
  margin-bottom: 10px;
}

.modal-footer {
  background: #f8f9fa;
  padding: 12px 20px;
  display: flex;
  justify-content: flex-end;
  border-top: 1px solid #e9ecef;
}

/* RESPONSIVE */
@media (max-width: 600px) {
  .header-content {
    flex-direction: column;
    text-align: center;
  }
  .user-badge {
    width: 100%;
    justify-content: space-between;
  }
  .slug-prefix {
    font-size: 11px;
    padding: 10px 8px;
  }
}