/* Solar Eyes - Component-Specific CSS Styles */
/* Specialized styling for individual UI components */

/* Section Header Components */
.section-header {
  display: flex;
  align-items: center;
  margin-bottom: 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid var(--gray-200);
}

.section-header svg {
  margin-right: 0.75rem;
  flex-shrink: 0;
}

.section-header h3 {
  margin-bottom: 0;
  color: var(--gray-800);
}

/* Form Component Styling */
.form-section {
  background: rgba(255, 255, 255, 0.8);
  border-radius: var(--radius-xl);
  padding: 2rem;
  margin-bottom: 2rem;
  box-shadow: var(--shadow-lg);
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.form-subsection {
  margin-bottom: 2rem;
}

.form-subsection:last-child {
  margin-bottom: 0;
}

.form-subsection h4 {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--gray-200);
}

.form-grid {
  display: grid;
  gap: 1.5rem;
}

.form-grid.cols-2 {
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.form-grid.cols-3 {
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.form-field {
  display: flex;
  flex-direction: column;
}

.form-field label {
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: var(--gray-700);
}

.form-field input,
.form-field select,
.form-field textarea {
  padding: 0.75rem 1rem;
  border: 2px solid var(--gray-300);
  border-radius: var(--radius-lg);
  font-size: 1rem;
  transition: all 0.3s ease;
}

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
  border-color: var(--energy-blue);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
  outline: none;
}

/* Checkbox and Radio Components */
.checkbox-group,
.radio-group {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.checkbox-item,
.radio-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem;
  border-radius: var(--radius-md);
  transition: background-color 0.2s ease;
}

.checkbox-item:hover,
.radio-item:hover {
  background-color: var(--gray-50);
}

.checkbox-item input,
.radio-item input {
  width: 1.25rem;
  height: 1.25rem;
  accent-color: var(--energy-blue);
}

.checkbox-item label,
.radio-item label {
  margin-bottom: 0;
  cursor: pointer;
  font-weight: 400;
}

/* Range Slider Components */
.range-slider {
  margin: 1rem 0;
}

.range-slider input[type="range"] {
  width: 100%;
  height: 8px;
  border-radius: var(--radius-md);
  background: linear-gradient(90deg, var(--energy-blue-light) 0%, var(--sustainable-green-light) 100%);
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}

.range-slider input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--energy-blue) 0%, var(--sustainable-green) 100%);
  cursor: pointer;
  box-shadow: var(--shadow-md);
  transition: all 0.3s ease;
}

.range-slider input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.1);
  box-shadow: var(--shadow-lg);
}

.range-slider input[type="range"]::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--energy-blue) 0%, var(--sustainable-green) 100%);
  cursor: pointer;
  border: none;
  box-shadow: var(--shadow-md);
}

.range-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 0.5rem;
  font-size: 0.75rem;
  color: var(--gray-500);
}

.range-value {
  font-weight: 600;
  color: var(--gray-700);
}

/* File Upload Component */
.file-upload {
  position: relative;
}

.file-upload input[type="file"] {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
}

.file-upload-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  border: 3px dashed var(--gray-300);
  border-radius: var(--radius-xl);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.5) 0%, rgba(248, 250, 252, 0.5) 100%);
  cursor: pointer;
  transition: all 0.3s ease;
}

.file-upload-label:hover {
  border-color: var(--energy-blue);
  background: linear-gradient(135deg, rgba(219, 234, 254, 0.5) 0%, rgba(209, 250, 229, 0.5) 100%);
  transform: translateY(-2px);
}

.file-upload-label.dragover {
  border-color: var(--sustainable-green);
  background: var(--sustainable-green-light);
  transform: scale(1.02);
}

.file-upload-icon {
  width: 3rem;
  height: 3rem;
  color: var(--gray-400);
  margin-bottom: 0.75rem;
}

.file-upload-text {
  font-size: 0.875rem;
  color: var(--gray-600);
  text-align: center;
}

.file-upload-subtext {
  font-size: 0.75rem;
  color: var(--gray-500);
  margin-top: 0.25rem;
}

/* Metric Cards */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.metric-card {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.9) 0%, rgba(248, 250, 252, 0.9) 100%);
  border-radius: var(--radius-xl);
  padding: 1.5rem;
  box-shadow: var(--shadow-lg);
  border: 1px solid rgba(255, 255, 255, 0.3);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.metric-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
}

.metric-card.blue::before {
  background: linear-gradient(90deg, var(--energy-blue) 0%, var(--energy-blue-dark) 100%);
}

.metric-card.green::before {
  background: linear-gradient(90deg, var(--sustainable-green) 0%, var(--sustainable-green-dark) 100%);
}

.metric-card.yellow::before {
  background: linear-gradient(90deg, var(--solar-yellow) 0%, var(--solar-orange) 100%);
}

.metric-card.purple::before {
  background: linear-gradient(90deg, #8b5cf6 0%, #7c3aed 100%);
}

.metric-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-xl);
}

.metric-card h4 {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--gray-700);
}

.metric-value {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
  color: var(--gray-900);
}

.metric-unit {
  font-size: 0.875rem;
  color: var(--gray-600);
}

/* Chart Components */
.chart-container {
  background: rgba(255, 255, 255, 0.8);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 2rem;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--gray-200);
}

.chart-header {
  margin-bottom: 1rem;
}

.chart-header h4 {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: 0;
}

.chart-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 16rem;
  background: var(--gray-50);
  border-radius: var(--radius-lg);
  border: 2px dashed var(--gray-300);
  color: var(--gray-500);
  font-size: 0.875rem;
  transition: all 0.3s ease;
}

.chart-placeholder:hover {
  border-color: var(--energy-blue);
  background: var(--energy-blue-light);
  color: var(--energy-blue-dark);
}

/* Table Components */
.data-table {
  background: white;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--gray-200);
}

.data-table table {
  width: 100%;
  border-collapse: collapse;
}

.data-table thead {
  background: linear-gradient(135deg, var(--gray-50) 0%, var(--gray-100) 100%);
}

.data-table th {
  padding: 1rem 1.5rem;
  text-align: left;
  font-weight: 600;
  color: var(--gray-700);
  border-bottom: 2px solid var(--gray-200);
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.data-table td {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--gray-200);
  color: var(--gray-600);
  transition: background-color 0.2s ease;
}

.data-table tbody tr:hover td {
  background-color: var(--energy-blue-light);
}

.data-table tbody tr:last-child td {
  border-bottom: none;
}

/* Button Components */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  font-weight: 600;
  border-radius: var(--radius-lg);
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  position: relative;
  overflow: hidden;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none !important;
}

.btn-primary {
  background: linear-gradient(135deg, var(--energy-blue) 0%, var(--energy-blue-dark) 100%);
  color: white;
  box-shadow: var(--shadow-md);
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  background: linear-gradient(135deg, var(--energy-blue-dark) 0%, #1e40af 100%);
}

.btn-secondary {
  background: linear-gradient(135deg, var(--sustainable-green) 0%, var(--sustainable-green-dark) 100%);
  color: white;
  box-shadow: var(--shadow-md);
}

.btn-secondary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  background: linear-gradient(135deg, var(--sustainable-green-dark) 0%, #065f46 100%);
}

.btn-accent {
  background: linear-gradient(135deg, var(--solar-yellow) 0%, var(--solar-orange) 100%);
  color: var(--gray-900);
  box-shadow: var(--shadow-md);
}

.btn-accent:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  background: linear-gradient(135deg, var(--solar-orange) 0%, var(--solar-gold) 100%);
}

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

.btn-outline:hover:not(:disabled) {
  background: var(--energy-blue);
  color: white;
  transform: translateY(-2px);
}

.btn-large {
  padding: 1rem 2rem;
  font-size: 1.125rem;
}

.btn-small {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
}

/* Alert Components */
.alert {
  padding: 1rem 1.5rem;
  border-radius: var(--radius-lg);
  margin: 1rem 0;
  border-left: 4px solid;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.alert-icon {
  width: 1.25rem;
  height: 1.25rem;
  flex-shrink: 0;
  margin-top: 0.125rem;
}

.alert-content {
  flex: 1;
}

.alert-title {
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.alert-message {
  font-size: 0.875rem;
  margin-bottom: 0;
}

.alert.info {
  background: var(--energy-blue-light);
  border-color: var(--energy-blue);
  color: var(--energy-blue-dark);
}

.alert.success {
  background: var(--sustainable-green-light);
  border-color: var(--sustainable-green);
  color: var(--sustainable-green-dark);
}

.alert.warning {
  background: #fef3c7;
  border-color: var(--solar-yellow);
  color: #92400e;
}

.alert.error {
  background: #fee2e2;
  border-color: var(--error);
  color: #991b1b;
}

/* Progress Components */
.progress-bar {
  width: 100%;
  height: 0.5rem;
  background: var(--gray-200);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin: 1rem 0;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--energy-blue) 0%, var(--sustainable-green) 100%);
  border-radius: var(--radius-md);
  transition: width 0.3s ease;
}

/* Loading Components */
.loading-spinner {
  display: inline-block;
  width: 1.5rem;
  height: 1.5rem;
  border: 2px solid var(--gray-300);
  border-radius: 50%;
  border-top-color: var(--energy-blue);
  animation: spin 1s ease-in-out infinite;
}

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

.loading-dots {
  display: inline-flex;
  gap: 0.25rem;
}

.loading-dot {
  width: 0.5rem;
  height: 0.5rem;
  background: var(--energy-blue);
  border-radius: 50%;
  animation: bounce 1.4s ease-in-out infinite both;
}

.loading-dot:nth-child(1) {
  animation-delay: -0.32s;
}

.loading-dot:nth-child(2) {
  animation-delay: -0.16s;
}

@keyframes bounce {
  0%, 80%, 100% {
    transform: scale(0);
  }
  40% {
    transform: scale(1);
  }
}

/* Modal Components */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  background: white;
  border-radius: var(--radius-xl);
  padding: 2rem;
  max-width: 90vw;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-xl);
  transform: scale(0.9);
  transition: transform 0.3s ease;
}

.modal-overlay.active .modal-content {
  transform: scale(1);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--gray-200);
}

.modal-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--gray-800);
  margin: 0;
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--gray-500);
  cursor: pointer;
  padding: 0.25rem;
  border-radius: var(--radius-md);
  transition: all 0.2s ease;
}

.modal-close:hover {
  background: var(--gray-100);
  color: var(--gray-700);
}

/* Tooltip Components */
.tooltip {
  position: relative;
  display: inline-block;
}

.tooltip-content {
  position: absolute;
  bottom: 125%;
  left: 50%;
  transform: translateX(-50%);
  background: var(--gray-900);
  color: white;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-md);
  font-size: 0.75rem;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  z-index: 100;
}

.tooltip-content::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: var(--gray-900);
}

.tooltip:hover .tooltip-content {
  opacity: 1;
  visibility: visible;
}

/* Comparison Table Components */
.comparison-grid {
  display: grid;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.comparison-item {
  background: rgba(255, 255, 255, 0.9);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-md);
  border: 2px solid var(--gray-200);
  position: relative;
}

.comparison-item.selected {
  border-color: var(--energy-blue);
  box-shadow: var(--shadow-lg);
}

.comparison-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.comparison-title {
  font-weight: 600;
  color: var(--gray-800);
}

.comparison-remove {
  background: var(--error);
  color: white;
  border: none;
  border-radius: 50%;
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.comparison-remove:hover {
  background: #dc2626;
  transform: scale(1.1);
}

/* Responsive Design for Components */
@media (max-width: 768px) {
  .form-grid.cols-2,
  .form-grid.cols-3 {
    grid-template-columns: 1fr;
  }
  
  .metrics-grid {
    grid-template-columns: 1fr;
  }
  
  .btn {
    width: 100%;
    justify-content: center;
  }
  
  .modal-content {
    margin: 1rem;
    padding: 1.5rem;
  }
  
  .data-table {
    overflow-x: auto;
  }
  
  .comparison-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .form-section {
    padding: 1rem;
  }
  
  .metric-card {
    padding: 1rem;
  }
  
  .chart-container {
    padding: 1rem;
  }
  
  .data-table th,
  .data-table td {
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
  }
}

/* Thematic Loader for Simulation Button */
.is-loading {
  cursor: wait;
  background-color: #7e22ce; /* A slightly darker purple */
}

.loader-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem; /* 12px */
}

/* THIS IS THE NEW ANIMATION PART */
.loader-sun {
  width: 1.5rem; /* 24px */
  height: 1.5rem; /* 24px */
  animation: spin 2s linear infinite;
}

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