/* Campus App PWA Styles */
:root {
  --primary: #6366F1;
  --secondary: #EC4899;
  --accent: #8B5CF6;
  --dark: #0F172A;
  --gray: #64748B;
  --light: #F8FAFC;
  --success: #10B981;
  --warning: #F59E0B;
  --danger: #EF4444;
  --gradient: linear-gradient(135deg, #667EEA 0%, #764BA2 100%);
  --glow: 0 0 40px rgba(99, 102, 241, 0.4);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  background: linear-gradient(180deg, #0F172A 0%, #1E293B 100%);
  min-height: 100vh;
  overflow-x: hidden;
}

.app-container {
  max-width: 430px;
  margin: 0 auto;
  background: var(--light);
  min-height: 100vh;
  position: relative;
  box-shadow: 0 0 60px rgba(99, 102, 241, 0.3);
}

/* Loading Screen */
.loading-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100vh;
  background: var(--gradient);
}

.loading-logo {
  font-size: 48px;
  font-weight: 900;
  color: white;
  letter-spacing: -2px;
  margin-bottom: 30px;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid rgba(255,255,255,0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Screen Navigation */
.screen {
  display: none;
  min-height: 100vh;
  padding-bottom: 80px;
  animation: slideIn 0.3s ease;
}

.screen.active {
  display: block;
}

@keyframes slideIn {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}

/* Header */
.header {
  background: var(--gradient);
  padding: 20px;
  padding-top: 45px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}

.logo {
  font-size: 28px;
  font-weight: 900;
  color: white;
  letter-spacing: -1px;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
}

.header-actions {
  display: flex;
  gap: 15px;
}

.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  color: white;
  font-size: 18px;
}

.icon-btn:hover, .icon-btn:active {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.05);
}

.search-bar {
  background: rgba(255, 255, 255, 0.95);
  border-radius: 16px;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.search-bar input {
  border: none;
  outline: none;
  flex: 1;
  font-size: 15px;
  background: transparent;
}

/* Home Tabs */
.home-tabs {
  display: flex;
  background: white;
  padding: 10px 20px;
  gap: 20px;
  border-bottom: 2px solid #E5E7EB;
}

.home-tab {
  padding: 8px 0;
  font-weight: 600;
  color: var(--gray);
  cursor: pointer;
  border-bottom: 3px solid transparent;
  transition: all 0.3s ease;
}

.home-tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

/* Filter Pills */
.filter-container {
  padding: 15px 20px;
  display: flex;
  gap: 10px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.filter-container::-webkit-scrollbar {
  display: none;
}

.filter-pill {
  padding: 8px 16px;
  border-radius: 20px;
  background: white;
  border: 2px solid #E5E7EB;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 14px;
  font-weight: 500;
}

.filter-pill.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
  transform: scale(1.05);
}

/* Event Cards */
.events-container {
  padding: 0 15px;
}

.event-card {
  background: white;
  border-radius: 20px;
  margin-bottom: 15px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
  transition: all 0.3s ease;
  cursor: pointer;
}

.event-card:hover, .event-card:active {
  transform: translateY(-5px);
  box-shadow: 0 8px 30px rgba(99, 102, 241, 0.2);
}

.event-image {
  width: 100%;
  height: 180px;
  position: relative;
  overflow: hidden;
  background-size: cover;
  background-position: center;
}

.event-badge {
  position: absolute;
  top: 15px;
  left: 15px;
  background: rgba(255, 255, 255, 0.95);
  padding: 6px 12px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 600;
  backdrop-filter: blur(10px);
}

.special-badge {
  position: absolute;
  top: 15px;
  right: 15px;
  background: rgba(255, 255, 255, 0.95);
  padding: 6px;
  border-radius: 10px;
  font-size: 16px;
  backdrop-filter: blur(10px);
}

.live-badge {
  position: absolute;
  bottom: 15px;
  right: 15px;
  background: var(--danger);
  color: white;
  padding: 6px 12px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 600;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

.event-content {
  padding: 20px;
}

.event-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--dark);
}

.event-details {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 15px;
}

.event-detail {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--gray);
  font-size: 14px;
}

.event-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 15px;
  border-top: 1px solid #F1F5F9;
}

.attendees {
  display: flex;
  align-items: center;
  gap: 8px;
}

.attendee-avatars {
  display: flex;
  margin-right: 8px;
}

.attendee-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--gradient);
  border: 2px solid white;
  margin-left: -10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  color: white;
  font-weight: 600;
}

.attendee-avatar:first-child {
  margin-left: 0;
}

.attendee-count {
  font-size: 13px;
  color: var(--gray);
}

/* Buttons */
.btn {
  padding: 10px 20px;
  border-radius: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 14px;
  border: none;
}

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

.btn-primary:hover {
  background: var(--accent);
  transform: scale(1.05);
}

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

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

.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 2px solid var(--primary);
}

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

.btn-large {
  width: 100%;
  padding: 18px;
  background: var(--gradient);
  border-radius: 16px;
  font-size: 18px;
  font-weight: 700;
  box-shadow: 0 4px 20px rgba(99, 102, 241, 0.3);
}

.btn-large:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 30px rgba(99, 102, 241, 0.4);
}

/* Heatmap */
.heatmap-container {
  margin: 20px;
  background: white;
  border-radius: 20px;
  padding: 20px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

.heatmap-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}

.heatmap-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--dark);
}

.energy-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
}

.energy-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--success);
  animation: energyPulse 2s infinite;
}

@keyframes energyPulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.2); opacity: 0.7; }
}

.heatmap-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.heatmap-zone {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(139, 92, 246, 0.1));
  border-radius: 12px;
  padding: 15px;
  text-align: center;
  transition: all 0.3s ease;
  cursor: pointer;
}

.heatmap-zone.hot {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.2), rgba(249, 115, 22, 0.2));
}

.heatmap-zone.warm {
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.2), rgba(34, 197, 94, 0.2));
}

.zone-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--dark);
  margin-bottom: 5px;
}

.zone-count {
  font-size: 20px;
  font-weight: 700;
  color: var(--primary);
}

/* Bottom Navigation */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 430px;
  background: white;
  border-top: 1px solid #E5E7EB;
  padding: 10px 0;
  padding-bottom: calc(10px + env(safe-area-inset-bottom));
  display: flex;
  justify-content: space-around;
  align-items: center;
  z-index: 1000;
}

.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  color: var(--gray);
}

.nav-item.active {
  color: var(--primary);
}

.nav-icon {
  font-size: 22px;
}

.nav-label {
  font-size: 11px;
  font-weight: 600;
}

.create-btn {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--gradient);
  border: none;
  color: white;
  font-size: 28px;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(99, 102, 241, 0.4);
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 10px;
}

.create-btn:hover, .create-btn:active {
  transform: scale(1.1);
  box-shadow: var(--glow);
}

/* Profile Screen */
.profile-header {
  background: var(--gradient);
  padding: 30px 20px;
  padding-top: 50px;
  text-align: center;
}

.profile-avatar {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: white;
  margin: 0 auto 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}

.profile-name {
  font-size: 24px;
  font-weight: 700;
  color: white;
  margin-bottom: 5px;
}

.profile-school {
  color: rgba(255, 255, 255, 0.9);
  font-size: 15px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 15px;
  padding: 20px;
  margin-top: -30px;
}

.stat-card {
  background: white;
  border-radius: 16px;
  padding: 15px;
  text-align: center;
  box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}

.stat-value {
  font-size: 24px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 5px;
}

.stat-label {
  font-size: 12px;
  color: var(--gray);
  font-weight: 500;
}

/* Menu Section */
.menu-section {
  background: white;
  margin: 15px;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.menu-item {
  display: flex;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid #F1F5F9;
  cursor: pointer;
  transition: all 0.3s ease;
}

.menu-item:last-child {
  border-bottom: none;
}

.menu-item:hover, .menu-item:active {
  background: var(--light);
}

.menu-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: rgba(99, 102, 241, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 15px;
  font-size: 18px;
}

.menu-text {
  flex: 1;
}

.menu-title {
  font-weight: 600;
  color: var(--dark);
  font-size: 15px;
  margin-bottom: 2px;
}

.menu-subtitle {
  font-size: 12px;
  color: var(--gray);
}

.menu-arrow {
  color: var(--gray);
  font-size: 18px;
}

/* Forms */
.form-section {
  background: white;
  margin: 15px;
  padding: 20px;
  border-radius: 20px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

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

.form-label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: var(--dark);
  font-size: 14px;
}

.form-input {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid #E5E7EB;
  border-radius: 12px;
  font-size: 15px;
  transition: all 0.3s ease;
  outline: none;
}

.form-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.form-textarea {
  resize: vertical;
  min-height: 100px;
  font-family: inherit;
}

/* Event Type Grid */
.event-type-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.event-type-option {
  padding: 15px;
  border: 2px solid #E5E7EB;
  border-radius: 12px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
}

.event-type-option.selected {
  border-color: var(--primary);
  background: rgba(99, 102, 241, 0.1);
}

.event-type-icon {
  font-size: 24px;
  margin-bottom: 5px;
}

.event-type-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--dark);
}

/* Toggle Switches */
.feature-toggle {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px;
  background: var(--light);
  border-radius: 12px;
  margin-bottom: 10px;
}

.feature-info {
  flex: 1;
}

.feature-name {
  font-weight: 600;
  color: var(--dark);
  font-size: 14px;
  margin-bottom: 3px;
}

.feature-desc {
  font-size: 12px;
  color: var(--gray);
}

.toggle {
  width: 48px;
  height: 28px;
  background: #CBD5E1;
  border-radius: 14px;
  position: relative;
  cursor: pointer;
  transition: all 0.3s ease;
}

.toggle.active {
  background: var(--primary);
}

.toggle-knob {
  width: 22px;
  height: 22px;
  background: white;
  border-radius: 50%;
  position: absolute;
  top: 3px;
  left: 3px;
  transition: all 0.3s ease;
  box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.toggle.active .toggle-knob {
  left: 23px;
}

/* Modals */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 2000;
  justify-content: center;
  align-items: center;
}

.modal-overlay.show {
  display: flex;
}

.modal-content {
  background: white;
  border-radius: 20px;
  padding: 30px;
  max-width: 350px;
  width: 90%;
  text-align: center;
  animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
  from { opacity: 0; transform: scale(0.95) translateY(-20px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-close {
  position: absolute;
  top: 15px;
  right: 15px;
  width: 30px;
  height: 30px;
  border: none;
  background: transparent;
  font-size: 20px;
  cursor: pointer;
  color: var(--gray);
}

/* Bottom Sheet Modal */
.bottom-sheet {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: white;
  border-radius: 30px 30px 0 0;
  padding: 30px;
  max-width: 430px;
  margin: 0 auto;
  box-shadow: 0 -10px 40px rgba(0,0,0,0.2);
  z-index: 2000;
}

.bottom-sheet.show {
  display: block;
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

/* QR Code */
.qr-code {
  width: 200px;
  height: 200px;
  margin: 20px auto;
  padding: 20px;
  background: white;
  border: 2px solid var(--primary);
  border-radius: 20px;
}

.qr-code canvas {
  width: 100% !important;
  height: 100% !important;
}

.private-code {
  font-size: 24px;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: 2px;
  margin: 15px 0;
  padding: 15px;
  background: var(--light);
  border-radius: 12px;
}

/* Listings */
.listing-card {
  background: white;
  border-radius: 20px;
  padding: 20px;
  margin-bottom: 15px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
  cursor: pointer;
  transition: all 0.3s ease;
}

.listing-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 25px rgba(99, 102, 241, 0.15);
}

.listing-header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  margin-bottom: 15px;
}

.listing-type {
  background: var(--primary);
  color: white;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
}

.listing-price {
  font-size: 20px;
  font-weight: 700;
  color: var(--success);
}

.listing-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--dark);
  margin-bottom: 10px;
}

.listing-description {
  color: var(--gray);
  font-size: 14px;
  line-height: 1.4;
  margin-bottom: 15px;
}

.listing-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 15px;
  border-top: 1px solid #F1F5F9;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 40px;
  color: var(--gray);
}

.empty-icon {
  font-size: 48px;
  margin-bottom: 15px;
  opacity: 0.5;
}

/* Create Header */
.create-header {
  background: white;
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 15px;
  border-bottom: 1px solid #E5E7EB;
  position: sticky;
  top: 0;
  z-index: 100;
}

.back-btn {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 2px solid #E5E7EB;
  background: white;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 18px;
}

.back-btn:hover {
  background: var(--light);
  transform: scale(1.05);
}

.create-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--dark);
}

/* Ticket Tiers */
.ticket-tier {
  border: 2px solid #E5E7EB;
  border-radius: 12px;
  padding: 15px;
  margin-bottom: 15px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.ticket-tier.selected {
  border-color: var(--primary);
  background: rgba(99, 102, 241, 0.1);
}

.tier-name {
  font-weight: 600;
  color: var(--dark);
}

.tier-price {
  font-size: 18px;
  font-weight: 700;
  color: var(--primary);
}

/* Quantity Selector */
.quantity-selector {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
  margin: 20px 0;
}

.quantity-btn {
  width: 40px;
  height: 40px;
  border: 2px solid var(--primary);
  background: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-weight: 600;
  color: var(--primary);
  font-size: 20px;
}

.quantity-value {
  font-size: 18px;
  font-weight: 600;
  min-width: 30px;
  text-align: center;
}

/* Success Modal */
.success-icon {
  width: 80px;
  height: 80px;
  background: var(--success);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  font-size: 40px;
  color: white;
  animation: successPulse 0.6s ease;
}

@keyframes successPulse {
  0% { transform: scale(0); }
  50% { transform: scale(1.1); }
  100% { transform: scale(1); }
}

/* Tabs */
.tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  border-bottom: 2px solid #E5E7EB;
  padding-bottom: 10px;
}

.tab-btn {
  background: transparent;
  border: none;
  padding: 10px 20px;
  font-weight: 600;
  color: var(--gray);
  cursor: pointer;
  position: relative;
}

.tab-btn.active {
  color: var(--primary);
}

.tab-btn.active::after {
  content: '';
  position: absolute;
  bottom: -12px;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--primary);
  border-radius: 2px;
}

/* Image Upload */
.image-upload {
  border: 2px dashed #E5E7EB;
  border-radius: 12px;
  padding: 30px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
}

.image-upload:hover {
  border-color: var(--primary);
  background: rgba(99, 102, 241, 0.05);
}

.image-preview {
  width: 100%;
  height: 200px;
  border-radius: 12px;
  object-fit: cover;
  margin-top: 10px;
  display: none;
}

.image-preview.show {
  display: block;
}

/* Toast Notifications */
.toast {
  position: fixed;
  top: 60px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--dark);
  color: white;
  padding: 12px 24px;
  border-radius: 12px;
  font-weight: 500;
  z-index: 3000;
  animation: toastSlide 0.3s ease;
  max-width: 90%;
}

.toast.success {
  background: var(--success);
}

.toast.error {
  background: var(--danger);
}

@keyframes toastSlide {
  from { opacity: 0; transform: translateX(-50%) translateY(-20px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* Responsive adjustments */
@media (max-width: 430px) {
  .heatmap-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .event-type-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
