/* ====== GLOBAL RESET ====== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: linear-gradient(135deg, #f8fafc 0%, #ffffff 100%);
  color: #1e293b;
  min-height: 50vh;
  overflow-x: hidden;
}



/* ====== MAIN VIEWS ====== */
.view-main1,
.view-main2 {
  .top-section {
    display: grid;
    grid-template-columns: 500px 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
    animation: fadeIn 0.8s ease-out;
  }

  /* ====== BUILDING PANEL ====== */
  .building-panel {
    background: #ffffff;
    border-radius: 10px;
    padding: 1rem;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.05);
    border: 0.5px solid #e2e8f0;
    position: relative;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    width: 500px;
  }

  .building-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1.5px;
    background: linear-gradient(90deg, transparent, grey, transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
  }

  .building-panel:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 30px rgba(37, 99, 235, 0.15);
  }

  .building-panel:hover::before {
    opacity: 1;
  }

  .building-header {
    margin-bottom: 0.75rem;
  }
  
  .building-title {
    font-size: 0.8rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 0.25rem;
  }

  .building-subtitle {
    font-size: 0.6rem;
    color: #64748b;
  }

  .building-image-wrapper {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
  }

  .building-image {
    width: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
  }

  .building-image-wrapper:hover .building-image {
    transform: scale(1.05);
  }

  .building-info {
    margin-top: 0.75rem;
    padding: 0.75rem;
    background: #f8fafc;
    border-radius: 6px;
    border: 0.5px solid #e2e8f0;
  }

  .info-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem; /* more readable */
  }

  .info-item {
    display: flex;
    flex-direction: column;
  }

  .info-label {
    font-size: 0.5rem;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-bottom: 0.1rem;
    line-height: 1.1;
  }

  .info-value {
    font-size: 0.65rem;
    color: #1e293b;
    line-height: 1.2;
    font-family: "Arial Narrow", "Roboto Condensed", "Helvetica Neue Condensed", sans-serif;
    letter-spacing: 0.2px;   /* Optional: helps readability for narrow fonts */
  }

  /* ====== CHARTS GRID ====== */
  .charts-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1rem;
    width: 1100px;
  }

  .chart-card {
    background: #ffffff;
    border-radius: 10px;
    padding: 1rem;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.05);
    border: 0.5px solid #e2e8f0;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
  }

  .chart-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1.5px;
    background: linear-gradient(90deg, transparent, grey, transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
  }

  .chart-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 30px rgba(37, 99, 235, 0.15);
  }

  .chart-card:hover::before {
    opacity: 1;
  }

  .chart-header {
    margin-bottom: 0.75rem;
  }

  .chart-title {
    font-size: 0.8rem;
    font-weight: 600;
    color: #1e293b;
    letter-spacing: -0.005em;
  }

  .chart-subtitle {
    font-size: 0.6rem;
    color: #64748b;
    font-weight: 400;
  }

  .chart {
    width: 100%;
    height: 215px;
  }

  /* ====== DONUT CHART ====== */
  .donut-wrapper {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
  }

  #donutChart, #donutChart2 {
    width: 100%;
    height: 240px;
  }

  .chart-total {
    position: absolute;
    text-align: center;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
  }

  .total-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: #2563eb;
    margin: 0;
  }

  .total-label {
    font-size: 0.425rem;
    color: #64748b;
    margin-top: 0.125rem;
    text-transform: uppercase;
    letter-spacing: 0.025em;
  }

  /* ====== LEGENDS ====== */
  .legend-container {
    display: grid;
    grid-template-columns: repeat(4, auto);
    justify-content: center;
    align-items: center;
    column-gap: 0.6rem;
    row-gap: 0.2rem;
    margin-top: 0.1rem;
    margin-left: 0.1rem;
  }

  .legend-item {
    display: flex;
    align-items: center;
    gap: 0.15rem;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0.1rem;
    border-radius: 4px;
  }
  
  .legend-item:hover {
      background: rgba(37, 99, 235, 0.08);
  }

  .legend-item.hidden {
      opacity: 0.3;
  }

  .legend-color {
    width: 7px;
    height: 7px;
    border-radius: 2px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
  }

  .legend-label {
    font-size: 0.6rem;
    color: #334155;
    font-weight: 500;
  }

  /* ====== MATERIAL CARDS ====== */
  .material-content {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
  }

  .material-image-wrapper {
    flex: 0 0 40%;
    height:160px;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    position: relative;
  }

  .material-image {
    width: 100%;
    height: 160px;
    object-fit: cover;
    transition: transform 0.4s ease;
  }

  .material-image-wrapper:hover .material-image {
    transform: scale(1.1);
  }

  .material-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: 0.375rem;
    min-height: 90px;
  }

  .material-select {
    width: 100%;
    padding: 0.375rem 0.5rem;
    border-radius: 5px;
    border: 1px solid rgba(37, 99, 235, 0.2);
    font-size: 0.6rem;
    font-weight: 500;
    background: #f8fafc;
    color: #1e293b;
    cursor: pointer;
    transition: all 0.3s ease;
    outline: none;
  }

  .material-select:hover {
    border-color: rgba(37, 99, 235, 0.4);
    background: #ffffff;
  }

  .material-select:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 1.5px rgba(37, 99, 235, 0.15);
  }

  .material-description {
    font-size: 0.55rem;
    color: #475569;
    line-height: 1.3;
    text-align: center;
    padding: 6px 4px;
    max-width: 180px;
    margin: 0 auto;
  }

  /* ====== BUTTON ====== */
  .button-section {
    display: flex;
    justify-content: center;
    margin-top: 1rem;
    animation: fadeIn 1s ease-out;
  }
 
  .building-image { 
    height: 430px; 
  }
}

/* ====== KEYFRAMES ====== */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes shimmer {
  0% { background-position: -100% 0; }
  100% { background-position: 100% 0; }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ====== MEDIA QUERIES ====== */
@media (max-width: 1400px) {
  .top-section { grid-template-columns: 1fr; }
  .building-panel { max-width: 300px; margin: 0 auto; }
}

@media (max-width: 768px) {
  .dashboard-title { font-size: 1rem; }
  .charts-section { grid-template-columns: 1fr; }
  .info-grid { grid-template-columns: 1fr; }
  .simulate-btn { width: 100%; max-width: 150px; }
}

/* ====== CHART & LOADING ====== */
.chart { position: relative; height: 120px; }

.simulation-overlay {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.85);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10;
  transition: opacity 0.5s ease-in-out;
  font-size: 0.6rem;
}

.simulation-loading {
  text-align: center;
  font-weight: 500;
  color: #334155;
}

.spinner {
  border: 2px solid rgba(0,0,0,0.1);
  border-top: 2px solid #334155;
  border-radius: 50%;
  width: 16px;
  height: 16px;
  animation: spin 1s linear infinite;
  margin: 0 auto 4px;
}

/* ---------- WRAPPER ---------- */
.info-container {
  width: 100%;
  background: #fff;
  overflow: hidden;
}

/* ---------- MAIN CONTENT GRID ---------- */
.info-body {
  display: grid;
  grid-template-columns: 1.1fr 1.2fr 0.9fr;
  gap: 30px;
  align-items: stretch;      /* all 3 columns same height */
  background: #fff;
  height: 600px;
}

/* ---------- LEFT MAIN IMAGE ---------- */
.info-left {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid #e0e0e0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  margin: 10px;
}

.main-image {
  width: 100%;
  height: auto;
  object-fit: cover;
}

/* ---------- MIDDLE TEXT (TOP & BOTTOM HALVES) ---------- */
.right-text {
  display: flex;
  flex-direction: column;
  height: 100%;
  justify-content: space-between;
}

.text-half {
  flex: 1;                         /* 50% height */
  display: flex;
  align-items: flex-start;         /* top-align text */
  padding: 10px;
}

.text-half  p {
  font-size: 22px;
  line-height: 1.65;
  color: #2c2c2c;
  margin-bottom: 18px;
  font-weight: 400;
  letter-spacing: 0.2px;
}
/* ---------- RIGHT IMAGES (TOP & BOTTOM HALVES) ---------- */
.right-images {
  display: flex;
  flex-direction: column;
  height: 100%;
  justify-content: space-between;
}

.img-half {
  flex: 1;                         /* 50% height */
  display: flex;
  align-items: center;
  justify-content: center;
}

.right-images img.thumb {
  width: 100%;
  height: 90%;                     /* keep natural margin */
  object-fit: cover;
  border-radius: 9px;
  border: 1.5px solid #ccc;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

/* ---------- FOOTER ---------- */
.info-footer {
  text-align: center;
  background: #fff;
}


/* ---------- RESPONSIVE ---------- */
@media (max-width: 1024px) {
  .info-body {
    grid-template-columns: 1fr;
  }

  /* Right images stack naturally */
  .right-images {
    flex-direction: row;
    flex-wrap: wrap;
    height: auto;               /* remove enforced 50/50 on mobile */
    gap: 10px;
  }

  .img-half {
    flex: none;
    width: 48%;
  }

  .right-images img.thumb {
    height: 180px;
  }

  .right-text {
    height: auto;
  }

  .text-half {
    flex: none;
  }
}
