/* =================================================================== */
/* STYLES FOR THE WELDING CALCULATOR TOOLS FORM (welding_tools.html)   */
/* =================================================================== */

.welding-calculator-wrapper {
  width: 100%;
  max-width: 1120px;
  margin: 0px auto;
  padding: 30px;
  background-color: #ffffff;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.calculator-tabs {
  display: flex;
  flex-wrap: wrap;
  border-bottom: 1px solid #dee2e6;
  margin-bottom: 30px;
}

.tab-link {
  padding: 12px 20px;
  cursor: pointer;
  text-decoration: none;
  color: #555 !important;
  font-size: 14px;
  font-weight: 500;
  border: 1px solid transparent;
  border-bottom: none;
  margin-bottom: -1px; /* Overlap the main border */
  transition: all 0.3s ease;
}

.tab-link:hover {
  background-color: #f8f9fa;
  color: #333 !important;
}

.tab-link.active {
  color: #DC2626 !important;
  border-color: #dee2e6 #dee2e6 #ffffff;
  border-width: 1px;
  border-style: solid;
  border-radius: 6px 6px 0 0;
  background-color: #ffffff;
  font-weight: 600;
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
  animation: fadeIn 0.5s;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.form-grid {
  display: grid;
  gap: 12px 16px;
  margin-bottom: 4px;
  align-items: start;
}

/* MODIFIED: Use fixed column counts for predictable layout */
.form-grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.form-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.form-grid.cols-4 { grid-template-columns: repeat(4, 1fr); }


.form-group {
  display: flex;
  flex-direction: column;
  align-items: unset;
}

.form-group label {
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 500;
  color: #333 !important;
}

.form-group input[type="text"],
.form-group input[type="number"] {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid #ced4da;
  border-radius: 4px;
  font-size: 14px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input[type="text"]:focus {
  border-color: #DC2626;
  /* box-shadow: 0 0 0 0.2rem rgba(220, 38, 38, 0.25); */
  outline: none;
}

.radio-group-horizontal {
  display: flex;
  flex-wrap: wrap;
  gap: 25px;
  margin-bottom: 30px;
}

.radio-group-horizontal label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  cursor: pointer;
}

.sub-label {
    font-size: 12px;
    color: #6c757d !important;
}

/* Container for centering buttons */
.button-container {
    display: flex;
    justify-content: center;
    margin: 1px 0;
}

.calculate-btn, .download-btn {
  padding: 12px 20px;
  width: 40%;
  max-width: 350px;
  min-width: 200px;
  border: none;
  border-radius: 6px;
  background-color: #606060;
  color: white !important;
  cursor: pointer;
  font-size: 16px;
  font-weight: 500;
  transition: background-color 0.3s ease;
}

.calculate-btn:hover, .download-btn:hover {
  background-color: #df091f;
}

.calculate-btn:hover {
    background: #df091f;
}
/* Container for centering navigation links */
.nav-link-container {
    text-align: center;
    margin-top: 25px;
}

.output-section {
  margin-top: 30px;
  padding-top: 25px;
  border-top: 1px solid #dee2e6;
}

.output-section h4 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 25px;
  color: #343a40 !important;
}

.nav-link {
  display: inline-block;
  font-size: 14px;
  color: #555 !important;
  text-decoration: none;
  font-weight: 500;
}
.nav-link:hover {
  text-decoration: underline;
}

.nav-link-inline {
    margin-top: 6px;
    font-size: 12px;
    color: #007bff !important;
    text-decoration: none;
    align-self: flex-start; /* This aligns the link to the right */
}

.nav-link-inline:hover {
    text-decoration: underline;
}

.graph-img {
    width: 100%;
    max-width: 600px;
    height: auto;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-bottom: 20px;
}


/* =================================================================== */
/* STYLES FOR THE NEW HOME / LANDING PAGE                              */
/* =================================================================== */

.home-nav {
  display: flex;
  flex-wrap: wrap;
  border-bottom: 1px solid #dee2e6;
  margin-bottom: 40px;
  padding-bottom: 10px;
}

.home-nav-link {
  padding: 8px 16px;
  text-decoration: none;
  color: #555 !important;
  font-size: 14px;
  font-weight: 500;
  border-right: 1px solid #ccc;
  line-height: 1;
}

.home-nav-link:last-child {
  border-right: none;
}

.home-nav-link .fa-house {
  color: #DC2626;
  font-size: 16px;
}

.docs-section {
  padding: 0 20px;
}

.docs-title {
  font-size: 20px;
  font-weight: 600;
  color: #333 !important;
  margin-bottom: 30px;
}

.docs-subtitle {
  font-size: 14px;
  font-weight: 400;
  color: #666 !important;
}

.doc-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr); /* first row = 3 */
  gap: 20px;
  margin-bottom: 40px;
}

.doc-grid a:nth-child(n+4) {
  grid-column: span 1;
}

.doc-grid a:nth-child(4),
.doc-grid a:nth-child(5),
.doc-grid a:nth-child(6),
.doc-grid a:nth-child(7) {
  grid-column: span 1; /* make the rest behave like 2 columns */
}

@media (min-width: 768px) {
  .doc-grid {
    grid-template-columns: repeat(2, 1fr); /* from 2nd row onwards */
  }
}




.doc-button {
  display: block;
  padding: 15px 20px;
  border: 1px solid #ccc;
  border-radius: 8px;
  text-align: center;
  text-decoration: none;
  color: #444 !important;
  font-size: 14px;
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

.doc-button:hover {
  background-color: #f8f9fa;
  border-color: #aaa;
}

.start-calc-link {
  display: block;
  text-align: center;
  margin-top: 20px;
  font-size: 14px;
  font-weight: 500;
  color: #555 !important;
  text-decoration: none;
}

.start-calc-link:hover {
  text-decoration: underline;
}

.tab-link.home-icon-link .fa-house {
  color: #DC2626;
}


/* Media query for responsiveness */
@media (max-width: 768px) {
  .doc-grid {
    grid-template-columns: 1fr;
  }
  .home-nav-link {
    padding: 8px 10px;
    font-size: 13px;
  }
}


@media screen and (max-width: 768px) {
    /* MODIFIED: This ensures all grids become single-column on mobile */
    .form-grid { 
        grid-template-columns: 1fr !important; 
    }
    .welding-calculator-wrapper {
        padding: 20px;
    }
    .tab-link {
        font-size: 13px;
        padding: 10px;
    }
    .calculate-btn, .download-btn {
        width: 80%;
    }
}



/* =================================================================== */
/* STYLES FOR PREHEAT TEMPERATURE METHOD 2                             */
/* =================================================================== */

.graph-layout {
  display: grid;
  grid-template-columns: 1fr 2fr; /* Makes the graph column twice as wide as the output */
  gap: 30px;
  align-items: flex-start;
}



/* =================================================================== */
/* STYLES FOR DYNAMIC GRAPH CANVAS ALIGNMENT                           */
/* =================================================================== */

.graph-container {
    position: relative; 
    height: 400px;      
    width: 100%;        
}

/* =================================================================== */
/* STYLES FOR WARNING BOX AND GRAPH                                    */
/* =================================================================== */
.warning-box {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 25px;
    text-align: center;
    font-weight: 500;
}

.graph-container {
    position: relative;
    transform: translateY(-50px);
}

#preheatGraphCanvas {
    width: 100% !important;
    height: 100% !important;
}

/* On smaller screens, stack the output and graph */
@media screen and (max-width: 768px) {
    .graph-layout {
        grid-template-columns: 1fr !important;
    }
}









/* --- CSS FOR WIDE HORIZONTAL DROPDOWN (FINAL HOVER FIX) --- */

/* The main menu bar container needs to be a positioning reference */
/*.menu {*/
/*    position: relative;*/
/*}*/

/* The parent list item for the dropdown */
/*.menu li.horizontal-dropdown {*/
    /* This element doesn't need special positioning */
/*    position: static;*/
/*}*/

/* 
  THE FIX IS HERE: We create an invisible element that sits in the gap.
  This '::before' pseudo-element acts as a bridge for the mouse.
*/
/*.menu li.horizontal-dropdown:hover::before {*/
/*    content: '';*/
/*    position: absolute;*/
    top: 100%; /* Sits right below the main menu bar */
/*    left: 0;*/
/*    right: 0;*/
    height: 15px; /* The height of the gap */
    background: transparent; /* It's completely invisible */
    z-index: 1001; /* Sits above the dropdown content */
/*}*/

/* Style for the dropdown arrow icon */
/*.menu li.horizontal-dropdown > a .fa-chevron-down {*/
/*    font-size: 0.8em;*/
/*    margin-left: 5px;*/
/*}*/

/* The dropdown container (Hidden by default) */
/*.horizontal-dropdown .dropdown-content {*/
/*    display: none;*/
/*    position: absolute;*/
/*    top: 100%;*/
/*    left: 0;*/
/*    background-color: #fff;*/
/*    width: 1296px;*/
/*    max-width: 100%;*/
/*    box-shadow: 0px 8px 16px rgba(0,0,0,0.15);*/
/*    z-index: 1000;*/
/*    padding: 20px 25px;*/
/*    border-top: 1px solid #000;*/
/*    text-align: left;*/
    margin-top: 10px; /* This creates the visual gap you wanted */
/*}*/

/* Links inside the dropdown */
/*ul.menu li.horizontal-dropdown .dropdown-content a {*/
/*    color: #000;*/
/*    text-decoration: none;*/
/*    display: inline-block;*/
/*    margin-right: 30px;*/
/*    font-weight: 500;*/
/*    font-size: 1em;*/
/*    transition: color 0.2s ease-in-out;*/
/*}*/

/* Hover effect for the links */
/*ul.menu li.horizontal-dropdown .dropdown-content a:hover {*/
/*    color: red;*/
/*}*/

/* Show the dropdown menu when hovering over the parent list item */
/*.menu li.horizontal-dropdown:hover .dropdown-content {*/
/*    display: block;*/
/*}*/









