/* ========================================
   نوار شناور - ساختار بهبود یافته
   ======================================== */
.customer-hub-sidebar {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    z-index: 9998;
    transition: all 0.3s ease;
}

/* موقعیت سمت راست */
.customer-hub-sidebar.right {
    right: 0;
    left: auto;
}

/* موقعیت سمت چپ */
.customer-hub-sidebar.left {
    left: 0;
    right: auto;
}

.sidebar-trigger {
    background: linear-gradient(135deg, var(--sidebar-color, #667eea) 0%, color-mix(in srgb, var(--sidebar-color, #667eea) 70%, #000) 100%);
    color: white;
    padding: 20px 12px;
    cursor: pointer;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    transform: rotate(180deg);
    transition: all 0.3s ease;
    box-shadow: 2px 2px 15px rgba(0,0,0,0.3);
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    line-height: 1.4;
    white-space: nowrap;
    user-select: none;
}

/* Border-radius برای سمت راست (گوشه‌های راست نرم) */
.customer-hub-sidebar.right .sidebar-trigger {
    border-radius: 0 15px 15px 0;
}

/* Border-radius برای سمت چپ (گوشه‌های چپ نرم) */
.customer-hub-sidebar.left .sidebar-trigger {
    border-radius: 15px 0 0 15px;
}

.sidebar-trigger:hover {
    padding: 20px 18px;
    box-shadow: 4px 4px 20px rgba(0,0,0,0.4);
    filter: brightness(1.1);
}

/* آیکون - در یک خط با متن */
.sidebar-icon {
    font-size: 22px;
    display: inline-block;
    writing-mode: horizontal-tb;
    transform: rotate(90deg);
    flex-shrink: 0;
    animation: iconBounce 2s infinite;
}

@keyframes iconBounce {
    0%, 100% { transform: rotate(90deg) scale(1); }
    50% { transform: rotate(90deg) scale(1.15); }
}

/* متن - در یک خط */
.sidebar-text {
    display: inline-block;
    letter-spacing: 1px;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.2);
}

/* افکت hover روی متن */
.sidebar-trigger:hover .sidebar-text {
    letter-spacing: 2px;
}

.sidebar-icon {
    font-size: 28px;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.customer-hub-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.customer-hub-modal.active {
    display: flex;
    opacity: 1;
}

.modal-overlay {
    position: absolute;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    backdrop-filter: blur(10px);
}

.modal-content {
    position: relative;
    background: white;
    border-radius: 25px;
    padding: 50px;
    max-width: 600px;
    width: 90%;
    animation: modal-slide-in 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}

@keyframes modal-slide-in {
    from {
        opacity: 0;
        transform: translateY(-100px) scale(0.8);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
}

.modal-header h3 {
    margin: 0;
    font-size: 28px;
    color: #333;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.close-modal {
    background: none;
    border: none;
    font-size: 36px;
    cursor: pointer;
    color: #999;
    transition: all 0.3s;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-modal:hover {
    background: #f0f0f0;
    color: #333;
    transform: rotate(90deg);
}

.modal-form .form-group {
    margin-bottom: 25px;
}

.modal-form label {
    display: block;
    margin-bottom: 10px;
    color: #666;
    font-weight: 600;
    font-size: 15px;
}

.modal-form input {
    width: 100%;
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 15px;
    font-size: 16px;
    transition: all 0.3s;
    background: #f9f9f9;
}

.modal-form input:focus {
    outline: none;
    border-color: #667eea;
    background: white;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

.submit-btn {
    width: 100%;
    padding: 18px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 15px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4);
}

.submit-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 40px rgba(102, 126, 234, 0.6);
}

.submit-btn:active {
    transform: translateY(-1px);
}

/* Confetti Animation */
@keyframes confetti-fall {
    0% {
        transform: translateY(-100vh) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotate(720deg);
        opacity: 0;
    }
}

.confetti-piece {
    position: fixed;
    width: 10px;
    height: 10px;
    top: -10px;
    animation: confetti-fall 3s ease-out forwards;
    z-index: 99999;
    pointer-events: none;
}

/* Success Message */
.success-message {
    background: linear-gradient(135deg, #56ab2f 0%, #a8e063 100%);
    color: white;
    padding: 20px;
    border-radius: 15px;
    text-align: center;
    font-size: 18px;
    font-weight: bold;
    margin-top: 20px;
    animation: pulse 1s ease-in-out;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}