/* Override Bootstrap modal behavior */
body.modal-open {
  overflow: auto !important;
  padding-right: 0 !important;
}

.modal-backdrop {
  z-index: 9999 !important;
}

.navigation-buttons-container {
  z-index: 100000 !important;
}

.honeypot-field {
    display: none !important;
    position: absolute;
    left: -9999px;
}

/* Fullscreen modal for Bootstrap 4.5.2 */
.modal-fullscreen-custom {
    background-color: #fff;
    width: 100%;
    max-width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    z-index: 10000;
}

.swal2-container {
    z-index: 999999 !important;
}

.btn-success-vergleicho{
    height: 50px;
    background: url('../images/vergleicho-background.png') center/cover no-repeat;
    color:#fff;
}

.btn-secondary-vergleicho{
    height: 50px;
    background-color: #fff;
    color:#333;
    border: 1px solid #333;
}

.modal-vergleicho{
    position: fixed;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: #fff;
    z-index: 110000;
    overflow-y: auto;
    padding-bottom: 120px; /* Adjust based on button container height */
}

.modal-vergleicho-contact{
    position: fixed;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: #fff;
    z-index: 110000;
    overflow-y: auto;
    padding-bottom: 120px; /* Adjust based on button container height */
}

.modal-vergleicho-newsletter{
    position: fixed;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: #fff;
    z-index: 110000;
    overflow-y: auto;
    padding-bottom: 120px; /* Adjust based on button container height */
}

.fixed-button-container {
    position: fixed;
    bottom: 0;
    width: 100%;
    background-color: #fff;
    padding: 10px 15px;
    z-index: 100000; /* Ensures it stays above content */
    border-top: 1px solid rgba(0,0,0,0.1);
}

.modal-fullscreen-custom .modal-dialog{
  margin: 0;
}

.modal-fullscreen-custom .modal-content {
  height: 100%;
  border: 0;
  border-radius: 0;
}

.modal-fullscreen-custom .modal-header {
  margin: 0;
  padding: 15px 0;
  background: url('../images/vergleicho-background.png') center/cover no-repeat;
  border-bottom: none;
}

.modal-logo{
    opacity: 1; /* Initially visible */
    height: 30px;
    transition: opacity 0.1s ease, transform 0.3s ease; /* Faster opacity transition */
    margin: 6px 0px 0px 0px;
}

.modal-close-vergleicho {
  background: none;
  border: none;
  margin-right: -15px;
}

.modal-fullscreen-custom .modal-body .container-fluid{
  padding-top:15px;
  padding-right:0;
  padding-left:0;
}

.modal-fullscreen-custom .modal-body p{
    font-size: 1rem;        /* ~16px or ~14px on mobile */
    line-height: 1.6;       /* Good readability for body text */
    margin: 0 0 1rem;       /* Spacing below paragraphs */
}


/* Animations */
@keyframes fadeanddropIn-modal {
    0% {
        transform: translateY(-20px);
        opacity: 0;
    }
    100% {
        transform: translateY(0px);
        opacity: 1;
    }
}

.fadeanddropIn-modal * {
    animation: fadeanddropIn-modal 1s ease-out forwards;
    opacity: 0;
}


p.vergleicho-text{
  color: var(--primary-color);
  font-weight: bold;
}

.modal-fullscreen-custom .modal-body strong{
  color: #000;
}

.modal-fullscreen-custom .note-dsg{
    color: #000;
    background-color: rgba(255, 255, 255, 1);
}

.modal-fullscreen-custom .note-dsg p{
    font-size: 0.8rem;        /* ~16px or ~14px on mobile */
    line-height: 1.6;       /* Good readability for body text */
    margin: 0 0 1rem;       /* Spacing below paragraphs */
}

.modal-fullscreen-custom .note-dsg a{
    color: var(--primary-color);
    text-decoration: underline;
}

#newsletter-subscription {
    width: 100%;
    height: 50px;
    position: relative;
    overflow: hidden; /* Ensure the pseudo-element doesn't overflow */
    background-color: transparent; /* Remove any default background */
    border-radius: 10px;
    border: 1px solid var(--secondary-color); /* Optional: Add a border */
    color: var(--secondary-color); /* Initial text color */
    font-weight: 900;
    transition: color 0.3s ease; /* Smooth text color transition */
}

/* Pseudo-element for the fill animation */
#newsletter-subscription::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 0; /* Start with 0 width */
    height: 100%;
    background-color: #70a1a6; /* Fill color */
    z-index: -1; /* Place behind the button text */
    transition: width 3s ease; /* Smooth width transition over 3 seconds */
}

/* When the button has the "active" class, trigger the animation */
#newsletter-subscription.active::before {
    width: 100%; /* Fill the button from left to right */
}

/* Change text color during the animation */
#newsletter-subscription.active {
    background-color: #54c9a3;
    border: 1px solid var(--primary-color);
    color: #fff; /* Text color during the animation */
    transition: color 0.3s ease 1.5s; /* Delay the color change to halfway through the animation */
}


#contact-submit {
    width: 100%;
    height: 50px;
    position: relative;
    overflow: hidden; /* Ensure the pseudo-element doesn't overflow */
    background-color: transparent; /* Remove any default background */
    border-radius: 10px;
    border: 1px solid var(--secondary-color); /* Optional: Add a border */
    color: var(--secondary-color); /* Initial text color */
    font-weight: 900;
    transition: color 0.3s ease; /* Smooth text color transition */
}

/* Pseudo-element for the fill animation */
#contact-submit::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 0; /* Start with 0 width */
    height: 100%;
    background-color: #70a1a6; /* Fill color */
    z-index: -1; /* Place behind the button text */
    transition: width 3s ease; /* Smooth width transition over 3 seconds */
}

/* When the button has the "active" class, trigger the animation */
#contact-submit.active::before {
    width: 100%; /* Fill the button from left to right */
}

/* Change text color during the animation */
#contact-submit.active {
    background-color: #54c9a3;
    border: 1px solid var(--primary-color);
    color: #fff; /* Text color during the animation */
    transition: color 0.3s ease 1.5s; /* Delay the color change to halfway through the animation */
}

#suggestions {
    position: absolute;
    top: 70px;
    background-color: white;
    z-index: 10;
    overflow-y: auto;
    display: none;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.suggestion-item, .no-match {
    padding: 10px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    color: #333;
}

.suggestion-item:hover {
    background-color: #f7f7f7;
}

.no-match {
    color: red;
}

#searching-document {
    transition: all 0.5s ease-in-out;
    text-align: center;
    margin: 20px auto;
}

#cta-text {
    transition: all 0.4s ease-in-out;
}

/* Canton Selector */
.canton-select-container {
    position: relative;
    width: 100%;
}

.canton-select-trigger {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
    padding: 0;
    background-color: #fff;
    border: 1px solid #ccc;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    color: #555;
    transition: border-color 0.2s;
}

.canton-select-trigger:hover {
    border-color: #70a1a6;
}

.canton-select-trigger.active {
    border-color: #70a1a6;
    border-radius: 5px 5px 0 0;
}

.canton-select-trigger .placeholder {
    flex-grow: 1;
    padding: 12px 15px;
    padding-right: 40px; /* Make room for the arrow */
}

.canton-search {
    width: 100%;
    flex-grow: 1;
    padding: 12px 15px;
    padding-right: 40px; /* Make room for the arrow */
    border: none;
    font-size: 16px;
    background: transparent;
}
.canton-search:focus {
    outline: none;
}

.arrow-down {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    transition: transform 0.3s ease;
    pointer-events: none; /* This prevents the arrow from capturing clicks */
}

.canton-select-trigger.active .arrow-down {
    transform: translateY(-50%) rotate(180deg);
}

.canton-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: #fff;
    border: 1px solid #70a1a6;
    border-top: none;
    border-radius: 0 0 5px 5px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    display: none;
}

.canton-dropdown.active {
    display: block;
}

.canton-options {
    max-height: 250px;
    overflow-y: auto;
}

.canton-option {
    padding: 10px 15px;
    cursor: pointer;
    transition: background 0.2s;
}

.canton-option:hover {
    background-color: #f5f5f5;
}

.canton-option.selected {
    background-color: #e6f3f3;
    font-weight: 500;
}

.canton-option.hidden {
    display: none;
}


/* Base Button Styles */
.btn-return, .btn-continue {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    border-radius: 8px;
    padding: 12px 20px;
    font-size: 16px;
    font-weight: bold;
    border-radius: 5px;
    transition: all 0.3s ease;
    cursor: pointer;
}

/* Return Button */
.btn-return {
    background-color: #fff;
    color: #70a1a6;
    border: 1px solid #70a1a6;
}

.btn-return:hover {
    background-color: #f5f9fa;
}

.return-icon {
    margin-right: 8px;
}

/* Continue Button */
.btn-continue {
    background: var(--secondary-color);
    color: white;
    border: none;
}

.btn-continue:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(112, 161, 166, 0.3);
}

.continue-icon {
    margin-left: 8px;
}

#call-to-action-form{
    margin-bottom: 100px;
}

.navigation-buttons-container {
  padding: 20px 15px;
  position: fixed !important; /* Force fixed position */
  bottom: 0 !important; /* Force bottom positioning */
  left: 0;
  width: 100%;
  background-color: #fff;
  z-index: 10000;
  border-top: 1px solid rgba(0, 0, 0, 0.05);
}

/* Make sure the buttons don't get hidden on smaller screens */
@media (max-width: 576px) {
    /* Navigation Buttons Container */
    .navigation-buttons-container {
        padding: 20px 15px;
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        background-color: #fff;
        z-index: 10000;
    }
    
    .btn-return, .btn-continue {
        padding: 10px;
        font-size: 14px;
    }
}

.modal-cta-container{
  display: inline-block;
  position: relative;
  width: 100%;
  height: 230px;
  border-radius: 30px;
  overflow:hidden;
  box-shadow: 5px 5px 30px rgba(0, 0, 0, 0.3);
  transition: all 0.5s ease-in-out;
}

.modal-cta-container-description-bk {
  background: url('../images/vergleicho-background.png') center/cover no-repeat;
  border-radius: 30px;
  position: absolute;
  top: 50%;
  left: -20px;
  height: 65%;
  width: 108%;
  transform: skew(19deg, -9deg);
}

.modal-cta-container h2{
    margin-left: 30px;
}

.modal-cta-container span{
    margin-left: 30px;
}

.modal-cta-icon{
    height: 80px;
    width: 80px;
    border-radius: 20px;
    background-color: #fff;
    position: absolute;
    bottom: 25%;
    left: 30px;
    overflow:hidden;
    box-shadow: 5px 5px 30px rgba(0, 0, 0, 0.3);
}

.modal-cta-icon img{
    padding: 10px;
}

.modal-cta-container small{
    position: absolute;
    bottom:30px;
    left:30px;
}

h2.modal-cta-deal{
    position: absolute;
    text-align: right;
    color: #fff;
    bottom: 30px;
    right:30px;
}

.modal-cta-deal span{
    font-size: 14px;
}

.modal-cta-deal strong{
    font-weight: 900;
    font-size: 1.8rem;
    color: #fff !important;
}

.modal-cta-note {
    display: none; /* Hidden by default, shown via JS */
}

#modal-ctaBtn {
    position: relative;
    width: 100%;
    background: url('../images/vergleicho-background.png') center/cover no-repeat;
    color: #fff;
    display: inline-block;
    cursor: pointer;
    border: 1px solid var(--primary-color);
    border-radius: 8px;
    padding: 12px 20px;
    font-size: 16px;
    font-weight: bold;
    transition: all 0.3s ease;
}

.vergleicho-cta-sent h1{
    font-weight: 900;
}

.vergleicho-cta-sent-btn{
    position: relative;
    width: 100%;
    background: url('../images/vergleicho-background.png') center/cover no-repeat;
    color: #fff;
    display: inline-block;
    cursor: pointer;
    border: 1px solid var(--primary-color);
    border-radius: 8px;
    padding: 12px 20px;
    font-size: 16px;
    font-weight: bold;
    text-align: center;
    transition: all 0.3s ease;
}

/* Desktop Optimizations for vergleicho.ch Modals */

/* ====== GENERAL MODAL STYLING ====== */
@media (min-width: 992px) {
    /* Improved modal dimensions and positioning */
    .modal-fullscreen-custom .modal-dialog {
        max-width: 1000px;
        margin: 0 auto;
        height: auto;
    }

    .modal-fullscreen-custom .modal-content {
        height: auto;
        min-height: 600px;
        overflow: hidden;
    }

    /* Better header styling for desktop */
    .modal-fullscreen-custom .modal-header {
        padding: 18px 30px;
    }

    .modal-logo {
        height: 32px;
    }

    /* Improved body content layout */
    .modal-fullscreen-custom .modal-body {
        max-height: calc(90vh - 120px);
        overflow-y: auto;
        margin: 0px 76px;
    }

    .modal-fullscreen-custom .container-fluid {
        padding: 0 40px;
        max-width: 900px;
        margin: 0 auto;
    }

    /* Improved typography for desktop */
    .modal-fullscreen-custom h2 {
        font-size: 2.2rem;
        margin-bottom: 1.5rem;
    }

    .modal-fullscreen-custom p {
        font-size: 1.1rem;
        line-height: 1.6;
        margin-bottom: 1.5rem;
    }

    .btn-return, .btn-continue {
        height: 50px;
        font-size: 1rem;
    }
}

    /* ====== STEP 1: INSURANCE SELECTION ====== */
@media (min-width: 992px) {
    /* Create 3-column grid for insurance type selection */
    .icons-section .row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -15px;
    }

    .icons-section .col-6 {
    width: 25%; /* Show 4 items per row instead of 2 */
    padding: 15px;
    transition: all 0.3s ease;
    }

    /* Enhanced insurance cards */
    .icon-card {
    padding: 25px;
    border-radius: 12px;
    transition: all 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    }

    .icon-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(112, 161, 166, 0.2);
    }

    .icon-card img {
    height: 60px;
    width: 60px;
    margin-bottom: 15px;
    }

    .icon-card h3 {
    font-size: 1.1rem;
    text-align: center;
    }
}

/* ====== STEP 2: CANTON SELECTION ====== */
@media (min-width: 992px) {
  /* Canton dropdown styling */
  .canton-select-container {
    max-width: 500px;
  }
  
  .canton-select-trigger {
    height: 55px;
    border-radius: 8px;
  }
  
  .canton-select-trigger .placeholder,
  .canton-search {
    font-size: 1.1rem;
    padding: 15px 20px;
  }
  
  .canton-dropdown {
    border-radius: 0 0 8px 8px;
  }
  
  .canton-options {
    max-height: 300px;
  }
  
  .canton-option {
    padding: 12px 20px;
    font-size: 1.05rem;
  }
}

/* ====== STEP 3: RESULTS & FORM ====== */
@media (min-width: 992px) {
  /* Two-column layout for form and results card */
  .modal-body[data-page="calltoaction-2"] .container-fluid > .row {
    display: flex;
    flex-wrap: wrap;
  }
  
  /* Enhanced results card */
  .modal-cta-container {
    height: 275px;
    max-width: 700px;
  }
  
  .modal-cta-icon {
    height: 90px;
    width: 90px;
  }
  
  .modal-cta-deal strong {
    font-size: 2.2rem;
  }
  
  /* Form layout improvements */
  .spectacledcoder-input-secondary {
    margin-bottom: 20px;
  }
  
  .spectacledcoder-input-secondary input {
    height: 55px;
    font-size: 1.05rem;
    padding: 0 20px;
    border-radius: 8px;
  }
  
  /* Continue button enhancement */
  .btn-continue {
    padding: 12px 30px;
    min-width: 160px;
  }
}

/* ====== STEP 4: CONFIRMATION PAGE ====== */
@media (min-width: 992px) {
  /* Thank you page styling */
  .modal-body[data-page="calltoaction-3"] {
    padding-top: 50px;
    padding-bottom: 50px;
  }
  
  .modal-body[data-page="calltoaction-3"] h1 {
    font-size: 2.4rem;
    margin-bottom: 30px;
  }
    
  .modal-body[data-page="calltoaction-3"] p {
    font-size: 1.2rem;
    max-width: 600px;
    margin: 0 auto 40px;
    line-height: 1.8;
  }
  
  .vergleicho-cta-sent-btn {
    max-width: 300px;
    margin: 0 auto;
    padding: 15px 30px;
    font-size: 1.1rem;
  }
}

/* ====== FORMS & INPUTS ENHANCEMENTS ====== */
@media (min-width: 992px) {
  /* Form fields container */
  #call-to-action-form {
    max-width: 600px;
  }
  
  /* Label styling */
  .d-label {
    font-size: 1rem;
    margin-bottom: 8px;
    display: block;
  }
  
  /* Input field focus states */
  .spectacledcoder-input-secondary input:focus {
    border-color: #70a1a6;
    box-shadow: 0 0 0 3px rgba(112, 161, 166, 0.25);
    outline: none;
  }
  
  /* Privacy note styling */
  .note-dsg {
    max-width: 600px;
    background-color: #f8f9fa;
    border-radius: 8px;
  }
  
  .note-dsg p {
    font-size: 0.9rem;
    line-height: 1.5;
    margin-bottom: 0;
  }
}

/* Only apply these styles for desktop screens */
@media (min-width: 992px) {
  /* Full-width header styles */
  .full-width-modal-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    height: 74px;
    background: url('../images/vergleicho-background.png') center/cover no-repeat;
    z-index: 100001; /* Higher than modal */
    display: flex;
    align-items: center;
  }
  
  /* Container for centering content */
  .full-width-modal-header .header-container {
    width: 100%;
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 30px;
    display: flex;
    align-items: center;
  }
  
  /* Logo styling */
  .full-width-modal-header .modal-logo {
    height: 32px;
  }
  
  /* When modal has the full-width header, adjust content positioning */
  .modal-fullscreen-custom.has-custom-header .modal-dialog {
    margin-top: 74px;
  }
  
  /* Hidden class for the original header */
  .modal-fullscreen-custom.has-custom-header .modal-header {
    display: none;
  }
}

@media (max-width: 991px) {
  .navigation-buttons-container {
    padding: 15px;
  }
  
  .btn-return, .btn-continue {
    padding: 10px;
    font-size: 14px;
  }
  
  #call-to-action-form {
    margin-bottom: 80px; /* Space for fixed nav buttons */
  }
  
  /* Ensure modal body has enough padding at bottom */
  .modal-fullscreen-custom .modal-body {
    padding-bottom: 80px;
  }
}

/* Desktop-specific navigation button styles */
@media (min-width: 992px) {
  .navigation-buttons-container {
    left: auto !important;
    max-width: 600px !important;
    padding: 20px 15px !important;
    border-radius: 10px 10px 0 0 !important;
    border-top: none !important;
  }
  
  /* Override any conflicting styles */
  .navigation-buttons-container.navigation-fixed {
    position: fixed !important;
    bottom: 0 !important;
    margin-top: 0 !important;
    background-color: #fff !important;
  }
  
  /* Add adequate spacing at the bottom of form to prevent content from being hidden */
  #call-to-action-form {
    margin-bottom: 100px !important;
  }
  
  /* Ensure modal body has enough padding at bottom */
  .modal-fullscreen-custom .modal-body {
    padding-bottom: 100px !important;
  }
  
  /* Fix button row spacing */
  .navigation-buttons-container .row {
    margin: 0 -10px !important;
    width: 100% !important;
  }
  
  .navigation-buttons-container .col-6 {
    padding: 0 10px !important;
  }
}