/* Floating Widget Styles */
.cvc-floating-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    background: #f5f5f5;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 1005;
    transition: transform 0.3s ease; /* Smooth rotation transition */
}

.cvc-floating-widget.rotated {
    transform: rotate(-90deg); /* Spin 90 degrees left when rotated */
}

.cvc-widget-icon {
    width: 60px;
    height: 60px;
    font-size: 20px;
    color: #666;
    object-fit: contain; /* Ensure the icon scales properly */
}

/* Popup Styles */
.cvc-popup {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 450px;
    min-height: 400px;
    background: transparent; /* Changed to transparent to avoid covering content */
    border-radius: 10px;
    padding: 15px;
    z-index: 1001;
    transform-origin: bottom right;
    opacity: 0;
    transform: scale(0);
    transition: opacity 0.3s ease, transform 0.3s ease;
    box-sizing: border-box;
}

.cvc-popup.show {
    opacity: 1;
    transform: scale(1);
}

.cvc-popup-content {
    position: relative;
    z-index: 1002;
    width: 100%;
    background: #333; /* Moved background to content to allow content visibility */
    border-radius: 10px;
    padding: 40px; /* Internal padding for content */
    min-height: 370px; /* Adjusted to fit within popup */
    color: #fff; /* Ensure all text inside defaults to white */
}

/* New Styles for Thank You Message */
.cvc-thank-you {
    text-align: center;
    color: #fff !important; /* Force white text to ensure visibility */
    background: rgba(0, 0, 0, 0.7); /* Semi-transparent dark background to contrast with #333 */
    padding: 20px;
    border-radius: 5px;
    position: relative;
    z-index: 1003; /* Ensure it’s above other content if needed */
}

.cvc-thank-you p {
    margin: 0;
    color: #fff !important; /* Ensure paragraph text is white */
}

/* Popup Header Styles */
.cvc-popup-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 20px;
}

/* Hide header in form view */
.cvc-popup.form-view .cvc-popup-header {
    display: none;
}

.cvc-logo {
    width: 50px;
    height: 50px;
    margin-bottom: 10px;
}

/* Option Button Styles */
.cvc-option {
    display: block;
    width: 100%;
    padding: 12px;
    margin: 8px 0;
    border: none;
    border-radius: 5px;
    background: #232323;
    color: #fff;
    cursor: pointer;
    font: inherit !important;
}

/* Hide options in form view */
.cvc-popup.form-view .cvc-popup-options {
    display: none;
}

.cvc-option:hover {
    background: #555;
}

.cvc-option.cvc-option-selected {
    background: #d0d0d0;
}

/* Form Step Styles */
.cvc-form-step {
    display: none;
}

.cvc-form-step[style*="display: block"] {
    display: block !important;
}

.cvc-form-step h3 {
    font-size: 24px;
    color: #fff;
    line-height: 1.3;
    padding-bottom: 15px;
}

.cvc-form-step p {
    font-size: 14px;
    margin-bottom: 20px;
    color: #fff;
}

.cvc-field {
    display: block !important;
    margin: 8px 0;
    width: 100%;
    text-align: center;
}

.cvc-form-step input,
.cvc-form-step textarea {
    display: block !important;
    width: 100%;
    padding: 10px;
    margin: 0;
    border: none;
    border-radius: 5px;
    color: #fff !important; /* Force white text */
    background: rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
}

.cvc-form-step input[type="date"] {
    color: #fff !important; /* Ensure date input text is white */
    background-color: rgba(0, 0, 0, 0.2);
}

.cvc-form-step input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(1);
}

/* Placeholder Text Color (Cross-browser support with !important) */
.cvc-form-step input::-webkit-input-placeholder,
.cvc-form-step textarea::-webkit-input-placeholder,
.cvc-form-step input:-moz-placeholder,
.cvc-form-step textarea:-moz-placeholder,
.cvc-form-step input::-moz-placeholder,
.cvc-form-step textarea::-moz-placeholder,
.cvc-form-step input:-ms-input-placeholder,
.cvc-form-step textarea:-ms-input-placeholder {
    color: #fff !important; /* Force white placeholders */
}

/* Navigation and Submit Buttons */
.cvc-buttons {
    display: block !important;
    margin-top: 20px;
    font: inherit;
    text-align: center;
}

.cvc-next,
.cvc-prev,
.cvc-submit,
.cvc-back-to-options {
    display: inline-block !important;
    padding: 10px 20px;
    margin: 0 5px 0 0;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font: inherit;
}

.cvc-next,
.cvc-submit {
    background: #666;
    color: #fff;
}

.cvc-prev {
    background: #555;
    color: #fff;
}

.cvc-back-to-options {
    padding: 0;
    margin: 0 15px 0 0;
    background: none;
    color: #bbb;
    font-size: 12px;
    text-decoration: underline;
    display: inline-block !important;
}

.cvc-back-to-options:hover {
    color: #fff;
}

/* Close Button Styles (Removed since widget handles closing) */
.cvc-close {
    display: none; /* Hidden, no longer used */
}

/* Submission Details Table Styles */
.cvc-submission-details table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.cvc-submission-details th,
.cvc-submission-details td {
    padding: 10px;
    border: 1px solid #ddd;
    text-align: left;
}

.cvc-submission-details th {
    background: #f9f9f9;
    font-weight: bold;
}

.cvc-submission-details tr:nth-child(even) {
    background: #f2f2f2;
}


/* === Mobile Bottom Sheet Enhancements (v1.1.1) === */
@media (max-width: 640px) {
  .cvc-modal {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    top: auto;
    margin: 0;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    border-radius: 16px 16px 0 0;
    padding: 20px 16px;
    box-sizing: border-box;
    -webkit-overflow-scrolling: touch;
    z-index: 1000;
  }

  .cvc-modal::before {
    content: "";
    display: block;
    width: 40px;
    height: 4px;
    background: rgba(255,255,255,0.4);
    border-radius: 2px;
    margin: 0 auto 12px auto;
  }

  .cvc-action {
    width: 100%;
    margin-bottom: 12px;
    padding: 14px 16px;
    font-size: 16px;
  }

  .cvc-floating-button {
    display: none;
  }
}



/* === Mobile Bottom Sheet Stabilized (v1.1.2) === */
@media (max-width: 640px) {

  .cvc-popup {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;

    width: 100%;
    min-height: auto;
    max-height: 90vh;

    margin: 0;
    padding: 0;

    border-radius: 16px 16px 0 0;
    transform-origin: bottom center;
    overflow: hidden;
    z-index: 1001;
  }

  .cvc-popup-content {
    max-height: 90vh;
    overflow-y: auto;
    padding: 20px 16px 24px;
    -webkit-overflow-scrolling: touch;
  }

  .cvc-popup-content::before {
    content: "";
    display: block;
    width: 40px;
    height: 4px;
    background: rgba(255,255,255,0.4);
    border-radius: 2px;
    margin: 0 auto 14px;
  }

  .cvc-popup-options .cvc-option {
    width: 100%;
    padding: 14px 16px;
    font-size: 16px;
    margin-bottom: 12px;
  }

  .cvc-popup.show ~ .cvc-floating-widget {
    display: none;
  }
}
