#rapidit-support-widget {
    position: fixed;
    top: 50%;
    right: 0;
    transform: translateY(-50%);
    z-index: 9999;
    font-family: 'Segoe UI', 'Roboto', 'Arial', sans-serif;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

#rapidit-support-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: linear-gradient(135deg, #005bea 0%, #3ec6e0 100%);
    color: #fff;
    padding: 16px 12px;
    border-radius: 20px 0 0 20px;
    cursor: pointer;
    font-weight: 600;
    font-size: 13px;
    box-shadow: 0 4px 20px rgba(0, 94, 234, 0.25);
    border: none;
    outline: none;
    position: relative;
    margin-bottom: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    right: 0;
    letter-spacing: 0.2px;
    width: 80px;
    min-height: 100px;
    text-align: center;
}
#rapidit-support-btn:hover {
    background: linear-gradient(135deg, #3ec6e0 0%, #005bea 100%);
    transform: translateX(-3px) scale(1.02);
    box-shadow: 0 6px 30px rgba(0, 94, 234, 0.35);
}

.rapidit-support-icon {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}
.rapidit-support-icon::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    z-index: 0;
    animation: rapidit-pulse-advanced 2s infinite cubic-bezier(0.4, 0, 0.2, 1);
}
.rapidit-support-icon svg {
    position: relative;
    z-index: 1;
    width: 20px;
    height: 20px;
}

@keyframes rapidit-pulse-advanced {
    0% {
        box-shadow: 0 0 0 0 rgba(0,94,234,0.5), 0 0 0 0 rgba(62,198,224,0.3);
    }
    50% {
        box-shadow: 0 0 0 16px rgba(0,94,234,0.13), 0 0 0 32px rgba(62,198,224,0.07);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(0,94,234,0), 0 0 0 0 rgba(62,198,224,0);
    }
}

#rapidit-support-panel {
    display: none;
    background: rgba(255,255,255,0.98);
    border-radius: 16px 0 0 16px;
    padding: 20px 22px 18px 22px;
    width: 360px;
    max-width: 96vw;
    min-height: unset;
    max-height: 480px;
    overflow-y: auto;
    position: absolute;
    right: 100%;
    top: 50%;
    transform: translateY(-50%);
    box-shadow: -8px 12px 32px rgba(0,0,0,0.15);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid #e8f0fe;
    backdrop-filter: blur(8px);
}

.rapidit-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 16px;
    color: #005bea;
    letter-spacing: 0.1px;
    padding-bottom: 8px;
    border-bottom: 1px solid #f0f4f8;
}
.rapidit-close {
    cursor: pointer;
    font-size: 24px;
    color: #94a3b8;
    transition: all 0.2s ease;
    margin-left: 8px;
    padding: 4px;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.rapidit-close:hover {
    color: #005bea;
    background: rgba(0, 91, 234, 0.1);
}

.rapidit-body form {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 0;
}
.rapidit-body input[type="text"],
.rapidit-body input[type="email"],
.rapidit-body input[type="tel"],
.rapidit-body textarea {
    width: 100%;
    padding: 12px 16px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    font-size: 15px;
    background: #fafbfc;
    transition: all 0.2s ease;
    margin-bottom: 0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    box-sizing: border-box;
}
.rapidit-body input[type="text"]:focus,
.rapidit-body input[type="email"]:focus,
.rapidit-body input[type="tel"]:focus,
.rapidit-body textarea:focus {
    border: 1px solid #3ec6e0;
    outline: none;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(62,198,224,0.1), 0 2px 8px rgba(0,0,0,0.08);
}
.rapidit-body textarea {
    min-height: 70px;
    resize: vertical;
    font-family: inherit;
}
.rapidit-body input[type="submit"],
.rapidit-body button[type="submit"] {
    background: linear-gradient(135deg, #005bea 0%, #3ec6e0 100%);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 12px 0;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 4px;
    box-shadow: 0 2px 8px rgba(0,94,234,0.15);
    letter-spacing: 0.3px;
}
.rapidit-body input[type="submit"]:hover,
.rapidit-body button[type="submit"]:hover {
    background: linear-gradient(135deg, #3ec6e0 0%, #005bea 100%);
    box-shadow: 0 4px 16px rgba(62,198,224,0.25);
    transform: translateY(-1px);
}

/* Style Contact Form 7 labels for better appearance */
.rapidit-body label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    margin-bottom: 6px;
    line-height: 1.4;
}

/* Hide only empty labels or labels that are just asterisks */
.rapidit-body label:empty,
.rapidit-body label[aria-hidden="true"] {
    display: none;
}

/* Contact Form 7 specific styling */
.rapidit-body .wpcf7-form-control-wrap {
    display: block;
    width: 100%;
    margin-bottom: 0;
}

.rapidit-body .wpcf7-form-control {
    width: 100% !important;
    padding: 12px 16px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    font-size: 15px;
    background: #fafbfc;
    transition: all 0.2s ease;
    margin-bottom: 0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    box-sizing: border-box;
}

.rapidit-body .wpcf7-form-control:focus {
    border: 1px solid #3ec6e0;
    outline: none;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(62,198,224,0.1), 0 2px 8px rgba(0,0,0,0.08);
}

.rapidit-body .wpcf7-textarea {
    min-height: 70px;
    resize: vertical;
    font-family: inherit;
}

.rapidit-body .wpcf7-submit {
    background: linear-gradient(135deg, #005bea 0%, #3ec6e0 100%) !important;
    color: #fff !important;
    border: none !important;
    border-radius: 8px;
    padding: 12px 24px !important;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 4px;
    box-shadow: 0 2px 8px rgba(0,94,234,0.15);
    letter-spacing: 0.3px;
    width: 100%;
}

.rapidit-body .wpcf7-submit:hover {
    background: linear-gradient(135deg, #3ec6e0 0%, #005bea 100%) !important;
    box-shadow: 0 4px 16px rgba(62,198,224,0.25);
    transform: translateY(-1px);
}

/* CF7 validation messages */
.rapidit-body .wpcf7-not-valid-tip {
    color: #dc2626;
    font-size: 12px;
    margin-top: 4px;
    display: block;
}

.rapidit-body .wpcf7-validation-errors {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #dc2626;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 14px;
    margin-bottom: 12px;
}

.rapidit-body .wpcf7-mail-sent-ok {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #166534;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 14px;
    margin-bottom: 12px;
}

/* Mobile overlay backdrop */
#rapidit-mobile-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9998;
    backdrop-filter: blur(2px);
}

/* Prevent body scroll when panel is open on mobile */
body.rapidit-no-scroll {
    overflow: hidden;
    position: fixed;
    width: 100%;
    height: 100%;
}

/* Additional responsive and accessibility improvements */
@media (prefers-reduced-motion: reduce) {
    #rapidit-support-btn,
    #rapidit-support-panel,
    .rapidit-support-icon::before,
    .rapidit-body input,
    .rapidit-body textarea,
    .rapidit-body button {
        transition: none !important;
        animation: none !important;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    #rapidit-support-btn {
        border: 2px solid #000;
    }

    #rapidit-support-panel {
        border: 2px solid #000;
        background: #fff;
    }

    .rapidit-body input[type="text"],
    .rapidit-body input[type="email"],
    .rapidit-body input[type="tel"],
    .rapidit-body textarea {
        border: 2px solid #000;
        background: #fff;
    }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
    #rapidit-support-widget {
        bottom: 15px;
        right: 15px;
    }

    #rapidit-support-panel {
        max-height: calc(100vh - 60px);
        width: calc(100vw - 60px);
        max-width: 500px;
    }
}

/* --- Responsive Design --- */

/* Tablet and small desktop */
@media (max-width: 1024px) {
    #rapidit-support-panel {
        width: 340px;
    }
}

/* Large mobile and small tablet */
@media (max-width: 768px) {
    #rapidit-support-widget {
        top: auto;
        bottom: 20px;
        right: 20px;
        transform: none;
        align-items: flex-end;
    }

    #rapidit-support-panel {
        width: calc(100vw - 40px);
        right: auto;
        left: auto;
        position: fixed;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        border-radius: 16px;
        max-height: calc(100vh - 80px);
        max-width: calc(100vw - 40px);
        padding: 18px 20px 16px 20px;
        box-shadow: 0 8px 32px rgba(0,0,0,0.25);
        z-index: 10000;
    }

    #rapidit-support-btn {
        font-size: 12px;
        padding: 14px 10px;
        border-radius: 16px 0 0 16px;
        gap: 6px;
        width: 70px;
        min-height: 90px;
    }

    .rapidit-support-icon::before {
        width: 32px;
        height: 32px;
    }

    .rapidit-support-icon svg {
        width: 18px;
        height: 18px;
    }
}

/* Mobile phones */
@media (max-width: 480px) {
    #rapidit-support-widget {
        bottom: 15px;
        right: 15px;
    }

    #rapidit-support-panel {
        width: calc(100vw - 30px);
        max-width: calc(100vw - 30px);
        padding: 16px 18px 14px 18px;
        max-height: calc(100vh - 60px);
    }

    #rapidit-support-btn {
        font-size: 11px;
        padding: 12px 8px;
        gap: 5px;
        width: 60px;
        min-height: 80px;
        border-radius: 12px 0 0 12px;
    }

    .rapidit-support-icon::before {
        width: 28px;
        height: 28px;
    }

    .rapidit-support-icon svg {
        width: 16px;
        height: 16px;
    }

    .rapidit-header {
        font-size: 16px;
        margin-bottom: 14px;
    }

    .rapidit-body form {
        gap: 12px;
    }

    .rapidit-body input[type="text"],
    .rapidit-body input[type="email"],
    .rapidit-body input[type="tel"],
    .rapidit-body textarea,
    .rapidit-body .wpcf7-form-control {
        font-size: 14px !important;
        padding: 10px 14px !important;
    }

    .rapidit-body textarea,
    .rapidit-body .wpcf7-textarea {
        min-height: 60px !important;
    }

    .rapidit-body input[type="submit"],
    .rapidit-body button[type="submit"],
    .rapidit-body .wpcf7-submit {
        font-size: 15px !important;
        padding: 11px 24px !important;
    }
}

/* Very small screens */
@media (max-width: 360px) {
    #rapidit-support-widget {
        bottom: 10px;
        right: 10px;
    }

    #rapidit-support-panel {
        width: calc(100vw - 20px);
        max-width: calc(100vw - 20px);
        padding: 14px 16px 12px 16px;
        max-height: calc(100vh - 40px);
    }

    #rapidit-support-btn {
        font-size: 10px;
        padding: 10px 6px;
        width: 55px;
        min-height: 75px;
        border-radius: 10px 0 0 10px;
    }

    .rapidit-support-icon::before {
        width: 24px;
        height: 24px;
    }

    .rapidit-support-icon svg {
        width: 14px;
        height: 14px;
    }

    .rapidit-header {
        font-size: 15px;
    }

    .rapidit-close {
        font-size: 20px;
        width: 28px;
        height: 28px;
    }
}
