/* Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --upn-red: #945dc5;
  --upn-red-light: #a370d1;
  --upn-red-dark: #854fc0;
  --gray-dark: #2d3748;
  --gray-medium: #4a5568;
  --gray-light: #e2e8f0;
  --gray-lighter: #f7fafc;
  --white: #ffffff;
  --black: #000000;
  --success: #38a169;
  --warning: #d69e2e;
  --error: #e53e3e;
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  --border-radius: 12px;
  --border-radius-sm: 8px;
  --transition: all 0.3s ease;
}

html,
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background: var(--gray-lighter);
  color: var(--gray-dark);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow: hidden;
  height: 100vh;
  width: 100vw;
}
.modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.modal.active {
  display: flex;
}

.qr-modal-content {
  position: relative;
  background: white;
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  animation: zoomIn 0.3s ease;
}

.qr-modal-content img {
  max-width: 300px;
  border-radius: 10px;
  border: 2px solid #ccc;
}

.close-btn {
  position: absolute;
  top: 8px;
  right: 12px;
  font-size: 28px;
  font-weight: bold;
  color: #ff4d4f;
  cursor: pointer;
  transition: transform 0.2s, color 0.2s;
}

.close-btn:hover {
  color: #fff;
  background: #ff4d4f;
  border-radius: 50%;
  transform: scale(1.2);
  padding: 2px 6px;
}

@keyframes zoomIn {
  from { transform: scale(0.8); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
#app {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100%;
  max-width: 480px;
  height: 100vh;
  max-height: 900px;
  background: var(--white);
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border-radius: var(--border-radius);
}

/* Screen Management */
.screen {
  width: 100%;
  height: 100%;
  display: none;
  flex-direction: column;
}

.screen.active {
  display: flex;
}

/* Login screen */
#login-screen {
  background: linear-gradient(135deg, var(--upn-red) 0%, var(--upn-red-dark) 100%);
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.login-container {
  width: 100%;
  max-width: 400px;
}

.login-header {
  text-align: center;
  margin-bottom: 3rem;
  color: var(--white);
}

.logo {
  text-align: center;
  margin-bottom: 2rem;
}

.logo-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
  display: block;
}

.logo h1 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.logo p {
  opacity: 0.9;
  font-size: 1rem;
}

.login-form {
  background: var(--white);
  padding: 2rem;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-lg);
  margin-bottom: 2rem;
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: var(--gray-dark);
}

.form-group input,
.form-group select {
  width: 100%;
  padding: 1rem;
  border: 2px solid var(--gray-light);
  border-radius: var(--border-radius-sm);
  font-size: 1rem;
  transition: var(--transition);
  background: var(--white);
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--upn-red);
  box-shadow: 0 0 0 3px rgba(148, 93, 197, 0.2);
}

.form-hint {
  display: block;
  margin-top: 0.5rem;
  font-size: 0.875rem;
  color: var(--gray-medium);
}

.login-footer {
  text-align: center;
  color: rgba(255, 255, 255, 0.8);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 1rem 1.5rem;
  border: none;
  border-radius: var(--border-radius-sm);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
}

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

.btn-primary:hover {
  background: var(--upn-red-dark);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.btn-secondary {
  background: var(--gray-light);
  color: var(--gray-dark);
}

.btn-secondary:hover {
  background: var(--gray-medium);
  color: var(--white);
}

.btn-full {
  width: 100%;
}

.btn-icon {
  font-size: 1.2rem;
}

/* Main App Layout */
.app-header {
  background: var(--upn-red);
  color: var(--white);
  padding: 1rem;
  flex-shrink: 0;
}

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

.header-content h1 {
  font-size: 1.25rem;
  font-weight: 600;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.header-btn {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: var(--white);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}

.header-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.1);
}

.header-btn.active {
  background: rgba(255, 255, 255, 0.4);
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}

.app-main {
  flex: 1;
  overflow-y: auto;
  padding-bottom: 80px; /* Space for bottom nav */
}

.content-screen {
  display: none;
  padding: 1.5rem;
}

.content-screen.active {
  display: block;
}

/* Dashboard */
.welcome-card {
  background: linear-gradient(135deg, var(--upn-red) 0%, var(--upn-red-light) 100%);
  color: var(--white);
  padding: 2rem;
  border-radius: var(--border-radius);
  margin-bottom: 2rem;
  text-align: center;
}

.welcome-card h2 {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.status-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 1rem;
  opacity: 0.9;
}

.status-dot {
  width: 8px;
  height: 8px;
  background: #4ade80;
  border-radius: 50%;
  animation: pulse 2s infinite;
}

.quick-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 2rem;
}

.action-card {
  background: var(--white);
  padding: 1.5rem;
  border-radius: var(--border-radius);
  text-align: center;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: var(--transition);
  border: 2px solid transparent;
}

.action-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--upn-red);
}

.action-icon {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  display: block;
}

.action-card h3 {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
  color: var(--gray-dark);
}

.action-card p {
  color: var(--gray-medium);
  font-size: 0.9rem;
}

.recent-activity h3 {
  margin-bottom: 1rem;
  color: var(--gray-dark);
}

.activity-list {
  background: var(--white);
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.activity-item {
  padding: 1rem;
  border-bottom: 1px solid var(--gray-light);
  display: flex;
  align-items: center;
  gap: 1rem;
}

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

.activity-icon {
  font-size: 1.5rem;
  width: 40px;
  height: 40px;
  background: var(--gray-lighter);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.activity-info h4 {
  font-size: 0.9rem;
  margin-bottom: 0.25rem;
  color: var(--gray-dark);
}

.activity-info p {
  font-size: 0.8rem;
  color: var(--gray-medium);
}

/* QR Scanner */
.scanner-container {
  text-align: center;
  padding: 2rem 0;
}

.scanner-frame {
  width: 250px;
  height: 250px;
  margin: 2rem auto;
  position: relative;
  background: var(--gray-dark);
  border-radius: var(--border-radius);
  overflow: hidden;
}

.scanner-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.scanner-line {
  width: 80%;
  height: 2px;
  background: var(--upn-red);
  animation: scanLine 2s ease-in-out infinite;
  box-shadow: 0 0 10px var(--upn-red);
}

.scanner-corners {
  position: absolute;
  top: 20px;
  left: 20px;
  right: 20px;
  bottom: 20px;
}

.corner {
  position: absolute;
  width: 20px;
  height: 20px;
  border: 3px solid var(--upn-red);
}

.corner.top-left {
  top: 0;
  left: 0;
  border-right: none;
  border-bottom: none;
}
.corner.top-right {
  top: 0;
  right: 0;
  border-left: none;
  border-bottom: none;
}
.corner.bottom-left {
  bottom: 0;
  left: 0;
  border-right: none;
  border-top: none;
}
.corner.bottom-right {
  bottom: 0;
  right: 0;
  border-left: none;
  border-top: none;
}

.scanner-instructions {
  margin: 2rem 0;
}
.scanner-instructions h3 {
  margin-bottom: 0.5rem;
  color: var(--gray-dark);
}
.scanner-actions {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 300px;
  margin: 0 auto;
}

/* Reserve Form */
.reserve-container {
  max-width: 400px;
  margin: 0 auto;
}
.reserve-container h2 {
  text-align: center;
  margin-bottom: 2rem;
  color: var(--gray-dark);
}
.reserve-form {
  background: var(--white);
  padding: 2rem;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
}

/* History */
.history-container h2 {
  text-align: center;
  margin-bottom: 2rem;
  color: var(--gray-dark);
}
.history-filters {
  margin-bottom: 2rem;
}
.history-filters select {
  width: 100%;
  padding: 1rem;
  border: 2px solid var(--gray-light);
  border-radius: var(--border-radius-sm);
  background: var(--white);
  font-size: 1rem;
}
.history-list {
  background: var(--white);
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.history-item {
  padding: 1rem;
  border-bottom: 1px solid var(--gray-light);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.history-item:last-child {
  border-bottom: none;
}
.history-info h4 {
  font-size: 1rem;
  margin-bottom: 0.25rem;
  color: var(--gray-dark);
}
.history-info p {
  font-size: 0.875rem;
  color: var(--gray-medium);
}
.history-status {
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
}
.status-success {
  background: rgba(56, 161, 105, 0.1);
  color: var(--success);
}
.status-pending {
  background: rgba(245, 1, 1, 0.1);
  color: var(--pending);
}
/* Profile */
.profile-container {
  max-width: 400px;
  margin: 0 auto;
}
.profile-header {
  text-align: center;
  background: var(--white);
  padding: 2rem;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  margin-bottom: 2rem;
}
.profile-avatar {
  width: 80px;
  height: 80px;
  background: var(--upn-red);
  color: var(--white);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  margin: 0 auto 1rem;
}
.profile-header h2 {
  margin-bottom: 0.5rem;
  color: var(--gray-dark);
}
.profile-header p {
  color: var(--gray-medium);
}
.info-card {
  background: var(--white);
  padding: 1.5rem;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  margin-bottom: 1rem;
}
.info-card h3 {
  margin-bottom: 1rem;
  color: var(--upn-red);
  font-size: 1.1rem;
}
.info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--gray-light);
}
.info-row:last-child {
  border-bottom: none;
}
.info-label {
  font-weight: 600;
  color: var(--gray-medium);
}
.profile-actions {
  margin-top: 2rem;
}

/* Bottom Navigation */
.bottom-nav {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  background: var(--white);
  border-top: 1px solid var(--gray-light);
  display: flex;
  padding: 0.5rem 0;
  box-shadow: 0 -4px 6px -1px rgba(0, 0, 0, 0.05);
  flex-shrink: 0;
}

.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.5rem;
  background: none;
  border: none;
  cursor: pointer;
  transition: var(--transition);
  color: var(--gray-medium);
}

.nav-item.active,
.nav-item:hover {
  color: var(--upn-red);
}
.nav-icon {
  font-size: 1.5rem;
  margin-bottom: 0.25rem;
}
.nav-label {
  font-size: 0.75rem;
  font-weight: 500;
}

/* Modals */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.modal.active {
  display: flex;
}
.modal-content {
  background: var(--white);
  border-radius: var(--border-radius);
  max-width: 400px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: modalSlideIn 0.3s ease-out;
}
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem;
  border-bottom: 1px solid var(--gray-light);
}
.modal-header h3 {
  color: var(--gray-dark);
}
.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--gray-medium);
  padding: 0.25rem;
}
.modal-body {
  padding: 1.5rem;
}
.modal-actions {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--gray-light);
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
}
.text-center {
  text-align: center;
}
.success-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
  color: var(--success);
}

/* Help Content */
.help-content {
  max-width: 500px;
}

.help-header {
  background: var(--upn-red);
  color: var(--white);
  border-radius: var(--border-radius) var(--border-radius) 0 0;
}

.help-section {
  margin-bottom: 1.5rem;
}

.help-section h3 {
  color: var(--upn-red);
  margin-bottom: 0.5rem;
  font-size: 1.1rem;
}

.help-list {
  list-style: none;
  padding-left: 0;
}

.help-list li {
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--gray-light);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.help-list li:last-child {
  border-bottom: none;
}

.help-icon {
  font-size: 1.2rem;
  width: 30px;
  text-align: center;
}

/* Animations */
@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}
@keyframes scanLine {
  0% {
    transform: translateY(-125px);
  }
  100% {
    transform: translateY(125px);
  }
}
@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: scale(0.9) translateY(20px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* Responsive Design */
@media (max-width: 480px) {
  #app {
    max-width: 100%;
    height: 100vh;
    border-radius: 0;
  }
  .content-screen {
    padding: 1rem;
  }
  .quick-actions {
    grid-template-columns: 1fr;
  }
}

/* Dark Theme */
body.dark-theme {
  --gray-lighter: #1a202c;
  --white: #2d3748;
  --gray-light: #4a5568;
  --gray-dark: #e2e8f0;
  --gray-medium: #a0aec0;
  background: #1a202c;
  color: #e2e8f0;
}

body.dark-theme #app,
body.dark-theme .modal-content {
  background: #2d3748;
}

body.dark-theme .action-card,
body.dark-theme .activity-list,
body.dark-theme .info-card,
body.dark-theme .reserve-form,
body.dark-theme .history-list,
body.dark-theme .profile-header {
  background: #4a5568;
}

/* Font Sizes */
body.font-small {
  font-size: 14px;
}

body.font-medium {
  font-size: 16px;
}

body.font-large {
  font-size: 18px;
}

body.font-xlarge {
  font-size: 20px;
}
