/* Base Styles */
.swal-custom-class .swal2-html-container {text-align: left !important;}
.swal-custom-class .swal2-confirm {color: #ffffff !important; background-color: #ed610c !important;}
.swal-custom-class .swal2-cancel {color: #000 !important; background-color: #ffffff !important; border:1px solid #ed610c !important;}
.ctooltip{cursor: pointer;}
.tooltipTxt{
    position: absolute;
    max-width: 268px;
    z-index: -135 !important;
    height: 0px;
    color: #ffff;
    font-size: 13px;
    font-weight: 500;
    background: #4e4e4e;
    padding: 16px 12px;
    border: 1px solid #e9e9e9;
    border-radius: 0.5rem;
    top: 213px;
    width: 100%;
    left: -39%;
    margin: auto;
    opacity: 0;
    transition: all 0.2s;
}
.ctooltip.active .tooltipTxt{opacity: 1;height: auto;z-index: 9;}
.ctooltip i{color: var(--blue);}

/* Tooltip arrow */
.tooltipTxt::after {
content: '';
    position: absolute;
    bottom: 100%;
    left: 85%;
    transform: translateX(-50%);
    border-width: 6px;
    border-style: solid;
    border-color: transparent transparent rgba(0, 0, 0, 0.85) transparent;
}

.ai-mail-form {
    max-width: 600px;
    margin: 0 auto;
    padding: 30px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 35, 71, 0.1);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Form Elements */
.ai-subject { margin-bottom:15px; }
.ai-generated-mail{ margin-top:15px; }

.ai-mail-form p {
    margin-bottom: 25px;
}

.ai-mail-form label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #002347;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ai-mail-form .consent-label {
    display: inline-block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #002347;
    font-size: 14px;
    letter-spacing: 0.5px;
}

.ai-mail-form input[type="text"],
.ai-mail-form input[type="email"],
.ai-mail-form textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: #f8f9fa;
    box-sizing: border-box;
}

.ai-mail-form input[type="text"]:focus,
.ai-mail-form input[type="email"]:focus,
.ai-mail-form textarea:focus {
    outline: none;
    border-color: #f66d07;
    background: white;
    box-shadow: 0 0 0 3px rgba(246, 109, 7, 0.1);
}

/* Tone & Length Section */
.tone-length-wrapper {
    position: relative;
    margin: 30px 0;
}

.tone-length-btn {
    background: linear-gradient(135deg, #f66d07, #e65c00);
    color: white !important;
    border: none !important;
    padding: 12px 25px !important;
    border-radius: 8px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    box-shadow: 0 4px 15px rgba(246, 109, 7, 0.3);
}

/* spinner loading */
.ai-spin-container{margin-bottom:15px;}
.ai-loader { display: none; }
.ai-loader {
    align-items: center;
    gap: 10px;
    margin-top: 10px;
    font-size: 14px;
    color: #555;
}

.spinner {
    width: 16px;
    height: 16px;
    border: 2px solid #ccc;
    border-top: 2px solid #ED610C;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

/* Popup Styles */
.tone-length-popup {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    width: 300px;
    background: white;
    border: 2px solid #002347;
    border-radius: 8px;
    padding: 16px;
    margin-top: 8px;
    box-shadow: 0 5px 20px rgba(0, 35, 71, 0.15);
    z-index: 1000;
}

.tone-length-wrapper.active .tone-length-popup {
    display: block;
}

/* ✅ Remove / hide old radio length section if still present */
.tone-length-popup .css-1qc6lv,
.tone-length-popup .chakra-stack.css-tinb77 {
    display: none !important;
}

/* Labels inside popup */
.tone-length-popup label {
    font-size: 12px;
    margin-bottom: 6px;
    margin-top: 10px;
    color: #002347;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.tone-length-popup label:first-child {
    margin-top: 0;
}

/* Select Dropdown - updated for Length + Tone */
.ai-mail-form select {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    background: white;
    font-size: 14px;
    color: #002347;
    cursor: pointer;
    margin-top: 0;
    transition: all 0.2s ease;
}

.ai-mail-form select:focus {
    outline: none;
    border-color: #f66d07;
    box-shadow: 0 0 0 3px rgba(246, 109, 7, 0.12);
}

/* Submit Button */
.ai-mail-form button[type="submit"] {
    background: linear-gradient(135deg, #002347, #003366);
    color: white;
    border: none;
    padding: 15px 40px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    box-shadow: 0 4px 15px rgba(0, 35, 71, 0.3);
}

.ai-mail-form button[type="submit"]:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 35, 71, 0.4);
}

.tone-length-btn.AI-Generate {
    background: linear-gradient(45deg, #002347, #f66d07);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(0, 35, 71, 0.3);
}

.tone-length-btn.AI-Generate:hover {
    background: linear-gradient(45deg, #f66d07, #002347);
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(246, 109, 7, 0.4);
}

.tone-length-btn.AI-Generate:disabled {
    background: #cccccc;
    color: #666666 !important;
    cursor: not-allowed !important;
    transform: none;
    box-shadow: none;
    opacity: 0.6;
}

/* Responsive Design */
@media (max-width: 768px) {
    .ai-mail-form {
        padding: 20px;
        margin: 10px;
    }

    .tone-length-popup {
        width: 92%;
        left: 0;
        right: 0;
    }

    .tooltipTxt {
        position: absolute;
        max-width: unset;
        z-index: 0 !important;
        background: #262424;
        top: 51px;
        width: 90%;
        left: 1%;
    }

    .tone-length-wrapper {
        display: flex;
        justify-content: space-evenly;
    }

    .tone-length-btn {
        padding: 11px 20px !important;
    }

    .tooltipTxt::after {
        content: '';
        position: absolute;
        top: 100%;
        left: 8%;
        transform: translateX(-50%);
        border-width: 6px;
        border-style: solid;
        border-color: rgba(0, 0, 0, 0.85) transparent transparent transparent;
    }
}

@media (min-width: 477px) {
    .swal-custom-class .swal2-cancel {margin-right: -55%;}
}

/* Hide <br> tags inside form */
form.ai-mail-form br {
    display: none;
}

/* Consent Checkbox Styling */
.checkbox-container {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 18px;
  max-width: 500px;
  border-radius: 10px;
  transition: all 0.3s ease;
}

.checkbox-container:hover {
  background: rgba(246, 109, 7, 0.04);
}

.checkbox-container input[type="checkbox"] {
  appearance: none;
  width: 26px;
  height: 26px;
  border: 2.5px solid #e0e0e0;
  border-radius: 7px;
  background: white;
  cursor: pointer;
  position: relative;
  flex-shrink: 0;
  margin-top: 1px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.checkbox-container input[type="checkbox"]:hover {
  border-color: #f66d07;
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(246, 109, 7, 0.2);
}

.checkbox-container input[type="checkbox"]:checked {
  background: linear-gradient(135deg, #f66d07 0%, #ff8c3a 100%);
  border-color: #f66d07;
  box-shadow: 0 4px 15px rgba(246, 109, 7, 0.3);
}

.checkbox-container input[type="checkbox"]:checked::after {
  content: '✓';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(1);
  color: white;
  font-size: 16px;
  font-weight: bold;
  animation: checkPop 0.3s ease;
}

@keyframes checkPop {
  0% { transform: translate(-50%, -50%) scale(0); }
  50% { transform: translate(-50%, -50%) scale(1.2); }
  100% { transform: translate(-50%, -50%) scale(1); }
}

.checkbox-container input[type="checkbox"]:focus {
  outline: none;
  box-shadow: 0 0 0 4px rgba(246, 109, 7, 0.15);
}

.consent-label {
  color: #002347;
  font-size: 15px;
  line-height: 1.6;
  cursor: pointer;
  user-select: none;
  transition: all 0.3s ease;
}

.consent-label:hover {
  color: #f66d07;
}

.checkbox-container input[type="checkbox"]:checked + .consent-label {
  color: #002347;
  font-weight: 500;
}

@media (min-width: 767px) and (max-width: 1024px) {
    .tooltipTxt {
        position: absolute;
        max-width: unset;
        z-index: 0 !important;
        background: #262424;
        top: 51px;
        width: 90%;
        left: 1%;
    }
    .tone-length-wrapper {
        display: flex;
        justify-content: start;
        gap: 20px;
    }
    .tone-length-btn {
        padding: 11px 20px !important;
    }
}
