/* =========================================================
   GLOBAL PAGE
   ========================================================= */
body {
  margin: 0;
  padding: 0;
  font-family: "Segoe UI", Roboto, sans-serif;
  background: #f7f9fb;
  color: #333;
}

h1 {
  color: #0066cc;
  font-weight: 500;
  text-align: center;
  margin: 20px 0;
}


/* =========================================================
   MAIN TWO-COLUMN PAGE LAYOUT
   Left  : form and result
   Right : cable graphics
   ========================================================= */
.page-layout {
  display: flex;
  align-items: flex-start;
  /* gap: 24px; */
  gap: 10px;
  max-width: 1700px;
  margin: 0 auto;
  padding: 20px;
  box-sizing: border-box;
}

.left-column {
  flex: 0 0 50%;
}

.right-column {
  flex: 0 0 50%;
}


/* =========================================================
   MAIN CONTENT BOX
   Used on both left and right columns
   ========================================================= */
.container {
  max-width: 700px;
  margin: 0 auto;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
  padding: 20px 20px;
  box-sizing: border-box;
}


/* =========================================================
   TOP DROPDOWN SECTION
   Conductor cross-sectional area selector
   ========================================================= */
/* Here top dropdown buttons are shown one below the other */
   /* .dropdown-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin-bottom: 25px;
} */
 /* Here top dropdown buttons are shown next to each other - same horizontal level  */
.dropdown-section {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 30px;
  margin-bottom: 25px;
  flex-wrap: wrap; /* prevents breaking on smaller screens */
}
/* Here labels aligned to the center */
.dropdown-section label {
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 1.05rem;
  font-weight: 600;
  color: #004a99;
}

/* Here labels aligned to the left */
/* 
.dropdown-section label {
  display: flex;
  flex-direction: column;
  align-items: flex-start;   
  font-size: 1.05rem;
  font-weight: 600;
  color: #004a99;
} */



.dropdown-section select {
  width: 160px;
  margin-top: 8px;
  padding: 8px 12px;
  font-size: 1rem;
  text-align: center;
  border: 1px solid #0066cc;
  border-radius: 8px;
  background-color: #eef5ff;
  color: #003366;
  cursor: pointer;
}

.dropdown-section select:hover {
  background-color: #dceeff;
}


/* =========================================================
   FORM LAYOUT
   ========================================================= */
.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

label {
  display: flex;
  flex-direction: column;
  font-size: 0.95rem;
}

input {
  margin-top: 6px;
  padding: 8px 10px;
  font-size: 1rem;
  border: 1px solid #ccc;
  border-radius: 6px;
  box-sizing: border-box;
}

/* Make form select boxes visually consistent with inputs */
form select {
  width: 100%;
  height: 38px;
  padding: 8px;
  font-size: 14px;
  border: 1px solid #c6d8f7;
  border-radius: 6px;
  background-color: white;
  box-sizing: border-box;
}

form select:focus {
  outline: none;
  border-color: #94b8ff;
  box-shadow: 0 0 4px rgba(56, 132, 255, 0.4);
}


/* =========================================================
   FORM SECTIONS
   1. Cable Construction
   2. Installation Parameters
   3. Operating Conditions
   ========================================================= */
.form-section {
  margin-bottom: 20px;
  padding: 15px;
  border: 1px solid #c6d8f7;
  border-radius: 8px;
  background: #f7faff;
}

.section-heading {
  margin-bottom: 12px;
  color: #004a99;
  font-size: 20px;
}


/* =========================================================
   BUTTONS
   ========================================================= */
button,
.submit-btn {
  width: 100%;
  margin-top: 5px;
  padding: 12px;
  font-size: 1rem;
  color: #fff;
  background: #0275ff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.2s;
}

button:hover,
.submit-btn:hover {
  background: #005fcc;
}


/* =========================================================
   RESULT BOX
   ========================================================= */
.result-box {
  margin-top: 5px;
  padding: 15px;
  background: #eef5ff;
  border-radius: 8px;
  font-family: monospace;
  white-space: pre-wrap;
}


/* =========================================================
   INPUT ERROR STYLING
   ========================================================= */
input.error {
  background-image: linear-gradient(
    to right,
    rgba(255, 0, 0, 0.1),
    rgba(255, 0, 0, 0.1)
  );
}

input.error::placeholder {
  color: red;
  font-weight: bold;
}


/* =========================================================
   RIGHT COLUMN GRAPHICS AREA
   Upper : Cable Cross-Section
   Lower : Cable Installation
   ========================================================= */
#cable-visual {
  margin: 0;
  padding: 0;
}

.graphics-panel {
  padding: 12px;
  background: #ffffff;
  border: 1px solid #d9e2f2;
  border-radius: 8px;
  box-sizing: border-box;
}

.graphics-panel:first-child {
  margin-bottom: 20px;
}

.svg_title {
  margin: 0px 0px 10px 0;
  text-align: center;
  color: #004a99;
}

#svg_container_cable_construction,
#svg_container_cable_installation {
  width: 100%;
  min-height: 320px;
  margin: 0px;
  padding: 0px;
  overflow: auto;
  line-height: 0;
}

svg {
  display: block;
  margin: 10px auto;
  padding: 0;
}


/* =========================================================
   RESPONSIVE LAYOUT
   Stack columns on smaller screens
   ========================================================= */
@media (max-width: 1100px) {
  .page-layout {
    flex-direction: column;
  }

  .left-column,
  .right-column {
    flex: 1 1 100%;
    width: 100%;
  }

  .container {
    max-width: 100%;
  }

  .grid {
    grid-template-columns: 1fr;
  }
}