/* ============================================
   Ad Button Gate - Frontend Styles
   ============================================ */

/* ---- Button Base ---- */
.abg-button-wrapper {
    display: block;
    margin: 12px 0;
}

.abg-button-wrapper[style*="text-align:center"] .abg-btn,
.abg-button-wrapper[style*="text-align: center"] .abg-btn {
    margin-left: auto;
    margin-right: auto;
}

.abg-button-wrapper[style*="text-align:right"] .abg-btn,
.abg-button-wrapper[style*="text-align: right"] .abg-btn {
    margin-left: auto;
}

.abg-btn {
    display: inline-block;
    padding: 14px 32px;
    font-size: 16px;
    font-weight: 600;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, sans-serif;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    transition: all 0.25s ease;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
    line-height: 1.3;
    position: relative;
    overflow: hidden;
}

.abg-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.abg-btn:active {
    transform: translateY(0);
}

/* ---- 10 Button Templates ---- */

/* 1. Purple Gradient */
.abg-template-1 {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffffff;
}
.abg-template-1:hover {
    background: linear-gradient(135deg, #5a6fd6 0%, #6a4190 100%);
}

/* 2. Pink-Red Gradient */
.abg-template-2 {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: #ffffff;
}
.abg-template-2:hover {
    background: linear-gradient(135deg, #e07dea 0%, #e04a60 100%);
}

/* 3. Blue Cyan */
.abg-template-3 {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: #ffffff;
}
.abg-template-3:hover {
    background: linear-gradient(135deg, #3d9beb 0%, #00dceb 100%);
}

/* 4. Green Mint */
.abg-template-4 {
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
    color: #1a1a1a;
}
.abg-template-4:hover {
    background: linear-gradient(135deg, #38d46c 0%, #2ee6c4 100%);
}

/* 5. Pink Yellow */
.abg-template-5 {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
    color: #1a1a1a;
}
.abg-template-5:hover {
    background: linear-gradient(135deg, #e96089 0%, #ebd036 100%);
}

/* 6. Dark Neon Green */
.abg-template-6 {
    background: #111111;
    color: #00ff88;
    border: 2px solid #00ff88;
    box-shadow: 0 0 15px rgba(0, 255, 136, 0.4);
}
.abg-template-6:hover {
    background: #00ff88;
    color: #111111;
    box-shadow: 0 0 25px rgba(0, 255, 136, 0.7);
}

/* 7. Outline Pink */
.abg-template-7 {
    background: #ffffff;
    color: #e91e63;
    border: 2px solid #e91e63;
    box-shadow: 0 4px 14px rgba(233, 30, 99, 0.2);
}
.abg-template-7:hover {
    background: #e91e63;
    color: #ffffff;
}

/* 8. Soft Pink Rounded */
.abg-template-8 {
    background: linear-gradient(135deg, #ff9a9e 0%, #fecfef 100%);
    color: #333333;
    border-radius: 50px;
    box-shadow: 0 4px 15px rgba(255, 154, 158, 0.4);
}
.abg-template-8:hover {
    background: linear-gradient(135deg, #ff8a8e 0%, #febfdf 100%);
    box-shadow: 0 6px 20px rgba(255, 154, 158, 0.55);
}

/* 9. Skew Blue */
.abg-template-9 {
    background: #2196f3;
    color: #ffffff;
    border-radius: 0;
    clip-path: polygon(8% 0%, 100% 0%, 92% 100%, 0% 100%);
    padding-left: 40px;
    padding-right: 40px;
}
.abg-template-9:hover {
    background: #1976d2;
}

/* 10. Rainbow */
.abg-template-10 {
    background: linear-gradient(45deg, #ff6b6b, #feca57, #48dbfb, #ff9ff3, #ff6b6b);
    background-size: 300% 300%;
    color: #ffffff;
    animation: abg-rainbow 4s ease infinite;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}
.abg-template-10:hover {
    animation-duration: 1.5s;
}
@keyframes abg-rainbow {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* ---- Overlay / Modal ---- */
.abg-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
    animation: abg-fadeIn 0.25s ease;
}

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

.abg-modal {
    background: #ffffff;
    border-radius: 16px;
    width: 90%;
    max-width: 480px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    animation: abg-slideUp 0.3s ease;
}

@keyframes abg-slideUp {
    from { transform: translateY(30px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.abg-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
}

.abg-modal-title {
    font-size: 16px;
    font-weight: 600;
    color: #212529;
}

.abg-close {
    background: none;
    border: none;
    font-size: 28px;
    line-height: 1;
    color: #6c757d;
    cursor: pointer;
    padding: 0 4px;
    transition: color 0.2s;
}
.abg-close:hover {
    color: #212529;
}

.abg-modal-body {
    padding: 30px 24px;
    text-align: center;
}

.abg-stage {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.abg-message {
    font-size: 15px;
    color: #495057;
    margin: 0;
}

/* ---- Countdown Circle ---- */
.abg-countdown-circle {
    position: relative;
    width: 140px;
    height: 140px;
}

.abg-countdown-circle svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.abg-circle-bg {
    fill: none;
    stroke: #e9ecef;
    stroke-width: 8;
}

.abg-circle-progress {
    fill: none;
    stroke: #667eea;
    stroke-width: 8;
    stroke-linecap: round;
    stroke-dasharray: 283; /* 2 * PI * 45 */
    stroke-dashoffset: 0;
    transition: stroke-dashoffset 1s linear;
}

.abg-countdown-number {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 42px;
    font-weight: 700;
    color: #212529;
}

/* ---- Ad Stage ---- */
.abg-ad-container {
    width: 100%;
    min-height: 120px;
    background: #f8f9fa;
    border: 1px dashed #ced4da;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

.abg-ad-container ins {
    display: block !important;
    width: 100% !important;
}

.abg-ad-timer {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
}

.abg-ad-progress-bar {
    flex: 1;
    height: 8px;
    background: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
}

.abg-ad-progress {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 4px;
    transition: width 0.2s linear;
}

#abg-ad-timer-text {
    font-size: 14px;
    font-weight: 600;
    color: #495057;
    min-width: 36px;
    text-align: right;
}

/* ---- Continue Button ---- */
.abg-continue-btn {
    display: inline-block;
    padding: 12px 36px;
    font-size: 16px;
    font-weight: 600;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffffff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 4px 14px rgba(102, 126, 234, 0.4);
}
.abg-continue-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
}

/* ---- Responsive ---- */
@media (max-width: 480px) {
    .abg-modal {
        width: 94%;
        max-width: none;
    }
    .abg-countdown-circle {
        width: 120px;
        height: 120px;
    }
    .abg-countdown-number {
        font-size: 36px;
    }
    .abg-btn {
        padding: 12px 24px;
        font-size: 15px;
    }
}
