/* ==========================================================================
   HVAC ENGINEERING PORTAL - MASTER STYLESHEET
   ========================================================================== */

/* 1. GENERAL RESET & TYPOGRAPHY */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    background-color: #e5e5e5; 
    color: #1d1d1f; 
}

/* ==========================================================================
   2. MASTER NAVIGATION RIBBON (Slate / RAF Blue)
   ========================================================================== */
.navbar {
    background-color: #3a4f63; /* Duller, softer English Slate Blue */
    border-bottom: 3px solid #c5a059; /* Subtle gold accent line */
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 12px 30px; 
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.nav-brand {
    font-family: 'Aptos', -apple-system, sans-serif;
    font-size: 24px;
    font-weight: 700;
    color: #ffffff;
    text-decoration: none;
    letter-spacing: 0.5px;
    white-space: nowrap;
    width: 20%; 
}

.nav-links {
    list-style-type: none;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-grow: 1; 
}

.nav-links > li {
    position: relative; 
    margin: 0 8px; 
}

.nav-links > li > a {
    display: inline-block;
    color: #ffffff;
    background-color: transparent;
    text-align: center;
    padding: 8px 24px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.5px;
    border-radius: 40px; 
    border: 2px solid #ffffff; 
    transition: all 0.3s ease;
}

.nav-links > li > a:hover, .nav-links > li:hover > a.dropbtn {
    background-color: #ffffff;
    color: #3a4f63; /* Reverts to Slate Blue on hover */
}

/* The Search Bar Input */
.nav-search {
    position: relative; 
    width: 100%;
    max-width: 280px; 
    display: flex;
    justify-content: flex-end;
}

.nav-search input {
    width: 100%;
    padding: 10px 16px;
    border-radius: 6px; /* Flat, modern edges */
    border: 1px solid #ffffff;
    outline: none;
    font-size: 14px;
    background-color: #ffffff;
    color: #1d1d1f;
    transition: box-shadow 0.3s ease;
}

.nav-search input:focus {
    box-shadow: 0 0 0 3px rgba(197, 160, 89, 0.5); 
}

/* ==========================================================================
   3. DROPDOWN MENUS
   ========================================================================== */
.dropdown-content {
    opacity: 0;
    visibility: hidden; 
    position: absolute;
    background-color: #ffffff;
    min-width: 220px;
    box-shadow: 0px 15px 35px rgba(0,0,0,0.2);
    border-radius: 12px;
    top: calc(100% + 15px); 
    left: 50%;
    transform: translateX(-50%) translateY(-10px); 
    z-index: 1;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    padding: 10px 0;
    border: 1px solid #e0e0e0;
}

.dropdown-content > a, 
.sub-dropbtn {
    color: #1d1d1f; 
    padding: 14px 24px;
    text-decoration: none;
    display: block;
    text-align: left;
    font-size: 14px;
    font-weight: 500;
    transition: background-color 0.2s ease;
    cursor: pointer;
}

.dropdown-content > a:hover, 
.sub-dropbtn:hover {
    background-color: #f0f4f8; 
}

.dropdown:hover .dropdown-content {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.sub-dropdown {
    position: relative;
    display: block;
    width: 100%;
}

.sub-dropdown-content {
    display: none; 
    position: absolute;
    background-color: #ffffff;
    min-width: 240px;
    box-shadow: 0px 15px 35px rgba(0,0,0,0.2);
    border-radius: 12px;
    top: -10px; 
    left: 100%; 
    margin-left: 8px; 
    z-index: 10;
    padding: 10px 0;
    border: 1px solid #e0e0e0;
}

.sub-dropdown-content a {
    color: #1d1d1f;
    padding: 14px 24px;
    text-decoration: none;
    display: block;
    text-align: left;
    font-size: 14px;
    font-weight: 500;
}

.sub-dropdown-content a:hover {
    background-color: #f0f4f8;
}

.sub-dropdown:hover .sub-dropdown-content {
    display: block;
}

/* ==========================================================================
   4. LAYOUT CONTAINERS
   ========================================================================== */
.content {
    padding: 80px 20px;
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
}

.article-content {
    max-width: 950px;
    margin: 60px auto; 
    padding: 80px 100px; 
    background-color: #ffffff;
    border-radius: 12px;
    box-shadow: 0px 10px 40px rgba(0,0,0,0.08);
    text-align: left;
}

.calc-container {
    max-width: 950px;
    margin: 40px auto;
    padding: 50px 60px;
    background-color: #ffffff;
    border-radius: 12px;
    box-shadow: 0px 10px 40px rgba(0,0,0,0.08);
}

/* ==========================================================================
   5. UNIFIED TYPOGRAPHY (Fixes the page-to-page mismatches)
   ========================================================================== */
h1 {
    font-size: 40px;
    font-weight: 600;
    color: #1d1d1f; /* Consistent Dark Grey/Black everywhere */
    letter-spacing: -0.5px;
    margin-bottom: 20px;
}

.ncc-document h1, .calc-container h1 {
    text-align: center; 
}

h2 {
    font-size: 28px;
    font-weight: 600;
    color: #1d1d1f; /* Consistent Dark Grey/Black everywhere */
    margin-bottom: 24px;
}

h3 {
    color: #555555;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-top: 30px;
    margin-bottom: 12px;
}

p, li {
    font-size: 17px; 
    margin-bottom: 24px;
    line-height: 1.8; 
    color: #333333;
}

.content p {
    text-align: center;
    color: #86868b;
}

.intro-text {
    text-align: justify;
}

ul {
    margin-bottom: 30px;
    padding-left: 28px;
}

li {
    margin-bottom: 16px; 
}

strong {
    color: #000000;
    font-weight: 600;
}

.class-divider {
    border: 0;
    height: 1px;
    background-color: #e5e5ea; 
    margin: 20px 0 40px 0; 
}

.engineering-note {
    background-color: #f0f4f8; 
    border-left: 4px solid #3a4f63; /* Accents using the new Slate Blue */
    padding: 24px 32px;
    font-size: 16px; 
    line-height: 1.8;
    margin-top: 30px;
    margin-bottom: 30px;
    border-radius: 0 8px 8px 0;
    color: #222222;
}

.reference-link {
    display: inline-block;
    background-color: #ffffff;
    color: #1d1d1f; /* Standardized to dark grey */
    padding: 12px 24px;
    border-radius: 30px;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 50px;
    transition: all 0.3s ease;
    border: 2px solid #1d1d1f; /* Standardized to dark grey */
}

.reference-link:hover {
    background-color: #1d1d1f;
    color: #ffffff;
}

/* ==========================================================================
   6. CALCULATOR INTERFACE STYLING
   ========================================================================== */
.calc-tabs {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 40px;
    border-bottom: 2px solid #e5e5ea;
    padding-bottom: 20px;
}

.calc-tab-btn {
    background-color: #f0f4f8;
    color: #3a4f63;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.calc-tab-btn:hover {
    background-color: #d2d2d7;
}

.calc-tab-btn.active {
    background-color: #3a4f63;
    color: #ffffff;
}

.calc-section {
    display: none; 
    animation: fadeIn 0.3s ease-in-out;
}

.calc-section.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

.input-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
    margin-bottom: 30px;
}

.input-group {
    display: flex;
    flex-direction: column;
    text-align: left;
}

.input-group label {
    font-size: 14px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 8px;
}

.input-group input {
    padding: 12px 16px;
    font-size: 16px;
    border: 2px solid #d2d2d7;
    border-radius: 8px;
    outline: none;
    transition: border-color 0.2s ease;
    font-family: inherit;
}

.input-group input:focus {
    border-color: #3a4f63;
    box-shadow: 0 0 0 3px rgba(58, 79, 99, 0.15);
}

.sci-notation {
    font-size: 14px; 
    color: #1d1d1f; 
    font-weight: 700; 
    margin-top: 8px;
    min-height: 20px; 
    font-family: "Courier New", Courier, monospace;
}

/* ==========================================================================
   7. LIVE SEARCH DROPDOWN UI (Clean / Flat Design)
   ========================================================================== */
.search-dropdown {
    display: none; 
    position: absolute;
    top: calc(100% + 5px); 
    left: 0;
    right: 0;
    width: 100%;
    background-color: #ffffff;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    border: 1px solid #d2d2d7;
    z-index: 1000;
    max-height: 400px;
    overflow-y: auto;
}

.search-result-item {
    display: block;
    padding: 12px 16px;
    text-decoration: none !important; /* Forces removal of blue underlines */
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.1s ease;
    text-align: left;
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item:hover {
    background-color: #f5f5f5; 
}

.search-title {
    color: #333333 !important; 
    font-weight: 500;
    font-size: 14px;
    margin-bottom: 2px;
}

.search-category {
    color: #888888; 
    font-size: 11px;
    font-weight: 400;
}

.search-no-results {
    padding: 16px;
    color: #86868b;
    font-size: 14px;
    text-align: center;
    font-style: italic;
}
