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

:root {
  --primary-color: #6366f1;
  --primary-dark: #4f46e5;
  --success-color: #22c55e;
  --error-color: #ef4444;
  --bg-color: #f8fafc;
  --text-color: #1e293b;
  --border-color: #e2e8f0;
  --uvc-color: #9333ea;
  --uvb-color: #3b82f6;
  --uva-color: #f59e0b;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background: linear-gradient(135deg, var(--bg-color) 0%, #e0e7ff 100%);
  color: var(--text-color);
  line-height: 1.6;
  min-height: 100vh;
}

/* Container */
.container {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  padding: 20px;
}

/* Login Card */
.login-card {
  background: white;
  border-radius: 16px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
  padding: 40px;
  width: 100%;
  max-width: 420px;
}

.logo {
  text-align: center;
  margin-bottom: 30px;
}

.uv-icon {
  display: inline-block;
  background: linear-gradient(135deg, var(--uvc-color), var(--uvb-color));
  color: white;
  width: 80px;
  height: 80px;
  border-radius: 20px;
  line-height: 80px;
  font-size: 32px;
  font-weight: bold;
  margin-bottom: 15px;
}

.logo h1 {
  font-size: 24px;
  color: var(--text-color);
  margin-bottom: 5px;
}

.subtitle {
  color: #64748b;
  font-size: 14px;
}

/* Forms */
.login-form {
  margin-top: 30px;
}

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

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: var(--text-color);
}

.form-group input {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--border-color);
  border-radius: 8px;
  font-size: 15px;
  transition: all 0.3s;
}

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

/* Buttons */
.btn-primary {
  width: 100%;
  padding: 14px;
  background: var(--primary-color);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
}

.btn-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.btn-large {
  padding: 16px;
  font-size: 18px;
}

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

/* Error Message */
.error-message {
  background: #fee2e2;
  border: 1px solid #fecaca;
  color: #991b1b;
  padding: 12px;
  border-radius: 8px;
  margin-bottom: 20px;
  font-size: 14px;
}

/* Footer Info */
.footer-info {
  margin-top: 20px;
  text-align: center;
  color: #64748b;
  font-size: 13px;
}

/* Navbar */
.navbar {
  background: white;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  padding: 15px 0;
}

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

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 18px;
}

.uv-icon-small {
  display: inline-block;
  background: linear-gradient(135deg, var(--uvc-color), var(--uvb-color));
  color: white;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  line-height: 40px;
  text-align: center;
  font-size: 16px;
  font-weight: bold;
}

.nav-user {
  display: flex;
  align-items: center;
  gap: 15px;
}

.welcome {
  color: #64748b;
  font-size: 14px;
}

.btn-logout {
  padding: 8px 16px;
  background: transparent;
  color: var(--error-color);
  border: 1px solid var(--error-color);
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.3s;
}

.btn-logout:hover {
  background: var(--error-color);
  color: white;
}

/* Main App */
.app-main {
  max-width: 1200px;
  margin: 30px auto;
  padding: 0 20px;
}

.app-container {
  background: white;
  border-radius: 16px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
  padding: 40px;
}

.app-header {
  text-align: center;
  margin-bottom: 40px;
}

.app-header h1 {
  font-size: 36px;
  margin-bottom: 10px;
  background: linear-gradient(135deg, var(--uvc-color), var(--uvb-color));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.app-header p {
  color: #64748b;
  font-size: 16px;
}

/* Simulation Panel */
.simulation-panel {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
  margin-bottom: 40px;
}

.controls-section,
.visualization-section {
  background: var(--bg-color);
  padding: 25px;
  border-radius: 12px;
}

.controls-section h2,
.visualization-section h2 {
  font-size: 20px;
  margin-bottom: 20px;
  color: var(--text-color);
}

.control-group {
  margin-bottom: 25px;
}

.control-group label {
  display: block;
  margin-bottom: 10px;
  font-weight: 500;
}

.slider {
  width: 100%;
  height: 8px;
  border-radius: 4px;
  background: var(--border-color);
  outline: none;
  -webkit-appearance: none;
}

.slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--primary-color);
  cursor: pointer;
}

.slider::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--primary-color);
  cursor: pointer;
  border: none;
}

.value-display {
  display: inline-block;
  margin-top: 8px;
  font-weight: 600;
  color: var(--primary-color);
  font-size: 18px;
}

.uv-type {
  display: block;
  margin-top: 5px;
  font-size: 14px;
  color: #64748b;
}

/* UV Display */
.uv-display {
  height: 400px;
  border-radius: 12px;
  position: relative;
  overflow: hidden;
  transition: all 0.5s;
  background: linear-gradient(135deg, #f8fafc 0%, #e0e7ff 100%);
}

.uv-display.uvc {
  background: linear-gradient(135deg, #faf5ff 0%, #ede9fe 100%);
}

.uv-display.uvb {
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
}

.uv-display.uva {
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
}

.uv-wave {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.6) 0%, transparent 70%);
  opacity: 0.5;
}

@keyframes wave {
  0%, 100% {
    transform: translate(-50%, -50%) scale(1);
  }
  50% {
    transform: translate(-50%, -50%) scale(1.2);
  }
}

.info-panel {
  position: absolute;
  bottom: 20px;
  left: 20px;
  right: 20px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  padding: 20px;
  border-radius: 8px;
}

.info-item {
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
  font-size: 14px;
}

.info-item:last-child {
  margin-bottom: 0;
}

.info-item .label {
  font-weight: 600;
  color: #64748b;
}

.info-item span:last-child {
  font-weight: 600;
  color: var(--primary-color);
}

/* Info Section */
.info-section {
  margin-top: 40px;
}

.info-section h2 {
  text-align: center;
  font-size: 24px;
  margin-bottom: 25px;
}

.info-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.info-card {
  padding: 25px;
  border-radius: 12px;
  text-align: center;
  transition: transform 0.3s;
}

.info-card:hover {
  transform: translateY(-5px);
}

.info-card.uvc {
  background: linear-gradient(135deg, #faf5ff 0%, #f3e8ff 100%);
  border: 2px solid var(--uvc-color);
}

.info-card.uvb {
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
  border: 2px solid var(--uvb-color);
}

.info-card.uva {
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
  border: 2px solid var(--uva-color);
}

.info-card h3 {
  font-size: 18px;
  margin-bottom: 10px;
}

.info-card p {
  font-size: 14px;
  color: #64748b;
}

/* Error Pages */
.error-card {
  background: white;
  border-radius: 16px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
  padding: 60px 40px;
  text-align: center;
  max-width: 500px;
}

.error-code {
  font-size: 72px;
  font-weight: bold;
  background: linear-gradient(135deg, var(--uvc-color), var(--uvb-color));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 20px;
}

.error-card h2 {
  font-size: 24px;
  margin-bottom: 15px;
}

.error-card p {
  color: #64748b;
  margin-bottom: 30px;
}

.error-stack {
  background: var(--bg-color);
  padding: 20px;
  border-radius: 8px;
  text-align: left;
  font-size: 12px;
  overflow-x: auto;
  margin: 20px 0;
}

/* Responsive */
@media (max-width: 768px) {
  .simulation-panel {
    grid-template-columns: 1fr;
  }

  .info-cards {
    grid-template-columns: 1fr;
  }

  .nav-container {
    flex-direction: column;
    gap: 15px;
  }

  .app-container {
    padding: 20px;
  }
}
