html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

html {
  position: relative;
  min-height: 100%;
}

body {
  margin-bottom: 60px;
}

@media (min-width: 1400px) {
  .container {
    max-width: 1920px;
  }
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
  color: var(--bs-secondary-color);
  text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
  text-align: start;
}

/* Solar Panel Loading Overlay */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  pointer-events: none;
}

.loading-overlay.active {
  display: flex;
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.solar-loader {
  width: 120px;
  height: 120px;
  position: relative;
}

/* Sun in the center */
.solar-loader .sun {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 30px;
  height: 30px;
  background: linear-gradient(135deg, #ffd700 0%, #ff8c00 100%);
  border-radius: 50%;
  box-shadow: 0 0 20px #ffd700, 0 0 40px #ff8c00, 0 0 60px #ff6600;
  animation: sun-pulse 1.5s ease-in-out infinite;
}

@keyframes sun-pulse {
  0%, 100% {
    box-shadow: 0 0 20px #ffd700, 0 0 40px #ff8c00, 0 0 60px #ff6600;
    transform: translate(-50%, -50%) scale(1);
  }
  50% {
    box-shadow: 0 0 30px #ffd700, 0 0 50px #ff8c00, 0 0 70px #ff6600;
    transform: translate(-50%, -50%) scale(1.1);
  }
}

/* Sun rays */
.solar-loader .rays {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100%;
  height: 100%;
  transform: translate(-50%, -50%);
  animation: rays-rotate 8s linear infinite;
}

.solar-loader .ray {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 3px;
  height: 20px;
  background: linear-gradient(to top, rgba(255, 215, 0, 0.8), transparent);
  transform-origin: center bottom;
  border-radius: 2px;
}

.solar-loader .ray:nth-child(1) { transform: translate(-50%, -150%) rotate(0deg); }
.solar-loader .ray:nth-child(2) { transform: translate(-50%, -150%) rotate(45deg); }
.solar-loader .ray:nth-child(3) { transform: translate(-50%, -150%) rotate(90deg); }
.solar-loader .ray:nth-child(4) { transform: translate(-50%, -150%) rotate(135deg); }
.solar-loader .ray:nth-child(5) { transform: translate(-50%, -150%) rotate(180deg); }
.solar-loader .ray:nth-child(6) { transform: translate(-50%, -150%) rotate(225deg); }
.solar-loader .ray:nth-child(7) { transform: translate(-50%, -150%) rotate(270deg); }
.solar-loader .ray:nth-child(8) { transform: translate(-50%, -150%) rotate(315deg); }

@keyframes rays-rotate {
  from { transform: translate(-50%, -50%) rotate(0deg); }
  to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Solar panels orbiting */
.solar-loader .panels {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100%;
  height: 100%;
  transform: translate(-50%, -50%);
  animation: panels-orbit 3s linear infinite;
}

.solar-loader .panel {
  position: absolute;
  width: 24px;
  height: 16px;
  background: linear-gradient(135deg, #1a237e 0%, #3949ab 50%, #1a237e 100%);
  border: 1px solid #5c6bc0;
  border-radius: 2px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* Panel grid lines */
.solar-loader .panel::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  width: 1px;
  height: 100%;
  background: rgba(255, 255, 255, 0.3);
}

.solar-loader .panel::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  width: 100%;
  height: 1px;
  background: rgba(255, 255, 255, 0.3);
}

/* Panel positions */
.solar-loader .panel:nth-child(1) {
  top: 0;
  left: 50%;
  transform: translateX(-50%) rotate(0deg);
  animation: panel-tilt 2s ease-in-out infinite;
}

.solar-loader .panel:nth-child(2) {
  top: 50%;
  right: 0;
  transform: translateY(-50%) rotate(90deg);
  animation: panel-tilt 2s ease-in-out infinite 0.5s;
}

.solar-loader .panel:nth-child(3) {
  bottom: 0;
  left: 50%;
  transform: translateX(-50%) rotate(180deg);
  animation: panel-tilt 2s ease-in-out infinite 1s;
}

.solar-loader .panel:nth-child(4) {
  top: 50%;
  left: 0;
  transform: translateY(-50%) rotate(270deg);
  animation: panel-tilt 2s ease-in-out infinite 1.5s;
}

@keyframes panels-orbit {
  from { transform: translate(-50%, -50%) rotate(0deg); }
  to { transform: translate(-50%, -50%) rotate(360deg); }
}

@keyframes panel-tilt {
  0%, 100% {
    filter: brightness(1);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  }
  50% {
    filter: brightness(1.3);
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.5), 0 2px 4px rgba(0, 0, 0, 0.3);
  }
}

/* Energy flow particles */
.solar-loader .energy {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100%;
  height: 100%;
  transform: translate(-50%, -50%);
}

.solar-loader .particle {
  position: absolute;
  width: 4px;
  height: 4px;
  background: #00ff00;
  border-radius: 50%;
  box-shadow: 0 0 6px #00ff00;
  opacity: 0;
}

.solar-loader .particle:nth-child(1) {
  animation: particle-flow 1.5s ease-in-out infinite 0s;
}
.solar-loader .particle:nth-child(2) {
  animation: particle-flow 1.5s ease-in-out infinite 0.3s;
}
.solar-loader .particle:nth-child(3) {
  animation: particle-flow 1.5s ease-in-out infinite 0.6s;
}
.solar-loader .particle:nth-child(4) {
  animation: particle-flow 1.5s ease-in-out infinite 0.9s;
}

@keyframes particle-flow {
  0% {
    top: 10%;
    left: 50%;
    opacity: 0;
    transform: translate(-50%, 0) scale(0.5);
  }
  30% {
    opacity: 1;
    transform: translate(-50%, 0) scale(1);
  }
  70% {
    opacity: 1;
  }
  100% {
    top: 50%;
    left: 50%;
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.5);
  }
}

.loading-text {
  color: #fff;
  font-size: 1.2rem;
  margin-top: 30px;
  font-weight: 500;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.loading-text .dots {
  display: inline-block;
  animation: loading-dots 1.5s infinite;
}

@keyframes loading-dots {
  0%, 20% { content: '.'; }
  40% { content: '..'; }
  60%, 100% { content: '...'; }
}

.loading-subtext {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.9rem;
  margin-top: 8px;
}

/* Color utilities */
.text-emerald { color: #10b981; }
.text-amber { color: #f59e0b; }
.text-red { color: #ef4444; }
.text-gray { color: #6b7280; }
.text-indigo { color: #6366f1; }
.text-green-dark { color: #059669; }
.text-soc-high { color: #22c55e; }
.text-soc-medium { color: #f59e0b; }
.text-soc-low { color: #ef4444; }

/* Accessibility - Focus visibility */
:focus-visible {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}