@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=Inter:wght@300;400;500;600;700&display=swap');

:root {
  --bg-dark: #0A0D14;
  --bg-card: rgba(18, 23, 35, 0.75);
  --bg-card-hover: rgba(26, 33, 50, 0.85);
  --border-glass: rgba(255, 255, 255, 0.08);
  
  --primary: #00F2FE;
  --primary-glow: rgba(0, 242, 254, 0.35);
  --secondary: #4FACFE;
  --accent: #FF0844;
  --success: #10B981;
  --warning: #F59E0B;
  
  --text-main: #F8FAFC;
  --text-muted: #94A3B8;
  
  --font-heading: 'Outfit', sans-serif;
  --font-body: 'Inter', sans-serif;
}

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

body {
  background: var(--bg-dark);
  color: var(--text-main);
  font-family: var(--font-body);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  background-image: 
    radial-gradient(circle at 15% 25%, rgba(0, 242, 254, 0.08) 0%, transparent 45%),
    radial-gradient(circle at 85% 75%, rgba(79, 172, 254, 0.08) 0%, transparent 45%);
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  letter-spacing: -0.02em;
}

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

/* Glass Card Utility */
.glass-card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-glass);
  border-radius: 20px;
  padding: 2rem;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s ease, border-color 0.3s ease;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

.glass-card:hover {
  transform: translateY(-4px);
  border-color: rgba(0, 242, 254, 0.3);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4), 0 0 20px var(--primary-glow);
}

/* Navbar */
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 5%;
  border-bottom: 1px solid var(--border-glass);
  background: rgba(10, 13, 20, 0.8);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 100;
}

.logo {
  font-family: var(--font-heading);
  font-size: 1.75rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.75rem;
  border-radius: 12px;
  font-weight: 600;
  font-family: var(--font-heading);
  cursor: pointer;
  transition: all 0.25s ease;
  border: none;
  font-size: 0.95rem;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #0A0D14;
  box-shadow: 0 4px 15px var(--primary-glow);
}

.btn-primary:hover {
  transform: scale(1.03);
  box-shadow: 0 6px 20px var(--primary-glow);
}

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

.btn-outline:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--primary);
  color: var(--primary);
}

.btn-danger {
  background: rgba(255, 8, 68, 0.2);
  border: 1px solid rgba(255, 8, 68, 0.4);
  color: #FF6B8B;
}

.btn-danger:hover {
  background: #FF0844;
  color: white;
}

/* Hero Section */
.hero {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 4rem 5%;
  max-width: 1200px;
  margin: 0 auto;
}

.hero h1 {
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  line-height: 1.1;
  margin-bottom: 1.5rem;
}

.hero p {
  color: var(--text-muted);
  font-size: 1.25rem;
  max-width: 680px;
  margin-bottom: 3.5rem;
  line-height: 1.6;
}

.portals-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 2.5rem;
  width: 100%;
}

.portal-card {
  text-align: left;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 320px;
}

.portal-icon {
  width: 60px;
  height: 60px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  margin-bottom: 1.5rem;
  background: rgba(0, 242, 254, 0.1);
  border: 1px solid rgba(0, 242, 254, 0.2);
}

.portal-card h3 {
  font-size: 1.75rem;
  margin-bottom: 0.75rem;
}

.portal-card p {
  font-size: 1rem;
  margin-bottom: 2rem;
}

/* Forms */
.form-group {
  margin-bottom: 1.5rem;
  text-align: left;
}

.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.form-input {
  width: 100%;
  padding: 0.85rem 1.2rem;
  background: rgba(10, 13, 20, 0.6);
  border: 1px solid var(--border-glass);
  border-radius: 12px;
  color: var(--text-main);
  font-family: var(--font-body);
  font-size: 1rem;
  transition: all 0.25s ease;
}

.form-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 12px var(--primary-glow);
}

input[type="date"], input[type="datetime-local"], input[type="time"] {
  color-scheme: dark;
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="%2300f2fe" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="4" width="18" height="18" rx="2" ry="2"></rect><line x1="16" y1="2" x2="16" y2="6"></line><line x1="8" y1="2" x2="8" y2="6"></line><line x1="3" y1="10" x2="21" y2="10"></line></svg>') !important;
  background-repeat: no-repeat !important;
  background-position: right 1rem center !important;
  background-size: 1.25rem !important;
  position: relative;
}

input[type="date"]::-webkit-calendar-picker-indicator,
input[type="datetime-local"]::-webkit-calendar-picker-indicator,
input[type="time"]::-webkit-calendar-picker-indicator {
  opacity: 0 !important;
  cursor: pointer !important;
  width: 2.5rem !important;
}

/* Tables */
.table-container {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 16px;
  border: 1px solid var(--border-glass);
  background: rgba(10, 13, 20, 0.4);
  box-sizing: border-box;
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

th {
  padding: 1rem 1.5rem;
  font-family: var(--font-heading);
  font-size: 0.85rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border-glass);
}

td {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  font-size: 0.95rem;
}

tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

/* Badge */
.badge {
  padding: 0.35rem 0.85rem;
  border-radius: 50px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: inline-block;
}

.badge-active {
  background: rgba(16, 185, 129, 0.15);
  color: #34D399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-expired {
  background: rgba(245, 158, 11, 0.15);
  color: #FBBF24;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge-suspended {
  background: rgba(255, 8, 68, 0.15);
  color: #FF6B8B;
  border: 1px solid rgba(255, 8, 68, 0.3);
}

/* Flash Messages */
.flash-msg {
  padding: 1rem 1.5rem;
  border-radius: 12px;
  margin-bottom: 1.5rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.flash-error {
  background: rgba(255, 8, 68, 0.15);
  border: 1px solid rgba(255, 8, 68, 0.4);
  color: #FF8A9F;
}

.flash-success {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #6EE7B7;
}

/* Dashboard Layout */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2.5rem;
}

.metric-card {
  padding: 1.75rem;
}

.metric-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
}

.metric-value {
  font-size: 2.5rem;
  font-family: var(--font-heading);
  font-weight: 800;
  background: linear-gradient(135deg, #FFF, var(--primary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Responsive Navbar & Kiosk Layouts */
@media (max-width: 950px) {
  .navbar {
    flex-direction: column !important;
    gap: 1rem !important;
    padding: 1rem 3% !important;
    text-align: center;
  }
  .navbar .logo {
    flex-wrap: wrap;
    justify-content: center;
    text-align: center;
  }
  .navbar > div {
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: center !important;
    gap: 0.6rem !important;
    width: 100%;
  }
  .navbar .btn {
    margin: 0 !important;
    flex: 1;
    min-width: 130px;
    max-width: 240px;
    padding: 0.65rem 1rem !important;
    font-size: 0.9rem !important;
  }
}

/* Responsive Modals & Form Grids on Mobile Devices */
@media (max-width: 768px) {
  [id$="Modal"] {
    padding: 0.5rem !important;
    box-sizing: border-box !important;
  }
  [id$="Modal"] .glass-card {
    width: 100% !important;
    max-width: 100% !important;
    padding: 1.35rem 1rem !important;
    max-height: 92vh !important;
    overflow-y: auto !important;
    box-sizing: border-box !important;
  }
  [id$="Modal"] form div[style*="grid-template-columns"],
  [id$="Modal"] div[style*="grid-template-columns"],
  form div[style*="grid-template-columns"],
  .glass-card div[style*="grid-template-columns"] {
    grid-template-columns: 1fr !important;
    gap: 0.85rem !important;
  }
  [id$="Modal"] form div[style*="display: flex"],
  [id$="Modal"] div[style*="display: flex"] {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 0.65rem !important;
  }
  [id$="Modal"] button, [id$="Modal"] .btn, [id$="Modal"] a.btn {
    width: 100% !important;
    min-height: 44px !important;
    box-sizing: border-box !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
  }
}
