/* Fix for the gap between hero video and tabs */
.about-section {
    padding-top: 0; /* Remove padding to eliminate gap */
    width: 100%;
    max-width: 100%;
}

.about-tabs-container {
    padding: 0; /* Remove padding to eliminate gap */
    width: 100%;
    max-width: 2200px;
}

.about-content {
    padding-top: 20px; /* Reduce top padding */
}

.about-hero {
    margin-bottom: 0; /* Ensure no bottom margin on hero */
}

/* Fix for navigation button */
.quote-button {
    position: absolute;
    right: 30px;
    display: flex;
    align-items: center;
}

.cta-button {
    padding: 10px 20px;
    background-color: transparent;
    border: 2px solid white;
    border-radius: 3px;
    color: white;
    font-weight: 500;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s ease;
}

/* Fix for the hover state of the CTA button */
.cta-button:hover {
    background-color: white;
    color: var(--primary-color) !important; /* !important to override any other styles */
}

.nav-cta {
    padding: 8px 18px;
}

/* Fix for tab sections to make them wider but not stretched */
.wide-section-container {
    max-width: 1400px !important; /* More balanced width - reduced from 1600px */
    width: 90% !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

/* Make tab content better use the available space */
.wide-tabs .category-detail, 
.wide-tabs .category-content .category-detail {
    gap: 120px; /* Increase from 100px */
    padding: 40px 0; /* Remove horizontal padding to use full width */
    width: 100%;
    max-width: 100%;
}

.wide-tabs .category-image {
    flex: 1.5;
}

.wide-tabs .category-description {
    flex: 1;
    padding-right: 20px;
}

/* Style improvements for about page tabs */
.about-tabs-container.wide-section-container {
    width: 100% !important; /* Use full width */
    max-width: none !important; /* Remove width restrictions */
    padding: 0 !important; /* Remove padding that could cause cutoff */
}

.about-tabs.wide-tabs {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.wide-section-container .tab-content {
    max-width: 100%;
}

/* Add consistent styling for tab content across pages */
.container.wide-section-container {
    max-width: 1400px !important; /* Reduced from 1600px */
    padding: 0 40px;
}

/* Fix for specific tab contents that need more controlled width */
#our-story .story-content-container {
    max-width: 1200px;
    margin: 0 auto;
}

#our-story .offset-photos-grid {
    max-width: 1200px;
    margin: 60px auto;
    padding: 0 20px;
    gap: 30px; /* Increased gap for better spacing */
}

/* Fix for ADU page tab content */
#basics .adu-content-container {
    max-width: 1200px;
    margin: 0 auto;
}

#basics .process-content-container {
    max-width: 1200px;
}

/* Standardize all ADU tab content for consistent widths */
#basics .adu-content-container,
#costs .adu-content-container,
#design .adu-content-container,
#steps .adu-content-container,
#cities .adu-content-container {
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    padding: 0 20px;
}

/* Fix for inline styled content sections in ADU page */
#basics [style*="max-width: 80%"],
#basics [style*="max-width: 90%"],
#costs [style*="max-width: 90%"],
#design [style*="max-width: 90%"],
#steps [style*="max-width: 90%"],
#cities [style*="max-width: 90%"] {
    max-width: 1200px !important;
    margin-left: auto !important;
    margin-right: auto !important;
    width: 100% !important;
}

/* Fix for sections with full-width backgrounds to have consistent inner content width */
#basics div[style*="background-color: var(--primary-bg-color)"] > div,
#costs div[style*="background-color: var(--primary-bg-color)"] > div,
#design div[style*="background-color: var(--primary-bg-color)"] > div,
#steps div[style*="background-color: var(--primary-bg-color)"] > div,
#cities div[style*="background-color: var(--primary-bg-color)"] > div {
    max-width: 1200px !important;
    margin-left: auto !important;
    margin-right: auto !important;
    padding-left: 20px !important;
    padding-right: 20px !important;
}

/* Fix for the three-column ADU types layout for better spacing */
#basics div[style*="display: flex; justify-content: space-between"] {
    max-width: 1200px !important;
    margin-left: auto !important;
    margin-right: auto !important;
    gap: 25px !important;
}

/* Fix for process content containers in ADU page */
.adu-content-container .process-content-container {
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    gap: 40px;
}

/* Make all separator lines consistent */
div[style*="width: 100%; height: 2px; background-color: var(--primary-color); margin:"] {
    max-width: 1200px !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

/* Fix vertical spacing between sections with tabs */
.about-section .about-content .wide-section-container {
    margin-top: 40px;
}

/* Added styles for full-width tab sections */
#regulations .tab-content,
#basics .tab-content,
#costs .tab-content,
#financing .tab-content,
#plans-pricing .tab-content,
#design-services .tab-content,
#build-process .tab-content,
#maintenance-program .tab-content,
#featured-projects .tab-content,
#custom-houses .tab-content,
#adus .tab-content,
#kitchens-bathrooms .tab-content,
#commercial-spaces .tab-content {
    max-width: 100%;
    width: 100%;
}

/* Ensure tab separator doesn't constrain width */
.tab-separator {
    width: 100%;
    max-width: 2200px;
}

/* Full width adjustments for all sections */
.section-container, 
.about-container,
.services-container,
.our-services-container,
.testimonials-container,
.instagram-container,
.footer-container {
    width: 98%;
    max-width: 2200px;
}

/* Make sure all container elements respect full width */
.container > *,
.about-content > *,
.tab-content > * {
    max-width: 100%;
}

/* Ensure city grid uses full width */
.regulations .city-grid-container {
    width: 98%;
    padding: 0;
}

/* Fix paddings that might constrain width */
.about-section .about-content {
    padding-left: 0;
    padding-right: 0;
}

/* Remove horizontal constraints on all tab content */
.tab-content {
    padding-left: 0 !important;
    padding-right: 0 !important;
}

/* Make the container for all tabs as wide as possible */
.container.wide-section-container {
    padding: 0;
    max-width: 100% !important;
    width: 100% !important;
}

/* Responsive tweaks for tab sections on smaller screens */
@media (max-width: 1200px) {
    .wide-section-container {
        width: 95% !important;
    }
    
    .wide-tabs .category-detail {
        gap: 50px;
    }
    
    .container.wide-section-container {
        padding: 0 20px;
    }
}

@media (max-width: 768px) {
    .wide-tabs .category-detail,
    .wide-tabs .category-content .category-detail {
        flex-direction: column;
        gap: 30px;
    }
    
    .about-tabs.wide-tabs {
        gap: 10px;
    }
    
    .container.wide-section-container {
        padding: 0 15px;
    }
}

/* Improve styling for the partner form for better balance */
#partners .partner-form-header {
    margin-bottom: 40px;
    text-align: center;
}

#partners .trades-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 10px;
}

#partners .form-row {
    margin-bottom: 20px;
}

/* Improve spacing and balance in wide tabs */
.wide-tabs .tab-content {
    padding: 0 20px;
}

/* Ensure content doesn't stretch too wide but has proper padding */
.tab-content .adu-content-container,
.tab-content .story-content-container,
.tab-content > div[style*="max-width"] {
    padding: 0 30px;
}

/* Fix for process content containers to have better spacing */
.process-content-container {
    padding: 0 20px;
    gap: 50px; /* Reduced from 60px for better balance */
}

/* Ensure responsive spacing for all tabs */
@media only screen and (max-width: 1200px) {
    .wide-section-container {
        max-width: 95% !important;
    }
    
    .process-content-container {
        gap: 40px;
    }
}

/* Adjust team members layout to be more balanced */
.team-members {
  display: flex;
  justify-content: flex-start;
  gap: 50px;
  flex-wrap: wrap;
}

.team-member-card {
  flex: 0 0 auto;
  width: calc(33.333% - 34px);
  min-width: 280px;
  margin-bottom: 40px;
}

@media (max-width: 992px) {
  .team-member-card {
    width: calc(50% - 25px);
  }
}

@media (max-width: 576px) {
  .team-member-card {
    width: 100%;
  }
}

/* Comprehensive Team Section Fixes */
.team-section {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 1800px;
  margin: 0 auto;
  padding: 0 20px;
}

.team-header {
  width: 100%;
  max-width: 1000px !important;
  margin: 0 auto 60px !important;
  text-align: center !important;
}

.team-intro {
  max-width: 800px !important;
  margin: 0 auto 40px !important;
  text-align: center !important;
}

.team-category {
  width: 100%;
  max-width: 1600px;
  margin: 0 auto 60px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.team-category-title {
  text-align: center !important;
  margin-bottom: 50px !important;
  font-size: 2rem !important;
  width: 100%;
}

.team-members {
  display: flex !important;
  justify-content: center !important;
  gap: 60px !important;
  flex-wrap: wrap !important;
  width: 100% !important;
  max-width: 1400px !important;
}

.team-member-card {
  flex: 0 0 320px !important;
  margin-bottom: 40px !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
}

.team-member-photo {
  height: 400px !important;
  width: 300px !important;
  margin: 0 auto 20px !important;
}

.team-member-name,
.team-member-title {
  text-align: center !important;
  width: 100% !important;
}

/* Add stylistic elements to the team page */
.team-section::before {
  content: '';
  position: absolute;
  top: 100px;
  right: 5%;
  width: 250px;
  height: 250px;
  border-radius: 50%;
  background: rgba(28, 63, 96, 0.04);
  z-index: -1;
}

.team-section::after {
  content: '';
  position: absolute;
  bottom: 120px;
  left: 5%;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: rgba(58, 108, 159, 0.05);
  z-index: -1;
}

/* Add a subtle pattern overlay to the team section */
.team-section {
  position: relative;
  background-image: 
    linear-gradient(to right, rgba(249, 250, 251, 0.7) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(249, 250, 251, 0.7) 1px, transparent 1px);
  background-size: 40px 40px;
  background-attachment: fixed;
}

/* Add animated flair to team member cards */
.team-member-card {
  position: relative;
}

.team-member-card::before {
  content: '';
  position: absolute;
  top: -8px;
  left: -8px;
  width: 60px;
  height: 60px;
  border-top: 3px solid var(--primary-color);
  border-left: 3px solid var(--primary-color);
  opacity: 0;
  transition: opacity 0.4s ease;
  z-index: 1;
}

.team-member-card::after {
  content: '';
  position: absolute;
  bottom: 70px;
  right: -8px;
  width: 60px;
  height: 60px;
  border-bottom: 3px solid var(--primary-color);
  border-right: 3px solid var(--primary-color);
  opacity: 0;
  transition: opacity 0.4s ease;
  z-index: 1;
}

.team-member-card:hover::before,
.team-member-card:hover::after {
  opacity: 1;
}

/* Add subtle hover effect to photos */
.team-member-photo {
  position: relative;
  overflow: hidden;
}

.team-member-photo::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(to bottom, transparent 80%, rgba(28, 63, 96, 0.15));
  opacity: 0;
  transition: opacity 0.4s ease;
}

.team-member-photo:hover::after {
  opacity: 1;
}

/* Add stylish section divider */
.team-section .team-header::after {
  content: '';
  display: block;
  width: 80px;
  height: 3px;
  background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
  margin: 40px auto 0;
  border-radius: 2px;
}

/* Add role badges to team members */
.team-member-title {
  position: relative;
  display: inline-block;
  padding: 5px 12px;
  background-color: rgba(28, 63, 96, 0.08);
  border-radius: 20px;
  font-size: 0.85rem;
  margin-top: 5px;
}

/* Add subtle animation to team members on page load */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.team-member-card {
  animation: fadeInUp 0.8s ease forwards;
  opacity: 0;
}

.team-member-card:nth-child(1) {
  animation-delay: 0.2s;
}

.team-member-card:nth-child(2) {
  animation-delay: 0.4s;
}

.team-member-card:nth-child(3) {
  animation-delay: 0.6s;
}

/* Styled decorative text */
.decorative-text {
  width: 100%;
  max-width: 800px;
  display: flex;
  justify-content: space-between;
  margin: 0 auto 40px;
  padding: 0 20px;
}

.decorative-text span {
  font-size: 1.5rem;
  font-weight: 300;
  color: rgba(28, 63, 96, 0.15);
  letter-spacing: 1px;
  text-transform: uppercase;
  position: relative;
}

.decorative-text span::after {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 0;
  width: 100%;
  height: 1px;
  background: rgba(28, 63, 96, 0.15);
}

/* Team category description */
.team-category-description {
  text-align: center;
  max-width: 800px;
  margin: 0 auto 50px;
  font-size: 1.1rem;
  line-height: 1.6;
  color: var(--text-color-light);
}

/* Team member bio */
.team-member-bio {
  margin-top: 15px;
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--text-color-light);
  text-align: center;
  max-width: 300px;
  margin-left: auto;
  margin-right: auto;
}

/* Stylish quote section */
.team-quote {
  width: 100%;
  margin: 80px auto 40px;
  text-align: center;
  position: relative;
  padding: 0 20px;
}

.team-quote blockquote {
  font-size: 1.6rem;
  font-style: italic;
  color: var(--primary-color);
  max-width: 800px;
  margin: 0 auto;
  position: relative;
  padding: 40px 60px;
  line-height: 1.8;
  font-weight: 300;
}

.team-quote blockquote::before {
  content: '"';
  position: absolute;
  top: -20px;
  left: 0;
  font-size: 100px;
  color: rgba(28, 63, 96, 0.08);
  font-family: Georgia, serif;
}

.team-quote blockquote::after {
  content: '"';
  position: absolute;
  bottom: -80px;
  right: 0;
  font-size: 100px;
  color: rgba(28, 63, 96, 0.08);
  font-family: Georgia, serif;
}

/* Responsive styles for new elements */
@media (max-width: 768px) {
  .decorative-text {
    flex-direction: column;
    align-items: center;
    gap: 30px;
  }
  
  .team-quote blockquote {
    font-size: 1.3rem;
    padding: 30px 40px;
  }
}

/* Floating design elements */
.floating-design-elements {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: -1;
  overflow: hidden;
}

.design-element {
  position: absolute;
  border-radius: 50%;
  opacity: 0.1;
}

.el-1 {
  width: 200px;
  height: 200px;
  background-color: var(--primary-color);
  top: 15%;
  left: 10%;
  animation: float 15s infinite ease-in-out;
}

.el-2 {
  width: 150px;
  height: 150px;
  background-color: var(--secondary-color);
  top: 30%;
  right: 8%;
  animation: float 18s infinite ease-in-out reverse;
}

.el-3 {
  width: 80px;
  height: 80px;
  background-color: var(--accent-color);
  bottom: 20%;
  left: 20%;
  animation: float 12s infinite ease-in-out;
}

.el-4 {
  width: 120px;
  height: 120px;
  border: 10px solid var(--primary-color);
  top: 60%;
  right: 15%;
  animation: float 20s infinite ease-in-out;
}

.el-5 {
  width: 60px;
  height: 60px;
  border: 6px solid var(--secondary-color);
  bottom: 10%;
  right: 30%;
  animation: float 10s infinite ease-in-out reverse;
}

@keyframes float {
  0%, 100% {
    transform: translateY(0) translateX(0);
  }
  25% {
    transform: translateY(-15px) translateX(10px);
  }
  50% {
    transform: translateY(10px) translateX(-10px);
  }
  75% {
    transform: translateY(15px) translateX(15px);
  }
}

/* Add subtle pause on hover */
.team-section:hover .design-element {
  animation-play-state: paused;
}

/* Fix for the full-width image in Our Story tab */
#our-story .full-width-image {
    max-width: 1400px;
    margin-left: auto;
    margin-right: auto;
    overflow: hidden;
}

#our-story .full-width-image img {
    width: 100%;
    height: auto;
    object-fit: cover;
}

/* Fix for Partners tab to constrain width and improve layout */
#partners {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

#partners .partners-scrapbook {
    max-width: 1000px;
    margin: 40px auto;
    gap: 40px;
}

#partners .partner-form-container {
    max-width: 1000px;
    margin: 80px auto;
    padding: 0 20px;
}

/* Fix for Where We Work tab content */
#where-work {
    max-width: 1200px; 
    margin: 0 auto;
    padding: 0 20px;
}

#where-work .section-container {
    width: 100%;
    max-width: 100%;
}



/* Specific fixes for Financing tab inconsistent widths */
#financing .adu-content-container {
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    padding: 0 20px;
}

#financing div[style*="max-width: 90%"] {
    max-width: 1200px !important;
    margin-left: auto !important;
    margin-right: auto !important;
    width: 100% !important;
}

/* Fix for the financing options flex container */
#financing div[style*="display: flex; flex-wrap: wrap; justify-content: center"] {
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: center !important;
    gap: 30px !important;
    max-width: 1200px !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

/* Make each financing option card more consistent */
#financing div[style*="flex: 0 1 350px"] {
    flex: 0 1 350px !important;
    margin-bottom: 40px !important;
    background-color: #f9f9f9;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

#financing div[style*="flex: 0 1 350px"]:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
}

/* Fix for the calculator section */
#financing div[style*="margin-top: 40px; margin-bottom: 40px; width: 100%;"] {
    max-width: 1200px !important;
    margin-left: auto !important;
    margin-right: auto !important;
    padding: 30px 0;
    text-align: center;
}

/* Fix for the steps section */
#financing div[style*="margin-bottom: 30px; padding: 25px; background-color: #f8f9fa"] {
    margin-left: auto !important;
    margin-right: auto !important;
    max-width: 1200px !important;
}

/* Specific improvements for the What We Do section on homepage */
.what-we-do-container.wide-section-container {
    max-width: 1400px !important; /* Balanced width to match other sections */
    width: 90% !important; /* Width consistent with the rest of the page */
    margin: 0 auto !important; /* Center the container */
    padding: 0 !important; /* Remove padding to allow content to breathe */
}

/* Adjust category tabs to be more evenly spaced */
.what-we-do .category-tabs {
    display: flex;
    justify-content: center;
    gap: 20px; /* Slightly increased for better spacing */
    width: 100%;
    padding: 0 20px;
    margin-bottom: 30px; /* Added more space between tabs and content */
}

/* Make the tab content use more horizontal space */
.what-we-do .category-content {
    width: 100%;
    padding: 20px 0;
    position: relative; /* Ensure proper positioning of category details */
}

/* Improve the spacing of category details */
.what-we-do .category-detail {
    gap: 80px !important; /* More balanced spacing between image and text */
    padding: 20px 0 !important;
    display: none;
    width: 100%;
    position: relative; /* Ensure proper positioning within the content area */
    min-height: 520px; /* Set minimum height for consistent appearance */
}

/* Better balance between image and text */
.what-we-do .category-image {
    flex: 1.3 !important; /* Slightly larger image area */
    height: auto;
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.08); /* Subtle shadow for depth */
}

.what-we-do .category-description {
    flex: 1 !important;
    padding: 20px 0 !important; /* Add vertical padding for better spacing */
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Ensure images maintain proper height */
.what-we-do .category-image img {
    height: 520px !important; /* Match the overall section height */
    object-fit: cover;
    transition: transform 1.2s cubic-bezier(0.19, 1, 0.22, 1); /* Smoother transition */
}

/* Hover effect to add visual interest */
.what-we-do .category-image:hover img {
    transform: scale(1.03);
}

/* Ensure the active state works properly with our new styles */
.what-we-do .category-detail.active {
    display: flex;
}

/* Specific fixes for the What We Do section tab content spacing */
.what-we-do .wide-tabs .category-content {
    margin: 0 auto;
    width: 100%;
}

.what-we-do .wide-tabs .category-detail.active {
    animation: fadeTabContent 0.6s ease-in-out;
}

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

/* Fix for "See More" link styling */
.what-we-do .see-more-link {
    display: inline-block;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
    padding-bottom: 3px;
}

.what-we-do .see-more-link:after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--primary-color);
    transition: width 0.3s ease;
}

.what-we-do .see-more-link:hover:after {
    width: 100%;
}

/* Fix for tab focus styling */
.what-we-do .category-tab:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(var(--primary-color-rgb), 0.3);
}
