/* ========== GLOBAL STYLES ========== */
body {
    font-family: 'Poppins', sans-serif;
    background: #f4f6f9;
    color: #212529;
    transition: background 0.3s;
}

/* Navbar */
#mainNavbar {
    background: #ffffff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

#mainNavbar .navbar-brand {
    color: #0d6efd;
    letter-spacing: -0.5px;
}

#navBadge {
    background: #0d6efd;
    color: white;
    font-weight: 500;
}

/* Card styling */
.card {
    border-radius: 16px;
    border: none;
}

.card-header {
    background: #ffffff;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    font-weight: 600;
}

/* Fade-in animation */
.fade-in {
    animation: fadeIn 0.4s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Form colors */
.form-control:focus, .form-select:focus {
    border-color: #0d6efd;
    box-shadow: 0 0 0 0.15rem rgba(13, 110, 253, 0.25);
}

/* Quick margin buttons */
.quick-margin {
    font-weight: 500;
}

/* Table */
#bundleTable th {
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

#bundleTable td {
    font-weight: 500;
}

.btn-buy {
    border-radius: 20px;
    padding: 0.3rem 1.2rem;
    font-weight: 600;
    font-size: 0.85rem;
    background: #25D366;
    border: none;
    color: white;
    transition: all 0.2s;
}

.btn-buy:hover {
    background: #128C7E;
    color: white;
}

/* Sticky preview on desktop */
.sticky-preview {
    position: sticky;
    top: 90px;
}

/* ========== FLYER STYLES (WhatsApp Status look) ========== */
.flyer-wrapper {
    width: 100%;
    max-width: 360px;
}

.flyer-container {
    background: #ffffff;
    border-radius: 22px;
    overflow: hidden;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.15);
    font-family: 'Poppins', sans-serif;
    transition: background 0.3s, color 0.3s;
}

.flyer-header {
    background: inherit;
    padding: 24px 16px 12px;
    text-align: center;
    border-bottom: 2px dashed rgba(255,255,255,0.3);
}

.flyer-logo-area {
    width: 70px;
    height: 70px;
    margin: 0 auto 10px;
    border-radius: 50%;
    background: rgba(255,255,255,0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.flyer-logo-placeholder i {
    font-size: 2.2rem;
    color: #0d6efd;
}

.flyer-logo-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.flyer-business-name {
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.flyer-tagline {
    font-size: 0.85rem;
    font-weight: 400;
    opacity: 0.85;
}

.flyer-network-badge {
    background: rgba(0,0,0,0.05);
    padding: 8px 16px;
    text-align: center;
    font-weight: 700;
    font-size: 1.1rem;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.flyer-bundles {
    padding: 16px;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
}

.bundle-chip {
    background: #f8f9fa;
    border: 1px solid rgba(0,0,0,0.1);
    border-radius: 50px;
    padding: 8px 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 0.9rem;
}

.bundle-chip .bundle-name {
    color: #495057;
}

.bundle-chip .bundle-price {
    color: #0d6efd;
    font-weight: 700;
}

.flyer-footer {
    background: inherit;
    padding: 16px;
    text-align: center;
    border-top: 2px dashed rgba(255,255,255,0.3);
}

.flyer-contact-row {
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 6px;
}

.flyer-contact-row i {
    font-size: 1.3rem;
    color: #25D366;
    background: white;
    border-radius: 50%;
    padding: 3px;
}

.flyer-cta {
    font-weight: 700;
    font-size: 0.9rem;
    letter-spacing: 0.5px;
    opacity: 0.9;
}

.flyer-watermark {
    text-align: center;
    font-size: 0.7rem;
    padding: 6px;
    background: rgba(0,0,0,0.03);
    color: #999;
    letter-spacing: 1px;
}

/* Responsive adjustments */
@media (max-width: 767.98px) {
    .flyer-wrapper {
        max-width: 100%;
    }
}

/* ========== NETWORK TAGS & FLYER GROUPING ========== */
.network-tag {
    background: #e9ecef;
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}

.form-check-input.network-checkbox:checked + .form-check-label {
    color: #0d6efd;
    font-weight: 600;
}

.flyer-group-label {
    width: 100%;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 4px 8px;
    background: rgba(0,0,0,0.05);
    border-radius: 6px;
    text-align: center;
    margin-top: 8px;
}

.flyer-group-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    padding: 4px 0;
}

/* Input inside table */
#bundleTable input.form-control-sm {
    width: 90px;
    padding: 0.2rem 0.4rem;
    font-weight: 500;
}

/* Recalc button spacing */
#recalcBtn {
    margin-right: 0.25rem;
}

#bundleTable .form-check-input {
    cursor: pointer;
    transform: scale(1.2);
}

#flyerSelectAllContainer .form-check-inline {
    margin-right: 1rem;
}
#flyerSelectAllContainer label {
    cursor: pointer;
}

.buy-now-btn {
    cursor: pointer;
}

/* ========== GOOGLE ADSENSE CONTAINMENT ========== */

/* Hide ads inside the main tool container */
main .adsbygoogle,
main ins.adsbygoogle,
main [id*="google_ads"],
main [class*="adsbygoogle"],
.flyer-container .adsbygoogle,
.flyer-wrapper .adsbygoogle,
#flyerContainer .adsbygoogle,
#bundleTable .adsbygoogle,
.card-body .adsbygoogle,
.toast-container .adsbygoogle,
.modal .adsbygoogle {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
    overflow: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
    position: absolute !important;
    z-index: -9999 !important;
}

/* Allow ads only in designated areas */
footer .adsbygoogle,
footer ins.adsbygoogle,
#mainNavbar .adsbygoogle,
#mainNavbar ins.adsbygoogle,
.ad-container .adsbygoogle,
.ads-allowed .adsbygoogle {
    display: block !important;
    width: auto !important;
    height: auto !important;
    overflow: visible !important;
    opacity: 1 !important;
    pointer-events: auto !important;
    position: relative !important;
    z-index: 1 !important;
}

.copy-ref-btn {
    padding: 2px 8px;
    font-size: 0.75rem;
}

.copy-ref-btn:hover {
    background: #0d6efd;
    color: white;
    border-color: #0d6efd;
}

.copy-feedback {
    font-size: 0.75rem;
    font-weight: 500;
}

#mainNavbar .navbar-brand {
    font-size: 1rem;
    white-space: nowrap;
}

#mainNavbar .btn-outline-light {
    background: #ffffff;
    color: #0d6efd;
    border: 2px solid #ffffff;
    font-size: 0.75rem;
    padding: 4px 12px;
    font-weight: 600;
    white-space: nowrap;
}

#mainNavbar .btn-outline-light:hover {
    background: #e6f0ff;
    color: #0d6efd;
    border-color: #ffffff;
}

#mainNavbar .badge {
    font-size: 0.7rem !important;
    padding: 5px 10px;
}

@media (max-width: 575.98px) {
    #mainNavbar .navbar-brand {
        font-size: 0.8rem;
    }
    
    #mainNavbar .btn-outline-light {
        font-size: 0.65rem;
        padding: 3px 8px;
    }
    
    #mainNavbar .badge {
        font-size: 0.65rem !important;
        padding: 4px 8px;
    }
}