/**
 * KB Call Back - Frontend Styles
 *
 * @author    Starter
 * @copyright 2024
 * @license   http://opensource.org/licenses/afl-3.0.php  Academic Free License (AFL 3.0)
 */

/* ============================================
   Widget Container
   ============================================ */

.kbcb-widget {
    z-index: 9999;
}

/* Float Positions */
.kbcb-float_bottom {
    position: fixed;
    bottom: 20px;
    right: 20px;
}

.kbcb-float_left {
    position: fixed;
    bottom: 50%;
    left: 0;
    transform: translateY(50%);
}

.kbcb-float_right {
    position: fixed;
    bottom: 50%;
    right: 0;
    transform: translateY(50%);
}

.kbcb-column {
    position: relative;
    margin: 15px 0;
}

/* ============================================
   Trigger Button
   ============================================ */

.kbcb-trigger-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background-color: #25b9d7;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
}

.kbcb-trigger-btn:hover {
    background-color: #1a8fa8;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.kbcb-trigger-btn i {
    font-size: 24px;
}

.kbcb-trigger-btn .kbcb-icon-img {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

.kbcb-btn-text {
    white-space: nowrap;
}

/* Float left/right vertical buttons */
.kbcb-float_left .kbcb-trigger-btn,
.kbcb-float_right .kbcb-trigger-btn {
    flex-direction: column;
    padding: 15px 10px;
    writing-mode: vertical-rl;
    text-orientation: mixed;
}

.kbcb-float_left .kbcb-trigger-btn {
    border-radius: 0 8px 8px 0;
}

.kbcb-float_right .kbcb-trigger-btn {
    border-radius: 8px 0 0 8px;
}

/* ============================================
   Modal
   ============================================ */

.kbcb-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    animation: kbcb-fadeIn 0.3s ease;
}

@keyframes kbcb-fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.kbcb-modal-content {
    background: #ffffff;
    border-radius: 12px;
    padding: 30px;
    max-width: 450px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    animation: kbcb-slideIn 0.3s ease;
}

@keyframes kbcb-slideIn {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.kbcb-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 28px;
    color: #999;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 30px;
    height: 30px;
}

.kbcb-close:hover {
    color: #333;
}

/* ============================================
   Form Styles
   ============================================ */

.kbcb-title {
    margin: 0 0 10px;
    font-size: 22px;
    font-weight: 700;
    color: #232323;
    text-align: center;
}

.kbcb-note {
    margin-bottom: 20px;
    padding: 12px 15px;
    background: #f8f9fa;
    border-radius: 6px;
    font-size: 14px;
    color: #666;
    text-align: center;
}

.kbcb-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.kbcb-field {
    display: flex;
    flex-direction: column;
}

.kbcb-field label {
    margin-bottom: 5px;
    font-size: 13px;
    font-weight: 600;
    color: #333;
}

.kbcb-field label .required {
    color: #dc3545;
}

.kbcb-field input,
.kbcb-field select,
.kbcb-field textarea {
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.kbcb-field input:focus,
.kbcb-field select:focus,
.kbcb-field textarea:focus {
    outline: none;
    border-color: #25b9d7;
    box-shadow: 0 0 0 3px rgba(37, 185, 215, 0.15);
}

.kbcb-field textarea {
    resize: vertical;
    min-height: 80px;
}

/* Row layout for date/time */
.kbcb-field-row {
    flex-direction: row;
    gap: 15px;
}

.kbcb-field-half {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* reCAPTCHA */
.kbcb-captcha {
    display: flex;
    justify-content: center;
}

/* Submit Button */
.kbcb-submit-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 24px;
    background-color: #25b9d7;
    color: #ffffff;
    border: none;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
}

.kbcb-submit-btn:hover {
    background-color: #1a8fa8;
}

.kbcb-submit-btn:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

.kbcb-submit-btn i {
    font-size: 18px;
}

/* ============================================
   Loading State
   ============================================ */

.kbcb-loading {
    text-align: center;
    padding: 40px 20px;
}

.kbcb-spinner {
    width: 40px;
    height: 40px;
    margin: 0 auto 15px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #25b9d7;
    border-radius: 50%;
    animation: kbcb-spin 1s linear infinite;
}

@keyframes kbcb-spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

.kbcb-loading p {
    color: #666;
    margin: 0;
}

/* ============================================
   Result Message
   ============================================ */

.kbcb-result {
    text-align: center;
    padding: 30px 20px;
}

.kbcb-result.kbcb-success {
    color: #28a745;
}

.kbcb-result.kbcb-error {
    color: #dc3545;
}

.kbcb-result i {
    font-size: 48px;
    display: block;
    margin-bottom: 15px;
}

.kbcb-result-message {
    font-size: 15px;
    line-height: 1.5;
}

.kbcb-reset-btn {
    margin-top: 20px;
    padding: 10px 20px;
    background: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
}

.kbcb-reset-btn:hover {
    background: #e9ecef;
}

/* ============================================
   Column Widget Variation
   ============================================ */

.kbcb-column .kbcb-trigger-btn {
    width: 100%;
    justify-content: center;
}

.kbcb-column .kbcb-modal {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    height: auto;
    background: none;
}

.kbcb-column .kbcb-modal-content {
    max-width: 100%;
    margin-top: 10px;
}

/* ============================================
   Responsive
   ============================================ */

@media (max-width: 767px) {
    .kbcb-float_bottom {
        bottom: 10px;
        right: 10px;
    }

    .kbcb-trigger-btn {
        padding: 10px 15px;
        font-size: 13px;
    }

    .kbcb-trigger-btn i {
        font-size: 20px;
    }

    .kbcb-modal-content {
        padding: 20px;
        width: 95%;
    }

    .kbcb-title {
        font-size: 18px;
    }

    .kbcb-field-row {
        flex-direction: column;
    }

    .kbcb-btn-text {
        display: none;
    }

    .kbcb-float_bottom .kbcb-trigger-btn {
        padding: 12px;
        border-radius: 50%;
    }
}

/* ============================================
   Print Styles
   ============================================ */

@media print {
    .kbcb-widget {
        display: none !important;
    }
}
