/* ===================================
   Shared Stylesheet
   =================================== */

/* Import Open Sans and Inter fonts from Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}


/*::selection {
    background-color:#708090;
    color: #e8f0f7;
}

::-moz-selection {
    background-color:#708090;
    color: #e8f0f7;
}*/

body {
    font-family: 'Inter', system-ui, sans-serif;
    padding: 0px;
    background:	#D3D3D3;
/*background-size: 12px 12px;
background-image: 
    linear-gradient(to right, rgba(0, 0, 0, 0.10) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(0, 0, 0, 0.10) 1px, transparent 1px);*/
    color: #333;
    margin: 0;
    width: 100%;
    overflow-x: hidden;
}

body.dark-mode {
    background: #1a2332;  /* Lighter midnight blue */
    color: #e8f0f7;  /* Soft white-blue text */
}

/* Page content containers */
.page-content {
    padding-top: 10px;
}

.container {
    max-width: 1100px;
    width: 100%;
    margin: 0 auto;
    background: #F9F9F9;
    padding: 10px;
    border-radius: 6px;
    position: relative;
    margin-bottom: 10px; /* distance main body to footer */
	border: 2px solid 	#708090;
    box-sizing: border-box;
}

#footer {
  text-align: center;
}

#footer a {
    color: #333;
    text-decoration: none;
    padding: 4px 6px;
    border-radius: 2px;
}

body.dark-mode #footer a {
    color: #e8f0f7;  /* Soft white-blue */
    background: #1a2332;  /* Match body background */
}

#footer a:visited {
    color:#333;
}

body.dark-mode #footer a:visited {
    color: #b8c9db;  /* Muted blue-white */
}

#footer a:hover {
    background-color:#DCDCDC;
    color:#333;
    text-decoration: none;
}

body.dark-mode #footer a:hover {
    background-color: #304560;  /* Lighter blue hover */
}

body.dark-mode .container {
    background: #1a2332;  /* Midnight blue container */
    border-color: #2d4a6b;  /* Muted blue-grey border */
}

h1 {
    color: #2F4F4F;
    margin-bottom: 3px;
    font-weight: normal;
	font-size: 24px;
}

body.dark-mode h1 {
    color: #e8f0f7;
}

h2 {
    color: #333;
    font-size: 14px;
    font-weight: normal;
    padding-top: 5px;
    padding-bottom: 5px;
    margin-top: 5px;
    margin-bottom: 5px;
    text-decoration: none;
    border-bottom: none;
}

.site-title {
    color:  #2F4F4F;
    text-decoration: none;
    font-size: inherit;
    font-weight: normal;
    display: inline-block;
	border-bottom: none;
}

/*.site-title:hover {
    color: 	#5F9EA0;
}*/

body.dark-mode .site-title {
    color: #e8f0f7;
}

body.dark-mode .site-title:hover {
    color: #b8c9db;
}


body.dark-mode h2 {
    color: #e8f0f7;
}

h3 {
   color: #333;
    font-size: 14px;
    font-weight: normal;
    padding-top: 5px;
    padding-bottom: 5px;
    margin-top: 5px;
    margin-bottom: 5px;
    text-decoration: none;
    border-bottom: none;
}

body.dark-mode h3 {
    color: #e8f0f7;
}

.subtitle {
    color: #333;
    margin-bottom: 30px;
	font-size: 14px;
	line-height: 1.5;
}

body.dark-mode .subtitle {
    color: #b8c9db;
}

/* Horizontal rule styling */
hr {
    border: none;
    height: 3px;
    background-color: 	#5F9EA0;
    border-radius: 2px;
    margin-bottom: 10px;
}


/* Theme Toggle Button - Upper Right Corner */
.theme-toggle {
    position: absolute;
    top: 2px;
    right: 2px;
    padding: 9px;
    background: transparent;
    border: none;
    width: 33px;
    height: 33px;
    cursor: pointer;
    z-index: 9999;    
    border-radius: 4px;
    outline: 1px solid transparent;
    transition: all 0.2s ease;
}

/* Light mode hover */
.theme-toggle:hover {
    background: #E1E1E1;
    outline: 1px solid #808080;
}

/* Dark mode hover */
body.dark-mode .theme-toggle:hover {
    background: #3a3a3a;
    outline: 1px solid #808080;
}

.theme-toggle svg {
    width: 100%;
    height: 100%;
    display: block;
}

body.dark-mode .theme-toggle {
    color: #7a9bbd;
}

/* Show sun in light mode, hide moon/sunglasses */
.theme-toggle .sun {
    display: block;
}

.theme-toggle .moon,
.theme-toggle .sunglasses {
    display: none;
}

/* Show sunglasses in dark mode, hide sun/moon */
body.dark-mode .theme-toggle .sun,
body.dark-mode .theme-toggle .moon {
    display: none;
}

body.dark-mode .theme-toggle .sunglasses {
    display: block;
}


.file-menu-container {
    position: relative;
    margin-bottom: 15px;
    z-index: 1000;
}

.file-menu-button {
    padding: 4px 10px;
    font-size: 14px;
    font-weight: bold;
    background: #F9F9F9;
    color: #2F4F4F;
    border: 1px solid#DCDCDC;
    border-radius: 2px;
    cursor: pointer;}

body.dark-mode .file-menu-button {
    background: #1a2332;
    color: #e8f0f7;
    border-color: #2d4a6b;
}

.file-menu-button:hover {
    background: #e8e8e8;
}

body.dark-mode .file-menu-button:hover {
    background: #2a3f56;
}

.file-menu-dropdown {
  display: none;
  position: absolute;
  top: 0px;
  left: 40px;
  z-index: 1001;
  min-width: 190px;
  padding: 2px 0;
  border-radius: 2px; /* softer corners for glass look */

  /* Glassmorphism core */
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.35),
    rgba(255, 255, 255, 0.15)
  );
  border: 1px solid rgba(255, 255, 255, 0.35);
  box-shadow:
    0 8px 24px rgba(0, 0, 0, 0.18),
    inset 0 1px rgba(255, 255, 255, 0.35);

  backdrop-filter: blur(14px) saturate(120%);
  -webkit-backdrop-filter: blur(14px) saturate(120%);
}

/* Fallback for browsers without backdrop-filter */
@supports not (backdrop-filter: blur(14px)) {
  .file-menu-dropdown {
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
  }
}


body.dark-mode .file-menu-dropdown {
    background: #243447;
    border-color: #2d4a6b;
}

.file-menu-dropdown.show {
    display: block;
}

.file-menu-item {
    padding: 10px 20px;
    cursor: pointer;
    border-bottom: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #333;
    font-size: 14px;
}

body.dark-mode .file-menu-item {
    color: #e8f0f7;
}

.file-menu-item:hover {
    background: #e0e0e0;
}

body.dark-mode .file-menu-item:hover {
    background: #2a3f56;
}

.file-menu-shortcut {
    color: #6b8aac;
    font-size: 13px;
    margin-left: 20px;
}


/* Content sections */
.content-section {
        margin-top: 10px;
	    margin-bottom: 10px;
}

.content-section h2 {
    color: #333;
    border-bottom: 2px solid #333;
    padding-bottom: 10px;
    margin-bottom: 20px;
}

body.dark-mode .content-section h2 {
    color: #e8f0f7;  /* Soft white-blue to match light mode's dark gray */
    border-color: #5F9EA0;  /* Cadet blue to match site's teal accent */
}

.content-section p {
    line-height: 1.6;
    margin-bottom: 15px;
}

.content-section ul {
    margin-left: 30px;
    margin-bottom: 15px;
}

.content-section li {
    margin-bottom: 8px;
    line-height: 1.5;
}

/* Definition terms */
.definition-term {
    font-weight: normal;
    font-size: 16px;
    color: #333;
    margin-bottom: 5px;
}

body.dark-mode .definition-term {
    color: #5dade2;
}

/* Documentation header link styles */
.doc-header-link {
    color: inherit;
    text-decoration: none;
    border-bottom: none;
}

.doc-header-link:visited {
    color: inherit;
}

.doc-header-link:hover {
    border-bottom: 1px solid #778899;
}

body.dark-mode .doc-header-link:hover {
    border-bottom: 1px solid #e8f0f7;
}

/* Documentation first-mention link styles */
.doc-first-mention {
    color: inherit;
    text-decoration: none;
    border-bottom: 1px solid #778899
}

.doc-first-mention:visited {
    color: inherit;
}

.doc-first-mention:hover {
    border-bottom: none;
}

body.dark-mode .doc-first-mention {
    border-bottom-color: #e8f0f7;
}

/* Buttons */
button {
    padding: 10px 20px;
    font-size: 14px;
    border: none;
    border-radius: 2px;
    cursor: pointer;
}

/* Universal calculator label styling */
.calculator-label {
    display: block;
    margin-bottom: 5px;
    font-size: 14px;
    color: #333;
}

body.dark-mode .calculator-label {
    color: #e8f0f7;
}

/* Preamble bullet list - 2 columns with square bullets */
.preamble-list {
    list-style-type: square;
    column-count: 2;
    column-gap: 2rem;
    padding-left: 1.0rem;
    margin: 1.5rem 0;
    font-size: 14px;
}

.preamble-list li {
    margin-bottom: 0.25rem;
    break-inside: avoid;
    color: #333;
}

.preamble-list li::marker {
    color: #708090; /* Bullet color (slate gray) */
}

body.dark-mode .preamble-list li {
    color: #b8c9db; /* Lighter text color for dark mode */
}

body.dark-mode .preamble-list li::marker {
    color: #9db4c9; /* Lighter bullet color for dark mode */
}

@media (max-width: 768px) {
    .preamble-list {
        column-count: 1;
    }
}

/* Homepage Table Styling - Matches documentation tables */
.homepage-table {
    width: 100%;
    max-width: 900px;
    margin: 0px auto;
    border-collapse: collapse;
    font-size: 14px;
}

.homepage-table th,
.homepage-table td {
    border: 1px solid #778899;
    padding: 10px;
    text-align: left;
}

.homepage-table th {
    background:#DCDCDC;
    color:#333;
    font-weight: normal;
	text-align: center;
	padding: 10px;
}

body.dark-mode .homepage-table th {
    background-color: #898989;
    color: #F9F9F9;
}

.homepage-table td {
    background:#F5F5F5;
    line-height: 1.6;
}

body.dark-mode .homepage-table td {
    background: #2a3f56;
    color: #e0e0e0;
}

body.dark-mode .homepage-table th,
body.dark-mode .homepage-table td {
    border-color: #898989;
}

.homepage-table .calculator-link {
    color: #333;
    text-decoration: none;
    border-bottom: none;
}

.homepage-table .calculator-link:hover {
    border-bottom: 1px solid #778899;
}

body.dark-mode .homepage-table .calculator-link {
    color: #e0e0e0;
    border-bottom-color: #898989;
}

body.dark-mode .homepage-table .calculator-link:hover {
    color: #e0e0e0;
}

/* Column widths */
.homepage-table th:nth-child(1),
.homepage-table td:nth-child(1) {
    width: 30%;
    text-align: center;
}

.homepage-table th:nth-child(2),
.homepage-table td:nth-child(2) {
    width: 70%;
    text-align: left;
}

.documentation-link {
    color: #333;
    text-decoration: none;
    border-bottom: 1px solid #778899;
	}

.documentation-link:visited {
    color: #333;
}

.documentation-link:hover {
border-bottom: none;
}

body.dark-mode .documentation-link {
    color:#b8c9db;
    border-bottom-color:#b8c9db;
}

body.dark-mode .documentation-link:visited {
    color: #b8c9db;
}

body.dark-mode .documentation-link:hover {
    color: #b8c9db;
    border-bottom: none;
}

/* ===================================
   DOCUMENTATION PAGE STYLES
   =================================== */

.paper-content {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
    line-height: 1.8;
}

.paper-title {
    text-align: center;
    font-size: 24px;
    margin-bottom: 10px;
    color: #333;
}

body.dark-mode .paper-title {
    color: #e8f0f7;
}

.paper-subtitle {
    text-align: center;
    font-style: normal;
    margin-bottom: 10px;
    color: #333;
}

body.dark-mode .paper-subtitle {
    color: #b8c9db;
}

.section-heading {
    font-size: 17px;
    font-weight: bold;
    margin-top: 20px;
    margin-bottom: 3px;
    color: #333;
    border-bottom: 1px solid #333;
}

body.dark-mode .section-heading {
    color: #008080;  /* Medium purple - matches panel-input */
    border-bottom-color: #2d4a6b;
}

.subsection-heading {
    font-size: 15px;
    font-weight: bold;
    margin-top: 10px;
    margin-bottom: 5px;
    color: #2F4F4F;
}

body.dark-mode .subsection-heading {
    color: #1E90FF;  /* Orange - matches panel-output */
}

.definition-term {
    font-weight: normal;
    color: #4682B4;
    margin-top: 10px;
}

body.dark-mode .definition-term {
    color: #4682B4; 
}

.equation {
    background:	#FFFFF0;
    border: 2px solid 	#808080;
    border-radius: 2px;
    padding: 10px 20px;
    margin: 10px 0;
    font-size: 14px;
    overflow-x: auto;
}

body.dark-mode .equation {
    background: #243447;
    border-color: #4a8f6f;
    color: #e8f0f7;
}

.technical-table {
    width: 100%;
    border-collapse: collapse;
    margin: 10px 0;
    font-size: 14px;
}

.technical-table th,
.technical-table td {
    border: 1px solid #778899;
    padding: 5px;
    text-align: center;
}

.technical-table th {
    background: #DCDCDC;
    color: #333;
    font-weight: normal;
}

body.dark-mode .technical-table th {
    background-color: #2a3f56;
    color: #e8f0f7;
}

.technical-table td {
    background: #F5F5F5;
}

body.dark-mode .technical-table td {
    background: #243447;
    color: #e8f0f7;
}

body.dark-mode .technical-table th,
body.dark-mode .technical-table td {
    border-color: #2d4a6b;
}

.note-box {
    background: #F5FFFA;
    border: 2px solid #778899;
    border-radius: 2px;
    padding: 15px;
    margin: 15px 0;
}

body.dark-mode .note-box {
    background: #2a3f56;
    border-color: #4db8c4;
    color: #e8f0f7;
}

/* Universal Labels - Dark Mode */
body.dark-mode label,
body.dark-mode .theme-label {
    color: #e8f0f7 !important;
}

/* Universal Tables - Dark Mode */
body.dark-mode table th {
    background: #2a3f56 !important;
    color: #e8f0f7 !important;
    border-color: #2d4a6b !important;
}

body.dark-mode table td {
    background: #243447 !important;
    color: #e8f0f7 !important;
    border-color: #2d4a6b !important;
}

/* Table label/header cells (darker background) */
body.dark-mode table .label-col-1,
body.dark-mode table .label-col-2,
body.dark-mode table .parameter-label,
body.dark-mode table .parameter-category,
body.dark-mode table .section-label {
    background: #2a3f56 !important;
    color: #e8f0f7 !important;
}

/* Table input cells (match form input background) */
body.dark-mode table .input-col,
body.dark-mode table .parameter-input {
    background: #243447 !important;
}

/* ===================================
   MASONRY GRID & PANEL LAYOUTS
   Standardized across all calculators
   =================================== */

/* Masonry Grid Container - 2-Column Grid Layout with Auto Rows */
.masonry-grid {
    column-count: 2;
    column-gap: 15px;
    margin-top: 15px;
    max-width: 100%;
}

/* Responsive breakpoints for masonry grid */
@media (max-width: 768px) {
    .masonry-grid {
        column-count: 1;
    }
}

/* Panel/Box Container - Base Styling */
.panel {
    background:#FFFFFF;
    padding: 10px;
    border-radius: 4px;
    border: 1px solid #778899;
    margin-bottom: 15px;
    break-inside: avoid; /* Prevent panel from breaking across columns */
    page-break-inside: avoid; /* Legacy support */
}

/* Panel Headings */
.panel h2,
.panel h3 {
    font-size: 14px;
    color: #333;

    margin-top: 0px;
    margin-bottom: 0px;
    padding: 0px;
}

/* Dark Mode - Panels */
body.dark-mode .panel {
    background: #1a2332;
    border-color: #2d4a6b;
}

body.dark-mode .panel h2,
body.dark-mode .panel h3 {
    color: #e8f0f7;
}

/* Panel Input/Output Label Colors */
h3.panel-input,
.input-section h3.panel-input,
.panel h3.panel-input {
    color:#FF8C00;
    font-weight: normal;
    margin-bottom: 10px; /*added to make input label vertical padding above its table match the output label vertical padding*/
}

body.dark-mode h3.panel-input,
body.dark-mode .input-section h3.panel-input,
body.dark-mode .panel h3.panel-input {
    color: #FF8C00;
    margin-bottom: 10px; /*added to make input label vertical padding above its table match the output label vertical padding*/
}

h3.panel-output,
.input-section h3.panel-output,
.panel h3.panel-output {
    color: #5F9EA0;
    font-weight: normal;
}

body.dark-mode h3.panel-output,
body.dark-mode .input-section h3.panel-output,
body.dark-mode .panel h3.panel-output {
    color: #5F9EA0;
}

/* Mobile: Reduce panel padding */
@media (max-width: 768px) {
    .panel {
        padding: 10px;
    }
}

/* Universal Panels/Sections - Dark Mode */
body.dark-mode .input-section,
body.dark-mode .results-section {
    background: #1a2332 !important;
    border-color: #2d4a6b !important;
}

/* ===================================
   SHARED TABLE STYLES
   Used by multiple calculators
   =================================== */

/* 3-Column Input Tables (Section | Label | Input) */
.measurements-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.measurements-table td {
    padding: 6px 8px;
    border: 1px solid #A9A9A9;
}

.measurements-table .label-col-1 {
    background:#DCDCDC;
    color: #333;
    font-weight: normal;
    text-align: center;
    vertical-align: middle;
    width: 20%;
}

.measurements-table .label-col-2 {
    background:#F9F9F9;
    color: #333;
    text-align: left;
    font-weight: normal;
    width: 45%;
}

.measurements-table .input-col {
    background: #FFFFFF;
    width: 35%;
}

.measurements-table input[type="number"],
.measurements-table select {
    width: 100%;
    padding: 4px;
    border: none;
    border-radius: 2px;
    font-size: 14px;
    background:#FFFFFF;
    color: #333;
}

/* Center em dash in text inputs (used for disabled/inapplicable cells) */
.measurements-table input[type="text"] {
    width: 100%;
    padding: 4px;
    border: none;
    border-radius: 2px;
    font-size: 14px;
    background:#FFFFFF;
    color: #333;
}

/* Optional: Dim disabled inputs for visual distinction */
.measurements-table input:disabled {
    color: #6b8aac;
}

/* Dark mode adjustments */
body.dark-mode .measurements-table input[type="number"],
body.dark-mode .measurements-table select {
    background: #2a3f56 !important;
    color: #e8f0f7 !important;

}

body.dark-mode .measurements-table input[type="text"] {
    background: #2a3f56 !important;
    color: #e8f0f7 !important;

}

body.dark-mode .measurements-table input:disabled {
    color: #5a7a9e !important;
}

/* Dark Mode - Measurements Table */
body.dark-mode .measurements-table .label-col-1,
body.dark-mode .measurements-table .label-col-2 {
    background: #2a3f56 !important;
    color: #e8f0f7 !important;
}

body.dark-mode .measurements-table .input-col {
    background: #243447 !important;
}

body.dark-mode .measurements-table td {
    border-color: #2d4a6b !important;
}

body.dark-mode .measurements-table input[type="number"],
body.dark-mode .measurements-table select {
    background: #2a3f56 !important;
    color: #e8f0f7 !important;
}

body.dark-mode .measurements-table input[type="number"]:focus,
body.dark-mode .measurements-table select:focus {
    border: 1px solid #5dade2;
}

/* ===================================
   RESULTS TABLES (IEC & NEC Cable Sizing)
   =================================== */
.results-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 8px;
}

.results-table th,
.results-table td {
    border: 1px solid #A9A9A9;
    padding: 6px 6px;
    font-size: 14px;   
}

.results-table thead tr {
    background-color: #DCDCDC;
    font-weight: normal;
    color: #333;
}

.results-table tbody tr {
    background-color: #F9F9F9;
}

.results-table td:nth-child(1) {
    width: 43%;
}
.results-table td:nth-child(2) {
    width: 32%;
    text-align: center;
}
.results-table td:nth-child(3) {
    width: 25%;
    text-align: center;
}

.results-highlight {
    font-weight: normal;
}

/* Dark Mode - Results Tables */
body.dark-mode .results-table th {
    background-color: #2a3f56;
    color: #e8f0f7;
}

body.dark-mode .results-table td {
    border-color: #2d4a6b;
    color: #e8f0f7;
}

body.dark-mode .results-table thead tr {
    background-color: #2a3f56;
}

body.dark-mode .results-table tbody tr {
    background-color: #243447;
}

/* ===================================
   VALIDATION TABLES (IEC & NEC Cable Sizing)
   =================================== */
.validation-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
    font-size: 14px;
}

.validation-table th,
.validation-table td {
    padding: 8px;
    text-align: left;
    border: 1px solid #A9A9A9;
    background: #F9F9F9;
}

.validation-table th {
    background: #DCDCDC;
    font-weight: normal;
    color: #333;
    text-align: center;
}

.validation-table td:first-child {
    width: 40%;
}

.validation-table td:last-child {
    width: 60%;
}

body.dark-mode .validation-table th {
    background: #2a3f56;
    color: #e8f0f7;
}

body.dark-mode .validation-table td {
    background: #243447;
    color: #e8f0f7;
    border-color: #2d4a6b;
}

/* ===================================
   PROJECT TITLE INPUT (UNIFIED)
   =================================== */

.project-title-input {
    width: 120px;
    padding: 5px;
    border: 1px solid #A9A9A9;
    border-radius: 2px;
    font-size: 14px;
    height: 30px;
    background:#FFFFFF;
    color: #333;

}

.project-title-input:focus {
    border-color: #4db8c4;
}

body.dark-mode .project-title-input {
    background: #1e2d3d;  /* Dark blue input background */
    color: #e8f0f7;  /* Soft white-blue text */
    border-color: #2d4a6b;
}

body.dark-mode .project-title-input:focus {
    border-color: #5dade2;
}

/* ===================================
   LIST STYLING (DOCUMENTATION PAGES)
   =================================== */

/* Unordered lists - square bullets */
ul {
    list-style-type: square;
    margin-left: 25px;
    margin-top: 10px;
    margin-bottom: 10px;
}

ul li {
    margin-bottom: 5px;
    padding-left: 8px;
}

/* Ordered lists */
ol {
    margin-left: 25px;
    margin-top: 10px;
    margin-bottom: 10px;
}

ol li {
    margin-bottom: 5px;
    padding-left: 8px;
}

/* Nested lists */
ul ul, ol ul, ul ol, ol ol {
    margin-top: 5px;
    margin-bottom: 5px;
}