/* ============================================================
   CodeSeven Contact Buttons Pro - Public Styles
   ============================================================ */

.ccbp-widget {
    --ccbp-primary: #9333ea;
    --ccbp-primary-dark: #7e22ce;
    --ccbp-bg: #ffffff;
    --ccbp-text: #111827;
    --ccbp-text-muted: #6b7280;
    --ccbp-border: #e5e7eb;
    --ccbp-shadow: 0 10px 40px rgba(0,0,0,0.12);
    --ccbp-shadow-hover: 0 15px 50px rgba(0,0,0,0.2);
    
    position: fixed !important;
    z-index: 999999 !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, sans-serif;
    font-size: 14px;
    line-height: 1.4;
}

/* ===== Positions ===== */
.ccbp-pos-bottom-right  { bottom: 20px; right: 20px; }
.ccbp-pos-bottom-left   { bottom: 20px; left: 20px; }
.ccbp-pos-top-right     { top: 20px; right: 20px; }
.ccbp-pos-top-left      { top: 20px; left: 20px; }

/* ===== Hide on mobile/desktop based on settings ===== */
@media (max-width: 767px) {
    .ccbp-widget:not(.ccbp-show-mobile) { display: none !important; }
}
@media (min-width: 768px) {
    .ccbp-widget:not(.ccbp-show-desktop) { display: none !important; }
}

/* ============================================================
   STYLE 1: FLOATING POPUP
   ============================================================ */

.ccbp-style-floating_popup .ccbp-main-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    background: var(--ccbp-primary);
    color: #fff;
    box-shadow: var(--ccbp-shadow);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    padding: 0;
    position: relative;
}

.ccbp-style-floating_popup .ccbp-main-btn:hover {
    transform: scale(1.1);
    box-shadow: var(--ccbp-shadow-hover);
}

.ccbp-style-floating_popup .ccbp-main-btn svg {
    width: 28px;
    height: 28px;
}

/* Pulse animation */
.ccbp-pulse .ccbp-main-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 50%;
    background: var(--ccbp-primary);
    z-index: -1;
    animation: ccbp-pulse-anim 2s infinite;
}

@keyframes ccbp-pulse-anim {
    0%   { transform: scale(1);   opacity: 0.6; }
    100% { transform: scale(1.8); opacity: 0; }
}

/* When popup is open */
.ccbp-widget.ccbp-open .ccbp-main-btn { transform: rotate(180deg); }
.ccbp-widget.ccbp-open .ccbp-main-icon { display: none !important; }
.ccbp-widget.ccbp-open .ccbp-close-icon { display: block !important; }

/* ===== Popup container ===== */
.ccbp-popup {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 320px;
    max-width: calc(100vw - 40px);
    background: var(--ccbp-bg);
    border-radius: 16px;
    box-shadow: var(--ccbp-shadow);
    overflow: hidden;
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.ccbp-pos-bottom-left .ccbp-popup,
.ccbp-pos-top-left   .ccbp-popup  { right: auto; left: 0; }

.ccbp-pos-top-right .ccbp-popup,
.ccbp-pos-top-left  .ccbp-popup   { bottom: auto; top: 80px; }

.ccbp-widget.ccbp-open .ccbp-popup {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

/* ===== Popup header ===== */
.ccbp-popup-header {
    background: linear-gradient(135deg, var(--ccbp-primary) 0%, var(--ccbp-primary-dark) 100%);
    color: #fff;
    padding: 20px;
}

.ccbp-popup-title {
    margin: 0 0 4px 0 !important;
    font-size: 17px !important;
    font-weight: 600 !important;
    color: #fff !important;
    line-height: 1.3 !important;
}

.ccbp-popup-subtitle {
    margin: 0 !important;
    font-size: 13px !important;
    opacity: 0.85;
    color: #fff !important;
    line-height: 1.4 !important;
}

.ccbp-offline-notice {
    margin-top: 12px;
    padding: 8px 12px;
    background: rgba(255,255,255,0.15);
    border-radius: 8px;
    font-size: 12px;
    backdrop-filter: blur(10px);
}

/* ===== Channel list ===== */
.ccbp-channel-list {
    padding: 8px;
    max-height: 400px;
    overflow-y: auto;
}

.ccbp-channel-btn {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 14px;
    border-radius: 10px;
    text-decoration: none !important;
    color: var(--ccbp-text) !important;
    transition: background 0.2s ease;
    border: none;
    background: transparent;
    cursor: pointer;
    margin: 2px 0;
}

.ccbp-channel-btn:hover {
    background: #f3f4f6;
    text-decoration: none !important;
}

.ccbp-ch-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: var(--ch-color, var(--ccbp-primary));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.ccbp-ch-icon svg {
    width: 22px;
    height: 22px;
}

.ccbp-ch-label {
    flex: 1;
    font-weight: 500;
    font-size: 14px;
    color: var(--ccbp-text);
}

.ccbp-ch-arrow {
    color: var(--ccbp-text-muted);
    font-size: 20px;
    line-height: 1;
}

/* ===== Footer ===== */
.ccbp-popup-footer {
    padding: 10px 16px;
    border-top: 1px solid var(--ccbp-border);
    text-align: center;
}

.ccbp-popup-footer small {
    color: var(--ccbp-text-muted);
    font-size: 11px;
}

.ccbp-popup-footer a {
    color: var(--ccbp-primary);
    text-decoration: none;
    font-weight: 600;
}

/* ============================================================
   STYLE 2: STACK
   ============================================================ */

.ccbp-style-stack .ccbp-stack {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ccbp-stack-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff !important;
    text-decoration: none !important;
    box-shadow: var(--ccbp-shadow);
    transition: all 0.3s ease;
    position: relative;
}

.ccbp-stack-btn:hover {
    transform: scale(1.1) translateX(-3px);
    box-shadow: var(--ccbp-shadow-hover);
    text-decoration: none !important;
}

.ccbp-pos-bottom-left .ccbp-stack-btn:hover,
.ccbp-pos-top-left   .ccbp-stack-btn:hover {
    transform: scale(1.1) translateX(3px);
}

.ccbp-stack-btn svg {
    width: 24px;
    height: 24px;
}

.ccbp-stack-btn .ccbp-ch-label {
    position: absolute;
    right: 60px;
    background: rgba(0,0,0,0.85);
    color: #fff;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.ccbp-stack-btn:hover .ccbp-ch-label { opacity: 1; }

.ccbp-pos-bottom-left .ccbp-stack-btn .ccbp-ch-label,
.ccbp-pos-top-left   .ccbp-stack-btn .ccbp-ch-label {
    right: auto;
    left: 60px;
}

/* ============================================================
   DARK MODE
   ============================================================ */
@media (prefers-color-scheme: dark) {
    .ccbp-widget {
        --ccbp-bg: #1f2937;
        --ccbp-text: #f9fafb;
        --ccbp-text-muted: #9ca3af;
        --ccbp-border: #374151;
    }
    .ccbp-channel-btn:hover { background: #374151; }
}

/* ============================================================
   MOBILE RESPONSIVE
   ============================================================ */
@media (max-width: 480px) {
    .ccbp-style-floating_popup .ccbp-main-btn { width: 56px; height: 56px; }
    .ccbp-style-floating_popup .ccbp-main-btn svg { width: 26px; height: 26px; }
    .ccbp-popup { width: calc(100vw - 30px); }
    .ccbp-pos-bottom-right { bottom: 15px; right: 15px; }
    .ccbp-pos-bottom-left  { bottom: 15px; left: 15px; }
}
