/**
 * MW Callback - Styles CSS
 */

:root {
    --mw-callback-primary: #2c5aa0;
    --mw-callback-primary-hover: #1e3f73;
    --mw-callback-success: #28a745;
    --mw-callback-danger: #dc3545;
    --mw-callback-light: #ffffff;
    --mw-callback-dark: #333333;
    --mw-callback-shadow: rgba(0, 0, 0, 0.15);
    --mw-callback-border-radius: 8px;
    --mw-callback-transition: all 0.3s ease;
}

/* Widget principal */
.mw-callback-widget {
    position: fixed;
    z-index: 999999;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    font-size: 14px;
    line-height: 1.4;
}

/* Positions */
.mw-callback-bottom_right {
    bottom: 20px;
    right: 20px;
}

.mw-callback-bottom_left {
    bottom: 20px;
    left: 20px;
}

.mw-callback-top_right {
    top: 20px;
    right: 20px;
}

.mw-callback-top_left {
    top: 20px;
    left: 20px;
}

/* Bandeau principal */
.mw-callback-banner {
    display: flex;
    align-items: center;
    background: var(--mw-callback-light);
    border: 1px solid #e1e8ed;
    border-radius: var(--mw-callback-border-radius);
    box-shadow: 0 4px 12px var(--mw-callback-shadow);
    padding: 12px 16px;
    min-width: 280px;
    max-width: 400px;
    transition: var(--mw-callback-transition);
    cursor: pointer;
}

.mw-callback-banner:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--mw-callback-shadow);
}

/* Thème sombre */
.mw-callback-dark .mw-callback-banner {
    background: var(--mw-callback-dark);
    border-color: #555;
    color: var(--mw-callback-light);
}

/* Icône téléphone */
.mw-callback-icon {
    flex-shrink: 0;
    margin-right: 10px;
    color: var(--mw-callback-primary);
    animation: mw-callback-pulse 2s infinite;
}

.mw-callback-dark .mw-callback-icon {
    color: #4a90e2;
}

@keyframes mw-callback-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* Texte du bandeau */
.mw-callback-text {
    flex-grow: 1;
    font-weight: 500;
    color: var(--mw-callback-dark);
}

.mw-callback-dark .mw-callback-text {
    color: var(--mw-callback-light);
}

/* Actions du bandeau */
.mw-callback-actions {
    display: flex;
    gap: 8px;
    margin-left: 12px;
}

.mw-callback-btn-yes,
.mw-callback-btn-later,
.mw-callback-btn-close {
    border: none;
    background: none;
    cursor: pointer;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    transition: var(--mw-callback-transition);
}

.mw-callback-btn-yes {
    background: var(--mw-callback-primary);
    color: var(--mw-callback-light);
}

.mw-callback-btn-yes:hover {
    background: var(--mw-callback-primary-hover);
}

.mw-callback-btn-later {
    color: #666;
    background: #f1f3f4;
}

.mw-callback-btn-later:hover {
    background: #e8eaed;
}

.mw-callback-dark .mw-callback-btn-later {
    color: #ccc;
    background: #555;
}

.mw-callback-dark .mw-callback-btn-later:hover {
    background: #666;
}

.mw-callback-btn-close {
    color: #999;
    font-size: 18px;
    padding: 2px 6px;
}

.mw-callback-btn-close:hover {
    color: var(--mw-callback-danger);
    background: rgba(220, 53, 69, 0.1);
}

/* Formulaire */
.mw-callback-form {
    position: absolute;
    bottom: 100%;
    right: 0;
    margin-bottom: 10px;
    background: var(--mw-callback-light);
    border: 1px solid #e1e8ed;
    border-radius: var(--mw-callback-border-radius);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
    width: 320px;
    max-width: 90vw;
    z-index: 1000000;
    animation: mw-callback-form-appear 0.3s ease-out;
}

.mw-callback-dark .mw-callback-form {
    background: var(--mw-callback-dark);
    border-color: #555;
    color: var(--mw-callback-light);
}

@keyframes mw-callback-form-appear {
    0% {
        opacity: 0;
        transform: translateY(10px) scale(0.95);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* En-tête du formulaire */
.mw-callback-form-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
}

.mw-callback-dark .mw-callback-form-header {
    border-color: #555;
}

.mw-callback-form-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--mw-callback-dark);
    padding: 0;
    margin: 0;
    text-align: left;
}

.mw-callback-dark .mw-callback-form-header h3 {
    color: var(--mw-callback-light);
}

.mw-callback-form-close {
    border: none;
    background: none;
    font-size: 24px;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: var(--mw-callback-transition);
}

.mw-callback-form-close:hover {
    color: var(--mw-callback-danger);
    background: rgba(220, 53, 69, 0.1);
}

/* Champs du formulaire */
.mw-callback-form-fields {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.mw-callback-form input,
.mw-callback-form textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    box-sizing: border-box;
    transition: var(--mw-callback-transition);
}

.mw-callback-form input:focus,
.mw-callback-form textarea:focus {
    outline: none;
    border-color: var(--mw-callback-primary);
    box-shadow: 0 0 0 2px rgba(44, 90, 160, 0.1);
}

.mw-callback-dark .mw-callback-form input,
.mw-callback-dark .mw-callback-form textarea {
    background: #444;
    border-color: #666;
    color: var(--mw-callback-light);
}

.mw-callback-dark .mw-callback-form input::placeholder,
.mw-callback-dark .mw-callback-form textarea::placeholder {
    color: #ccc;
}

/* Actions du formulaire */
.mw-callback-form-actions {
    padding: 0 20px 20px 20px;
}

.mw-callback-submit {
    width: 100%;
    background: var(--mw-callback-primary);
    color: var(--mw-callback-light);
    border: none;
    padding: 12px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--mw-callback-transition);
}

.mw-callback-submit:hover {
    background: var(--mw-callback-primary-hover);
}

.mw-callback-submit:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* Message de retour */
.mw-callback-message {
    padding: 12px 20px;
    border-top: 1px solid #e1e8ed;
    font-size: 13px;
}

.mw-callback-dark .mw-callback-message {
    border-color: #555;
}

.mw-callback-message.success {
    background: rgba(40, 167, 69, 0.1);
    color: var(--mw-callback-success);
    border-left: 4px solid var(--mw-callback-success);
}

.mw-callback-message.error {
    background: rgba(220, 53, 69, 0.1);
    color: var(--mw-callback-danger);
    border-left: 4px solid var(--mw-callback-danger);
}

/* États d'animation */
.mw-callback-widget.mw-callback-hidden {
    opacity: 0;
    transform: translateY(20px);
    pointer-events: none;
}

.mw-callback-widget.mw-callback-showing {
    animation: mw-callback-show 0.5s ease-out;
}

@keyframes mw-callback-show {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Loading state */
.mw-callback-loading .mw-callback-submit {
    position: relative;
    color: transparent;
}

.mw-callback-loading .mw-callback-submit::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 16px;
    height: 16px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: mw-callback-spin 1s linear infinite;
    color: white;
}

@keyframes mw-callback-spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 480px) {
    .mw-callback-text { display:none; }
    .mw-callback-widget {
        position: fixed !important;
        bottom: 10px !important;
        left: 10px !important;
        right: 10px !important;
        top: auto !important;
    }
    
    .mw-callback-banner {
        min-width: auto;
        max-width: none;
        width: 100%;
        justify-content: center;
    }
    
    .mw-callback-form {
        position: fixed;
        bottom: 80px;
        left: 10px;
        right: 10px;
        width: auto;
        max-width: none;
        margin-bottom: 0;
    }
    
    .mw-callback-actions {
        flex-wrap: wrap;
        gap: 6px;
    }
    
    .mw-callback-btn-yes,
    .mw-callback-btn-later {
        font-size: 11px;
        padding: 4px 8px;
    }
}

/* Masquer sur très petits écrans si configuré */
@media (max-width: 360px) {
    .mw-callback-widget.mw-callback-hide-small {
        display: none !important;
    }
}
