/* Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Roboto', 'Segoe UI', sans-serif;
}

body {
  background-color: #f9fbfd;
  line-height: 1.6;
  color: #333;
  overflow-x: hidden;
}

a {
  text-decoration: none;
  color: #2F586A;
  transition: color 0.3s ease;
}

a:hover {
  color: #1a3a49;
}

/* Improved Header Styles */
#header {
  background-color: #2F586A;
  background-image: linear-gradient(135deg, #2F586A, #1a3a49);
  padding: 3% 3%;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 70px;
}

/* Logo and Company Name */
#header-logo-name {
  display: flex;
  align-items: center;
  transition: transform 0.3s ease;
}

#header-logo-name:hover {
  transform: translateY(-2px);
}

#logo {
  height: 50px;
  width: 50px;
  border-radius: 12px;
  object-fit: cover;
}

#company-name {
  font-size: 1.5rem;
  color: white;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
  margin-left: 1rem;
}

/* Search Section - Enhanced */
#header-right {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

#search-post-div {
  position: relative;
  transition: width 0.3s ease;
}

#search-post {
  height: 40px;
  width: clamp(200px, 25vw, 300px);
  border: none;
  border-radius: 20px;
  padding: 0 1rem 0 2.8rem;
  background-image: url('../img/search_icon.png');
  background-size: 16px 16px;
  background-repeat: no-repeat;
  background-position: 15px center;
  font-size: 0.9rem;
  color: #2F586A;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

#search-post:focus {
  outline: none;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
  width: clamp(220px, 30vw, 350px);
}

#search-post::placeholder {
  color: #8aa5b1;
  font-size: 0.85rem;
}

#searchResultDiv {
  position: absolute;
  top: calc(100% + 5px);
  left: 0;
  background-color: white;
  width: 100%;
  border-radius: 10px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
  z-index: 1000;
  max-height: 300px;
  overflow-y: auto;
  display: none;
}

.postSearchDiv {
  padding: 0.8rem 1rem;
  cursor: pointer;
  border-bottom: 1px solid #f0f0f0;
  transition: background-color 0.2s ease;
  display: flex;
  align-items: center;
}

.postSearchDiv:last-child {
  border-bottom: none;
}

.postSearchDiv:hover {
  background-color: #f5f9fc;
}

.postSearchDiv:active {
  background-color: #e1ecf4;
}

.postSearchCard {
  color: #2F586A;
  font-size: 0.9rem;
  margin: 0;
  font-weight: 500;
}

/* Navigation Buttons */
#home-about-div {
  display: flex;
  gap: 0.8rem;
}

#home-btn, #about-btn {
  background-color: rgba(255, 255, 255, 0.12);
  color: white;
  border: none;
  padding: 0.5rem 1.2rem;
  border-radius: 50px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  z-index: 1;
}

#home-btn:hover, #about-btn:hover {
  background-color: rgba(255, 255, 255, 0.25);
  transform: translateY(-2px);
}

#home-btn:after, #about-btn:after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background-color: white;
  transform: scaleX(0);
  transition: transform 0.3s ease;
}

#home-btn:hover:after, #about-btn:hover:after {
  transform: scaleX(1);
}

/* Login/Signup Section - Enhanced */
#login-signup {
  display: none;
  align-items: center;
  gap: 0.8rem;
}

#login-btn {
  background-color: transparent;
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.7);
  padding: 0.6rem 1.2rem;
  font-size: 0.9rem;
  border-radius: 50px;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

#login-btn:hover {
  background-color: rgba(255, 255, 255, 0.15);
  transform: translateY(-2px);
  border-color: white;
}

#signup-btn {
  background-color: white;
  color: #2F586A;
  border: none;
  padding: 0.6rem 1.2rem;
  font-size: 0.9rem;
  border-radius: 50px;
  cursor: pointer;
  font-weight: 500;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

#signup-btn:hover {
  background-color: #f0f0f0;
  transform: translateY(-2px);
  box-shadow: 0 5px 12px rgba(0, 0, 0, 0.2);
}

/* Main Content Layout */
#full-page-content-div {
  margin: 2% 2%;
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
}

/* Calculator Main Section */
.calculator-main-div {
  flex: 1 1 70%;
  min-width: 300px;
}

.calculator-wrapper {
  background-color: white;
  border-radius: 10px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
  padding: 2rem;
  transition: all 0.3s ease;
}

.calculator-header {
  text-align: center;
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 2px solid #2F586A;
}

.calculator-header h1 {
  color: #2F586A;
  font-size: 2rem;
  margin-bottom: 0.5rem;
  font-weight: 700;
}

.calculator-header p {
  color: #5a7d8f;
  font-size: 1rem;
}

/* Units Toggle */
.units-toggle {
  display: flex;
  justify-content: center;
  margin-bottom: 2rem;
}

.units-checkbox {
  display: none;
}

.units-toggle-label {
  display: flex;
  align-items: center;
  background-color: #f5f9fc;
  border-radius: 50px;
  padding: 0.4rem;
  cursor: pointer;
  position: relative;
  width: 200px;
  height: 45px;
  border: 2px solid #d9e2e7;
  transition: all 0.3s ease;
}

.units-toggle-label:hover {
  border-color: #2F586A;
}

.toggle-text {
  flex: 1;
  text-align: center;
  padding: 0.5rem 1rem;
  font-weight: 600;
  font-size: 0.9rem;
  z-index: 2;
  transition: color 0.3s ease;
  color: #5a7d8f;
}

.toggle-us {
  color: #2F586A;
}

.units-checkbox:checked ~ .units-toggle-label .toggle-us {
  color: #5a7d8f;
}

.units-checkbox:checked ~ .units-toggle-label .toggle-metric {
  color: #2F586A;
}

.units-toggle-label::before {
  content: '';
  position: absolute;
  width: 50%;
  height: calc(100% - 8px);
  background-color: #2F586A;
  border-radius: 50px;
  left: 4px;
  top: 4px;
  transition: transform 0.3s ease;
  z-index: 1;
}

.units-checkbox:checked ~ .units-toggle-label::before {
  transform: translateX(calc(100% - 8px));
}

.units-checkbox:checked ~ .units-toggle-label .toggle-us {
  color: #5a7d8f;
}

.units-checkbox:checked ~ .units-toggle-label .toggle-metric {
  color: white;
}

.toggle-us {
  color: white;
}

.calculator-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
}

/* Input Section */
.input-section h2,
.results-section h2 {
  color: #2F586A;
  font-size: 1.3rem;
  margin-bottom: 1.5rem;
  font-weight: 600;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid #e6f2f8;
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  color: #2F586A;
  font-weight: 600;
  margin-bottom: 0.5rem;
  font-size: 0.95rem;
}

.form-group input[type="number"],
.form-group select {
  width: 100%;
  padding: 0.75rem;
  border: 2px solid #d9e2e7;
  border-radius: 8px;
  font-size: 0.95rem;
  transition: all 0.3s ease;
  background-color: #f9fbfd;
}

.form-group input[type="number"]:focus,
.form-group select:focus {
  outline: none;
  border-color: #2F586A;
  background-color: white;
  box-shadow: 0 0 0 3px rgba(47, 88, 106, 0.1);
}

/* Gender Toggle */
.gender-toggle {
  display: flex;
  gap: 1rem;
  background-color: #f5f9fc;
  padding: 0.4rem;
  border-radius: 8px;
  border: 2px solid #d9e2e7;
}

.gender-toggle input[type="radio"] {
  display: none;
}

.gender-label {
  flex: 1;
  text-align: center;
  padding: 0.6rem 1rem;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 500;
  font-size: 0.95rem;
  color: #5a7d8f;
  transition: all 0.3s ease;
  background-color: transparent;
}

.gender-toggle input[type="radio"]:checked + .gender-label {
  background-color: #2F586A;
  color: white;
  box-shadow: 0 2px 8px rgba(47, 88, 106, 0.3);
}

.gender-label:hover {
  background-color: rgba(47, 88, 106, 0.1);
}

.gender-toggle input[type="radio"]:checked + .gender-label:hover {
  background-color: #2F586A;
}

/* Input with Unit */
.input-with-unit {
  position: relative;
  display: flex;
  align-items: center;
}

.input-with-unit input {
  padding-right: 4rem;
}

.input-unit {
  position: absolute;
  right: 1rem;
  color: #5a7d8f;
  font-weight: 500;
  font-size: 0.9rem;
  pointer-events: none;
}

/* Results Section */
.results-section {
  background-color: #f5f9fc;
  padding: 1.5rem;
  border-radius: 10px;
}

.result-header {
  text-align: center;
  margin-bottom: 2rem;
  padding: 2rem;
  background: linear-gradient(135deg, #2F586A, #1a3a49);
  border-radius: 10px;
  color: white;
}

.result-value {
  font-size: 3rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.result-unit {
  font-size: 2rem;
  font-weight: 600;
  margin-left: 0.3rem;
}

.result-category {
  font-size: 1.2rem;
  font-weight: 500;
  opacity: 0.9;
  margin-top: 0.5rem;
}

/* Progress Bar */
.progress-container {
  margin: 2rem 0;
}

.progress-bar {
  position: relative;
  height: 30px;
  background: linear-gradient(to right, 
    #4CAF50 0%, 
    #8BC34A 20%, 
    #CDDC39 40%, 
    #FFC107 60%, 
    #FF9800 80%, 
    #F44336 100%);
  border-radius: 15px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  margin-bottom: 1rem;
}

.progress-fill {
  position: absolute;
  height: 100%;
  background-color: transparent;
  transition: width 0.5s ease;
}

.indicator {
  position: absolute;
  top: -5px;
  width: 4px;
  height: calc(100% + 10px);
  background-color: #1a3a49;
  border-radius: 2px;
  transform: translateX(-50%);
  transition: left 0.5s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.indicator::before {
  content: '';
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-top: 8px solid #1a3a49;
}

.progress-markers {
  display: flex;
  justify-content: space-between;
  margin-top: 0.5rem;
}

.marker {
  font-size: 0.75rem;
  color: #5a7d8f;
  font-weight: 500;
  text-align: center;
  flex: 1;
}

.info-box {
  background-color: white;
  padding: 1.5rem;
  border-radius: 8px;
  margin-bottom: 1.5rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.info-box h4 {
  color: #2F586A;
  font-size: 1.1rem;
  margin-bottom: 1rem;
  font-weight: 600;
}

.info-box p {
  color: #5a7d8f;
  font-size: 0.9rem;
  line-height: 1.6;
}

/* Range Table */
.range-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
}

.range-table thead {
  background-color: #2F586A;
  color: white;
}

.range-table th,
.range-table td {
  padding: 0.8rem;
  text-align: left;
  border-bottom: 1px solid #d9e2e7;
}

.range-table th {
  font-weight: 600;
  font-size: 0.9rem;
}

.range-table td {
  font-size: 0.85rem;
  color: #5a7d8f;
}

.range-table tbody tr:hover {
  background-color: #f5f9fc;
}

.range-table tbody tr:last-child td {
  border-bottom: none;
}

/* Sidebar Content */
.sidebar-content-div {
  flex: 1 1 25%;
  min-width: 250px;
}

/* Related Calculators Section */
#related-calculators-div {
  margin-bottom: 2rem;
  background-color: white;
  border-radius: 10px;
  padding: 1.5rem;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

#related-calculators-heading {
  font-weight: 700;
  color: #2F586A;
  font-size: 1.2rem;
  margin-bottom: 1.2rem;
  padding-bottom: 0.8rem;
  border-bottom: 2px solid #2F586A;
  width: fit-content;
}

#related-calculators-contents {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
}

.relatedCalculatorCard {
  border: 1px solid #d9e2e7;
  padding: 0.6rem 1rem;
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.3s ease;
  background-color: white;
  font-size: 0.9rem;
  color: #2F586A;
  font-weight: 500;
}

.relatedCalculatorCard:hover {
  background-color: #2F586A;
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(47, 88, 106, 0.15);
}

/* Category Display Section */
#category-display-div {
  background-color: white;
  border-radius: 10px;
  padding: 1.5rem;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

#category-display-heading {
  font-weight: 700;
  color: #2F586A;
  font-size: 1.2rem;
  margin-bottom: 1.2rem;
  padding-bottom: 0.8rem;
  border-bottom: 2px solid #2F586A;
  width: fit-content;
}

#category-display-contents {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
}

.categoryCardsDiv {
  border: 1px solid #d9e2e7;
  padding: 0.6rem 1rem;
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.3s ease;
  background-color: white;
  font-size: 0.9rem;
  color: #2F586A;
  font-weight: 500;
}

.categoryCardsDiv:hover {
  background-color: #2F586A;
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(47, 88, 106, 0.15);
}

/* Footer Styles */
#footer-div {
  background-color: #2F586A;
  background-image: linear-gradient(to right, #2F586A, #1a3a49);
  padding: 3rem 5%;
  color: white;
  margin-top: 3rem;
}

#footer-companyDetail-div {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 2rem;
  margin-bottom: 2rem;
}

#footer-companyDetail-sub-div1 {
  flex: 1 1 60%;
  min-width: 300px;
}

#footer-Cname-logo {
  display: flex;
  align-items: center;
  margin-bottom: 1.5rem;
}

#footer-logo-img {
  height: 50px;
  width: 50px;
  border-radius: 15px;
  object-fit: cover;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

#footer-companyName-div {
  color: white;
  padding-left: 1rem;
  font-size: 1.2rem;
  font-weight: 600;
  letter-spacing: 0.5px;
}

#company-description {
  color: rgba(255, 255, 255, 0.9);
  line-height: 1.7;
  font-size: 0.95rem;
}

#footer-companyDetail-sub-div2 {
  flex: 1 1 30%;
  min-width: 200px;
}

#follow-us {
  color: white;
  text-align: center;
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

#footer-connections {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

#facebook-logo,
#instagram-logo,
#twitter-logo,
#mail-logo {
  height: 40px;
  width: 40px;
  border-radius: 50%;
  transition: transform 0.3s ease;
  background-color: rgba(255, 255, 255, 0.1);
  padding: 5px;
  object-fit: contain;
}

#facebook-logo:hover,
#instagram-logo:hover,
#twitter-logo:hover,
#mail-logo:hover {
  transform: translateY(-3px) scale(1.1);
  background-color: rgba(255, 255, 255, 0.2);
}

#company-copyrights-div {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 1.5rem;
}

#company-copyrights-sub-div {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.terms-policy-disclaimer {
  color: rgba(255, 255, 255, 0.8);
  transition: color 0.2s ease;
  font-size: 0.9rem;
}

.terms-policy-disclaimer:hover {
  color: white;
  text-decoration: underline;
}

#all-rights-reserved {
  color: white;
  text-align: center;
  font-weight: 500;
  font-size: 0.9rem;
}

/* Responsive Design */
@media (max-width: 1024px) {
  .calculator-content {
    grid-template-columns: 1fr;
  }
  
  .sidebar-content-div {
    flex: 1 1 30%;
  }
}

@media (max-width: 900px) {
  #full-page-content-div {
    flex-direction: column;
  }
  
  .calculator-main-div {
    width: 100%;
    order: 1;
  }
  
  .sidebar-content-div {
    width: 100%;
    order: 2;
  }
  
  #related-calculators-div,
  #category-display-div {
    margin-bottom: 1.5rem;
  }
}

@media (max-width: 768px) {
  #header {
    padding: 0 4%;
    height: 60px;
  }
  
  #logo {
    height: 45px;
    width: 45px;
  }
  
  #company-name {
    font-size: 1.2rem;
    margin-left: 0.6rem;
    display: none;
  }
  
  #search-post-div {
    position: static;
    margin-right: 5px;
  }
  
  #search-post {
    width: 40px;
    height: 40px;
    padding: 0;
    background-position: center;
    font-size: 0;
    border-radius: 50%;
  }
  
  #search-post:focus {
    width: 200px;
    border-radius: 20px;
    font-size: 0.9rem;
    padding: 0 1rem 0 2.8rem;
    background-position: 15px center;
  }
  
  #searchResultDiv {
    position: fixed;
    top: 60px;
    left: 0;
    width: 100%;
    max-width: 100%;
    box-shadow: 0 5px 20px rgba(0,0,0,0.2);
    border-radius: 0 0 10px 10px;
    max-height: 60vh;
    z-index: 1005;
  }
  
  #search-post::placeholder {
    color: transparent;
  }
  
  #search-post:focus::placeholder {
    color: #8aa5b1;
  }
  
  #login-signup {
    display: none;
  }
  
  #home-about-div {
    gap: 0.5rem;
  }

  #home-btn, #about-btn {
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
  }
  
  .calculator-wrapper {
    padding: 1.5rem;
  }
  
  .calculator-header h1 {
    font-size: 1.5rem;
  }
  
  .calculator-header p {
    font-size: 0.9rem;
  }
  
  .units-toggle-label {
    width: 180px;
    height: 40px;
  }
  
  .toggle-text {
    font-size: 0.85rem;
  }
  
  .result-value {
    font-size: 2.5rem;
  }
  
  .result-unit {
    font-size: 1.5rem;
  }
  
  .result-category {
    font-size: 1rem;
  }
  
  .progress-markers {
    flex-wrap: wrap;
    gap: 0.3rem;
  }
  
  .marker {
    font-size: 0.65rem;
    min-width: 45%;
  }
}

@media (max-width: 480px) {
  #header {
    padding: 0 3%;
  }
  
  #header-right {
    gap: 0.3rem;
  }
  
  #home-about-div {
    gap: 0.3rem;
  }

  #home-btn, #about-btn {
    padding: 0.3rem 0.7rem;
    font-size: 0.8rem;
  }
  
  #company-name {
    display: none;
  }
  
  #search-post:focus {
    width: 160px;
  }
  
  .calculator-wrapper {
    padding: 1rem;
  }
  
  .calculator-header h1 {
    font-size: 1.3rem;
  }
  
  .calculator-content {
    gap: 1.5rem;
  }
  
  .result-value {
    font-size: 2rem;
  }
  
  .result-unit {
    font-size: 1.2rem;
  }
  
  .units-toggle-label {
    width: 160px;
    height: 38px;
  }
  
  .toggle-text {
    font-size: 0.8rem;
    padding: 0.4rem 0.8rem;
  }
  
  #related-calculators-div,
  #category-display-div {
    padding: 1rem;
  }
  
  #related-calculators-heading,
  #category-display-heading {
    font-size: 1.1rem;
  }
  
  .relatedCalculatorCard,
  .categoryCardsDiv {
    padding: 0.5rem 0.9rem;
    font-size: 0.85rem;
  }
  
  .range-table th,
  .range-table td {
    padding: 0.6rem 0.4rem;
    font-size: 0.8rem;
  }
}

/* Smooth Scrolling */
html {
  scroll-behavior: smooth;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
  background: #2F586A;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #1a3a49;
}