/* ==========================================================================
   PILKETOS SMK NEGERI 1 TONJONG - DESIGN SYSTEM & MOBILE FIRST STYLES
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
  /* Color Palette - Royal Blue & Electric Theme */
  --primary: #1E40AF;
  --primary-hover: #1D4ED8;
  --primary-light: #EFF6FF;
  --accent: #4F46E5;
  --cyan: #0EA5E9;
  --gold: #F59E0B;
  --emerald: #10B981;
  --rose: #F43F5E;
  
  /* Neutral Shades */
  --bg-main: #F8FAFC;
  --card-bg: #FFFFFF;
  --text-main: #0F172A;
  --text-muted: #64748B;
  --border-color: #E2E8F0;
  
  /* Glassmorphism & Elevation */
  --glass-bg: rgba(255, 255, 255, 0.85);
  --glass-border: rgba(255, 255, 255, 0.4);
  --shadow-sm: 0 2px 4px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 10px 25px -5px rgba(30, 64, 175, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 20px 35px -10px rgba(15, 23, 42, 0.15);
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Base Reset & Typography */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  -webkit-tap-highlight-color: transparent;
}

body {
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  background-image: 
    radial-gradient(at 0% 0%, rgba(30, 64, 175, 0.08) 0px, transparent 50%),
    radial-gradient(at 100% 100%, rgba(14, 165, 233, 0.08) 0px, transparent 50%);
}

a {
  text-decoration: none;
  color: inherit;
}

/* Header & Mobile Sticky Navbar */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  padding: 0.75rem 1rem;
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand-wrapper {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand-logo {
  width: 44px;
  height: 44px;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
}

.brand-text h1 {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--primary);
  line-height: 1.2;
  letter-spacing: -0.02em;
}

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

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

/* Banner / Welcome Hero Section */
.hero-banner {
  background: linear-gradient(135deg, #1E40AF 0%, #3B82F6 50%, #4F46E5 100%);
  border-radius: var(--radius-lg);
  padding: 1.75rem 1.25rem;
  color: #FFFFFF;
  margin-bottom: 2rem;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

.hero-banner::after {
  content: '';
  position: absolute;
  right: -20px;
  bottom: -40px;
  width: 200px;
  height: 200px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  pointer-events: none;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(8px);
  padding: 0.35rem 0.85rem;
  border-radius: 50px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
}

.hero-title {
  font-size: 1.4rem;
  font-weight: 800;
  line-height: 1.3;
  margin-bottom: 0.5rem;
}

.hero-sub {
  font-size: 0.875rem;
  opacity: 0.9;
  line-height: 1.5;
}

/* Candidate Grid (Mobile Optimized) */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.section-title {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.candidate-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

@media (min-width: 640px) {
  .candidate-grid {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  }
}

/* Candidate Card */
.candidate-card {
  background: var(--card-bg);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: var(--transition);
  position: relative;
}

.candidate-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: rgba(30, 64, 175, 0.3);
}

.card-media {
  position: relative;
  width: 100%;
  padding-top: 70%; /* Aspect ratio */
  background: #E2E8F0;
  overflow: hidden;
}

.card-media img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.candidate-card:hover .card-media img {
  transform: scale(1.03);
}

.card-num-badge {
  position: absolute;
  top: 1rem;
  left: 1rem;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--card-bg);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  font-weight: 900;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  border: 3px solid #FFFFFF;
  z-index: 2;
}

.card-body {
  padding: 1.25rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.candidate-tagline {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--primary);
  background: var(--primary-light);
  padding: 0.25rem 0.65rem;
  border-radius: 6px;
  margin-bottom: 0.75rem;
}

.candidate-pair-names {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.3;
  margin-bottom: 0.5rem;
}

.candidate-pair-classes {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.vision-preview {
  font-size: 0.85rem;
  color: #475569;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 1.25rem;
}

/* Card Action Footer */
.card-actions {
  margin-top: auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 700;
  cursor: pointer;
  border: none;
  outline: none;
  transition: var(--transition);
  min-height: 44px; /* Mobile touch target standard */
  text-align: center;
}

.btn-primary {
  background: var(--primary);
  color: #FFFFFF;
  box-shadow: 0 4px 12px rgba(30, 64, 175, 0.25);
}

.btn-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
}

.btn-outline {
  background: transparent;
  border: 1.5px solid var(--border-color);
  color: var(--text-main);
}

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

.btn-success {
  background: var(--emerald);
  color: #FFFFFF;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.25);
}

.btn-danger {
  background: var(--rose);
  color: #FFFFFF;
}

.btn-block {
  width: 100%;
}

/* Modal Drawer (Mobile Friendly Bottom Sheet & Desktop Centered) */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  z-index: 999;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  background: var(--card-bg);
  width: 100%;
  max-width: 600px;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  max-height: 90vh;
  overflow-y: auto;
  padding: 1.5rem;
  box-shadow: var(--shadow-lg);
  transform: translateY(100%);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@media (min-width: 768px) {
  .modal-overlay {
    align-items: center;
  }
  .modal-content {
    border-radius: var(--radius-lg);
    transform: scale(0.95);
  }
  .modal-overlay.active .modal-content {
    transform: scale(1);
  }
}

.modal-overlay.active .modal-content {
  transform: translateY(0);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 1.25rem;
}

.modal-title {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--text-main);
}

.modal-close {
  background: #F1F5F9;
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  color: var(--text-muted);
  cursor: pointer;
}

.modal-body {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.modal-section-title {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.modal-text {
  font-size: 0.9rem;
  line-height: 1.6;
  white-space: pre-line;
  color: #334155;
  background: #F8FAFC;
  padding: 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid #F1F5F9;
}

/* User Profile Pill Navbar */
.user-profile-badge {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: #F1F5F9;
  padding: 0.4rem 0.85rem;
  border-radius: 50px;
  font-size: 0.8rem;
  font-weight: 700;
}

.user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--primary);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-width: 90vw;
}

.toast {
  background: #0F172A;
  color: #FFFFFF;
  padding: 0.85rem 1.25rem;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  font-size: 0.875rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  animation: slideInRight 0.3s ease;
}

.toast-success { background: #064E3B; border-left: 4px solid #10B981; }
.toast-error { background: #4C0519; border-left: 4px solid #F43F5E; }

@keyframes slideInRight {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* Digital Voting Receipt Card */
.receipt-card {
  background: #FFFFFF;
  border-radius: var(--radius-lg);
  border: 2px dashed #CBD5E1;
  padding: 2rem 1.5rem;
  text-align: center;
  box-shadow: var(--shadow-md);
  position: relative;
}

.receipt-icon {
  width: 72px;
  height: 72px;
  background: #DEF7EC;
  color: #03543F;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.2rem;
  margin: 0 auto 1rem auto;
}

.receipt-code {
  font-family: monospace;
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  background: #F1F5F9;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  display: inline-block;
  color: var(--primary);
  margin: 1rem 0;
}

.receipt-details {
  text-align: left;
  background: #F8FAFC;
  padding: 1.25rem;
  border-radius: var(--radius-sm);
  margin: 1.25rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  font-size: 0.875rem;
}

.receipt-row {
  display: flex;
  justify-content: space-between;
  border-bottom: 1px solid #E2E8F0;
  padding-bottom: 0.4rem;
}

.receipt-row:last-child {
  border-bottom: none;
}

.receipt-row span:first-child {
  color: var(--text-muted);
}
.receipt-row span:last-child {
  font-weight: 700;
  color: var(--text-main);
}
