/*
 * This is a manifest file that'll be compiled into application.css.
 *
 * With Propshaft, assets are served efficiently without preprocessing steps. You can still include
 * application-wide styles in this file, but keep in mind that CSS precedence will follow the standard
 * cascading order, meaning styles declared later in the document or manifest will override earlier ones,
 * depending on specificity.
 *
 * Consider organizing styles into separate files for maintainability.
 */
h1 {
  color: #333;
  font-size: 1.2rem;
  margin-bottom: 0.5rem;
  padding-bottom: 0.1rem;
  border-bottom: 1px solid #e0e0e0;
  font-weight: 600;
}


/* Selector Container - Compact Layout */
.selector-container {
  margin: 0 auto;
  padding: 1rem;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  display: flex;
  flex-direction: column;
}

.location-selector {
  flex: 0 0 auto;
  min-height: 180px;
}

.header {
  text-align: center;
  margin-bottom: 0.5rem;
  flex-shrink: 0;
}

.header h1 {
  color: #333;
  font-size: 1.2rem;
  margin-bottom: 0.1rem;
}

.header p {
  color: #666;
  font-size: 0.8rem;
  margin: 0;
}

.locations-section {
  margin-bottom: 0.5rem;
  height: 100%;
}

.locations-section-hidden h1 {
  color: #333;
  font-size: 0.9rem;
  margin-bottom: 0.3rem;
  padding-bottom: 0.1rem;
  border-bottom: 1px solid #e0e0e0;
  font-weight: 600;
}

.location-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
  gap: 0.3rem;
  margin-bottom: 0.5rem;
}

.location-card {
  display: block;
  background: white;
  padding: 0.3rem;
  text-decoration: none;
  color: inherit;
  transition: all 0.2s ease;
  cursor: pointer;
}

.location-card:hover {
  border-color: #007acc;
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}

.location-card.selected {
  border-color: #007acc;
  background: #f0f8ff;
  box-shadow: 0 2px 8px rgba(0, 122, 204, 0.2);
  transform: translateY(-1px);
}

.location-card.selected .abbreviation {
  background: #007acc;
  color: white;
}

.flag-container {
  text-align: center;
  margin-bottom: 0.2rem;
}

.flag-image {
  width: 60px;
  height: auto;
  border: 1px solid #ddd;
  border-radius: 2px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.location-info {
  text-align: center;
}

.location-info h3 {
  margin: 0 0 0.1rem 0;
  font-size: 0.65rem;
  color: #333;
  font-weight: 500;
  line-height: 1.1;
}

.abbreviation {
  background: #f0f0f0;
  color: #666;
  padding: 0.05rem 0.2rem;
  border-radius: 2px;
  font-size: 0.6rem;
  font-weight: bold;
}

/* Responsive design */
@media (max-width: 768px) {
  .selector-container {
    padding: 0.5rem;
    min-height: 400px;
  }

  .location-selector {
    min-height: 160px;
    margin-bottom: 0.75rem;
  }

  .appliance-selector {
    min-height: 160px;
  }

  .header h1 {
    font-size: 1rem;
  }

  .header p {
    font-size: 0.7rem;
  }

  .location-grid {
    grid-template-columns: repeat(auto-fit, minmax(75px, 1fr));
    gap: 0.2rem;
  }

  .location-card {
    padding: 0.2rem;
  }

  .flag-image {
    width: 45px;
  }

  .location-info h3 {
    font-size: 0.55rem;
  }

  .abbreviation {
    font-size: 0.5rem;
    padding: 0.05rem 0.15rem;
  }
}

/* Appliance Selector Styles */
.appliance-selector {
  flex: 0 0 auto;
  min-height: 120px;
}

.appliance-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.appliance-card {
  display: block;
  background: white;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  padding: 0.8rem 0.5rem;
  text-decoration: none;
  color: inherit;
  transition: all 0.2s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
  cursor: pointer;
  text-align: center;
}

.appliance-card:hover {
  border-color: #007acc;
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}

.appliance-card.selected {
  border-color: #007acc;
  background: #f0f8ff;
  box-shadow: 0 2px 8px rgba(0, 122, 204, 0.2);
  transform: translateY(-1px);
}

.appliance-icon {
  font-size: 2rem;
  margin-bottom: 0.3rem;
  display: block;
}

.appliance-info h3 {
  margin: 0;
  font-size: 0.8rem;
  color: #333;
  font-weight: 500;
  line-height: 1.1;
}

/* Responsive design for appliances */
@media (max-width: 768px) {
  .appliance-selector {
    padding: 0.5rem;
  }

  .appliance-section h1 {
    font-size: 1rem;
  }

  .appliance-grid {
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
    gap: 0.3rem;
  }

  .appliance-card {
    padding: 0.6rem 0.3rem;
  }

  .appliance-icon {
    font-size: 1.5rem;
    margin-bottom: 0.2rem;
  }

  .appliance-info h3 {
    font-size: 0.7rem;
  }
}

/* Main Content Area Styles */
.main-content-area {
  max-width: 1200px;
  margin: 2rem auto;
  padding: 0 1rem;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  clear: both;
}

.placeholder-message {
  text-align: center;
  padding: 3rem 2rem;
  background: #f8f9fa;
  border-radius: 8px;
  color: #6c757d;
}

.placeholder-message h2 {
  margin-bottom: 0.5rem;
  color: #495057;
  font-weight: 500;
}

/* Comparison Results Styles */
.comparison-results {
  animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

.comparison-header h2 {
  color: #333;
  font-size: 1.8rem;
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.comparison-header .subtitle {
  color: #666;
  font-size: 1rem;
  margin: 0;
}

/* Comparison Table Styles */
.comparison-table-container {
  overflow-x: auto;
  margin-bottom: 2rem;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.comparison-table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  font-size: 0.9rem;
}

.comparison-table th,
.comparison-table td {
  padding: 0;
  text-align: center;
  border: 1px solid #e0e0e0;
}

.comparison-table td.higher {
  background-color: #fdd;
  color: #900;
}

.comparison-table td.lower {
  background-color: #dfd;
  color: #060;
}

/* Header Styles */
.appliance-header {
  background: #f8f9fa;
  color: #333;
  font-weight: 600;
  padding: 1rem;
  text-align: left;
  width: 200px;
  position: sticky;
  left: 0;
  z-index: 2;
}

.energy-header {
  background: #f8f9fa;
  color: white;
  font-weight: 600;
  padding: 1rem;
  position: relative;
}

.energy-header.ongoing {
  background: linear-gradient(135deg, #007acc 0%, #0099ff 100%);
}

.energy-header.upfront {
  background: linear-gradient(135deg, #ff6b35 0%, #ff8c42 100%);
}

.energy-header.emissions {
  background: linear-gradient(135deg, #8b4513 0%, #a0522d 100%);
}

/* Sub Headers */
.sub-headers td {
  background: #f0f2f5;
  padding: 0.5rem;
  font-size: 0.8rem;
  font-weight: 500;
  color: #666;
}

.sub-header-group {
  display: flex;
  flex-direction: row;
}

.sub-header-item {
  flex: 1;
  padding: 0.5rem 0.25rem;
  border-right: 1px solid #d0d7de;
}

.sub-header-item:last-child {
  border-right: none;
}

/* Appliance Rows */
.appliance-row:hover {
  background: #f8f9fa;
}

.appliance-cell {
  padding: 1rem;
  text-align: left;
  background: white;
  position: sticky;
  left: 0;
  z-index: 1;
  border-right: 2px solid #e0e0e0;
}

.appliance-icon {
  font-size: 1.5rem;
  margin-right: 0.75rem;
  display: inline-block;
  vertical-align: middle;
}

.appliance-name {
  font-weight: 500;
  color: #333;
  vertical-align: middle;
}

/* Energy Data */
.energy-data {
  padding: 0;
  vertical-align: middle;
}

.data-group {
  display: flex;
  flex-direction: row;
  height: 100%;
}

.data-group>div {
  flex: 1;
  padding: 1rem 0.5rem;
  border-right: 1px solid #d0d7de;
  display: flex;
  align-items: center;
  justify-content: center;
}

.data-group>div:last-child {
  border-right: none;
}

.cost-item {
  font-weight: 600;
  color: #333;
}

.emissions-item {
  font-weight: 500;
  color: #666;
  font-size: 0.85rem;
}

.data-group.unavailable {
  background: #f8f9fa;
}

.unavailable-text {
  color: #999;
  font-style: italic;
}

/* Mobile Responsive Styles for Comparison Table */
@media (max-width: 768px) {
  .comparison-table-container {
    font-size: 0.8rem;
  }

  .appliance-header {
    width: 120px;
    padding: 0.75rem 0.5rem;
    font-size: 0.8rem;
  }

  .energy-header {
    padding: 0.75rem 0.25rem;
    font-size: 0.8rem;
  }

  .appliance-icon {
    font-size: 1.2rem;
    margin-right: 0.5rem;
  }

  .appliance-name {
    font-size: 0.8rem;
  }

  .data-group>div {
    padding: 0.75rem 0.25rem;
    font-size: 0.75rem;
  }

  .sub-header-item {
    padding: 0.4rem 0.15rem;
    font-size: 0.7rem;
  }

  .appliance-cell {
    padding: 0.75rem 0.5rem;
  }
}

@media (max-width: 480px) {
  .comparison-header h2 {
    font-size: 1.4rem;
  }

  .comparison-header .subtitle {
    font-size: 0.9rem;
  }

  .appliance-header {
    width: 100px;
    padding: 0.5rem 0.25rem;
  }

  .appliance-name {
    display: block;
    margin-top: 0.25rem;
  }

  .appliance-icon {
    display: block;
    margin-bottom: 0.25rem;
    margin-right: 0;
  }
}

.no-data-message {
  text-align: center;
  padding: 3rem 2rem;
  background: #fff3cd;
  border: 1px solid #ffeaa7;
  border-radius: 8px;
  color: #856404;
}

.no-data-message h3 {
  color: #856404;
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.no-data-message p {
  margin: 0;
}

/* Keep main content responsive styles */
@media (max-width: 768px) {
  .main-content-area {
    margin: 1.5rem auto;
    padding: 0 0.5rem;
  }
}