/* Variables & Reset inside plugin scopes */
:root {
    --cgu-blue: #2271b1;
    --cgu-orange: #ffba00;
}

/* 1. Donate Widget */
.cg-donate-floating {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 99999;
}
.cg-donate-btn {
    border: none;
    background: transparent;
    cursor: pointer;
    animation: cgu_shake 3s ease-in-out infinite;
    padding: 0;
    border-radius: 50%;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
}
@keyframes cgu_shake {
    0%, 100% { transform: rotate(0deg); }
    10%, 30%, 50%, 70%, 90% { transform: rotate(-5deg); }
    20%, 40%, 60%, 80% { transform: rotate(5deg); }
}

/* Modal Donate & Exit Intent */
.cg-donate-modal, #cgu-exit-modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 999999;
    display: none;
    align-items: center;
    justify-content: center;
}
.cg-donate-modal.active, #cgu-exit-modal.active {
    display: flex;
}
.cg-donate-overlay, .cgu-exit-overlay {
    position: absolute;
    top:0; left:0; width:100%; height:100%;
    background: rgba(0,0,0,0.6);
}
.cg-donate-panel, .cgu-exit-panel {
    background: #fff;
    position: relative;
    max-width: 400px;
    width: 90%;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    padding: 30px 20px;
    text-align: center;
    animation: cgu_pop 0.3s cubic-bezier(0.18, 0.89, 0.32, 1.28);
}
@keyframes cgu_pop {
    0% { transform: scale(0.8); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.cg-donate-x, #cgu_exit_x {
    position: absolute;
    top: 10px; right: 15px;
    background: #f1f1f1;
    border: none;
    font-size: 20px;
    width: 30px; height: 30px;
    border-radius: 50%;
    cursor: pointer;
}
.cg-donate-qr img {
    max-width: 200px;
    border-radius: 10px;
    border: 1px solid #eee;
}
.cg-donate-h, .cgu-exit-h2 {
    font-size: 20px;
    font-weight: bold;
    margin: 15px 0 5px;
}

/* 2. Shortcode In-Post Donate */
.cgu-donate-sc {
    display: flex;
    align-items: center;
    background: #fffcf2;
    border: 1px solid #ffe9a6;
    border-radius: 12px;
    padding: 20px;
    margin: 30px 0;
}
.cgu-donate-sc-left {
    flex: 1;
    padding-right: 20px;
}
.cgu-donate-sc-left h4 {
    margin-top: 0;
    color: #e65100;
}
.cgu-donate-sc-right img {
    width: 150px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* 3. Progress Bar */
#cgu-progress-bar {
    position: fixed;
    top: 0; left: 0;
    height: 4px;
    background: linear-gradient(90deg, #ffba00, #ff4c4c);
    z-index: 9999999;
    width: 0%;
    transition: width 0.1s;
}

/* 4. Back To Top */
#cgu-back-to-top {
    position: fixed;
    bottom: -60px;
    left: 20px;
    width: 45px; height: 45px;
    background: var(--cgu-blue);
    color: #fff;
    border: none;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    box-shadow: 0 3px 10px rgba(0,0,0,0.2);
    transition: 0.3s;
    z-index: 99998;
}
#cgu-back-to-top.show {
    bottom: 20px;
}

/* 5. Mobile Bar */
.cgu-mobile-bar {
    display: none;
    position: fixed;
    bottom: 0; left: 0; right: 0;
    background: #fff;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    z-index: 99997;
    padding: 10px;
    text-align: center;
}
@media (max-width: 768px) {
    .cgu-mobile-bar { display: block; }
}

/* 6. Social FOMO */
#cgu-fomo-popup {
    position: fixed;
    bottom: 20px;
    left: -350px;
    background: #fff;
    border-radius: 50px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
    display: flex;
    align-items: center;
    padding: 5px 20px 5px 5px;
    z-index: 99999;
    transition: 0.5s cubic-bezier(0.18, 0.89, 0.32, 1.28);
}
#cgu-fomo-popup.cgu-fomo-show {
    left: 20px;
}
.cgu-fomo-icon {
    background: #ffba00;
    color: #fff;
    width: 40px; height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
}
.cgu-fomo-content {
    font-size: 13px;
}
#cgu-fomo-time {
    display: block;
    color: #999;
    font-size: 11px;
}

/* 7. Auto Sticky TOC */
#cgu-toc-container {
    position: fixed;
    top: 50%; 
    left: 20px;
    transform: translateY(-50%);
    width: 250px;
    background: #fff;
    border-left: 3px solid var(--cgu-blue);
    padding: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    z-index: 9990;
    display: none; /* Only show via JS if H2/H3 exist */
    border-radius: 0 8px 8px 0;
}
#cgu-toc-container h4 {
    margin: 0 0 10px;
    font-size: 14px;
    text-transform: uppercase;
}
#cgu-toc-list {
    margin: 0; padding: 0 0 0 15px;
    list-style: decimal;
    font-size: 13px;
    max-height: 400px;
    overflow-y: auto;
}
#cgu-toc-list a {
    color: #444;
    text-decoration: none;
    display: block;
    padding: 3px 0;
}
#cgu-toc-list a:hover { color: var(--cgu-blue); }

@media (max-width: 1024px) {
    #cgu-toc-container { display: none !important; }
}
