/**
 * ChunkAudio Ad Styles
 * Non-intrusive, clean advertisement styling
 */

/* Ad Container Base */
.ad-container {
    background: var(--bg-secondary, #f8fafc);
    border: 1px solid var(--border, #e2e8f0);
    border-radius: var(--radius, 12px);
    padding: 16px;
    text-align: center;
    position: relative;
}

.ad-label {
    display: block;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted, #94a3b8);
    margin-bottom: 8px;
}

/* Results Banner Ad */
.ad-banner-results {
    margin-top: 24px;
    max-width: 728px;
    margin-left: auto;
    margin-right: auto;
}

.ad-free-prompt {
    margin-top: 12px;
    font-size: 12px;
}

.ad-free-prompt a {
    color: var(--primary, #6366f1);
    text-decoration: none;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.ad-free-prompt a:hover {
    opacity: 1;
    text-decoration: underline;
}

/* Sidebar Ad */
.ad-sidebar {
    position: fixed;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    width: 160px;
    z-index: 100;
}

@media (max-width: 1400px) {
    .ad-sidebar {
        display: none; /* Hide sidebar ads on smaller screens */
    }
}

/* Carbon Ads Styling */
.carbon-ads-wrapper {
    min-height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#carbonads {
    font-family: inherit;
    max-width: 330px;
    margin: 0 auto;
}

#carbonads > span {
    display: flex;
    align-items: center;
    gap: 16px;
}

#carbonads .carbon-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
}

#carbonads .carbon-img {
    display: block;
}

#carbonads .carbon-img img {
    border-radius: 8px;
}

#carbonads .carbon-text {
    color: var(--text, #1e293b);
    font-size: 13px;
    line-height: 1.4;
    text-decoration: none;
}

#carbonads .carbon-text:hover {
    color: var(--primary, #6366f1);
}

#carbonads .carbon-poweredby {
    font-size: 10px;
    color: var(--text-muted, #94a3b8);
    text-decoration: none;
    margin-top: 8px;
    display: block;
}

/* Sponsor Container */
.sponsor-container {
    padding: 20px;
}

.sponsor-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: inherit;
    gap: 12px;
}

.sponsor-logo {
    max-width: 120px;
    max-height: 40px;
    object-fit: contain;
}

.sponsor-tagline {
    font-size: 12px;
    color: var(--text-muted, #94a3b8);
}

/* Contextual Links */
.contextual-links-wrapper {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--border, #e2e8f0);
}

.contextual-label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted, #94a3b8);
    margin-bottom: 12px;
}

.contextual-links-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
}

.contextual-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: var(--bg-secondary, #f8fafc);
    border: 1px solid var(--border, #e2e8f0);
    border-radius: var(--radius, 12px);
    text-decoration: none;
    color: inherit;
    transition: all 0.2s;
}

.contextual-link:hover {
    border-color: var(--primary, #6366f1);
    transform: translateY(-2px);
}

.contextual-icon {
    font-size: 18px;
}

.contextual-info {
    display: flex;
    flex-direction: column;
    text-align: left;
}

.contextual-info strong {
    font-size: 13px;
    color: var(--text, #1e293b);
}

.contextual-info span {
    font-size: 11px;
    color: var(--text-muted, #94a3b8);
}

/* Ad-Free Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 20px;
    animation: fadeIn 0.2s ease;
}

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

.modal-content {
    background: var(--bg, #ffffff);
    border-radius: var(--radius-lg, 16px);
    max-width: 600px;
    width: 100%;
    position: relative;
    animation: slideUp 0.3s ease;
}

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

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-muted, #94a3b8);
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
}

.modal-close:hover {
    background: var(--bg-secondary, #f8fafc);
    color: var(--text, #1e293b);
}

.adfree-modal {
    padding: 32px;
}

.adfree-header {
    text-align: center;
    margin-bottom: 24px;
}

.adfree-header h2 {
    font-size: 24px;
    margin-bottom: 8px;
    color: var(--text, #1e293b);
}

.adfree-header p {
    color: var(--text-muted, #94a3b8);
}

.adfree-plans {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

@media (max-width: 500px) {
    .adfree-plans {
        grid-template-columns: 1fr;
    }
}

.adfree-plan {
    background: var(--bg-secondary, #f8fafc);
    border: 2px solid var(--border, #e2e8f0);
    border-radius: var(--radius, 12px);
    padding: 24px;
    text-align: center;
    position: relative;
    transition: all 0.2s;
}

.adfree-plan:hover {
    border-color: var(--primary, #6366f1);
}

.adfree-plan.featured {
    border-color: var(--primary, #6366f1);
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.05) 0%, rgba(139, 92, 246, 0.05) 100%);
}

.plan-badge {
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary, #6366f1);
    color: white;
    font-size: 11px;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 20px;
}

.plan-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-muted, #94a3b8);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.plan-price {
    font-size: 36px;
    font-weight: 700;
    color: var(--text, #1e293b);
    margin-bottom: 16px;
}

.plan-price span {
    font-size: 14px;
    font-weight: 400;
    color: var(--text-muted, #94a3b8);
}

.plan-features {
    list-style: none;
    padding: 0;
    margin: 0 0 20px 0;
    text-align: left;
}

.plan-features li {
    padding: 6px 0;
    font-size: 13px;
    color: var(--text, #1e293b);
}

.plan-button {
    width: 100%;
    padding: 12px 20px;
    border: 2px solid var(--border, #e2e8f0);
    background: white;
    border-radius: var(--radius, 12px);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.plan-button:hover {
    border-color: var(--primary, #6366f1);
    color: var(--primary, #6366f1);
}

.plan-button.primary {
    background: var(--primary, #6366f1);
    border-color: var(--primary, #6366f1);
    color: white;
}

.plan-button.primary:hover {
    background: var(--primary-dark, #4f46e5);
    border-color: var(--primary-dark, #4f46e5);
}

.adfree-note {
    text-align: center;
    font-size: 12px;
    color: var(--text-muted, #94a3b8);
}

/* Success Toast */
.adfree-success-toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    background: #10b981;
    color: white;
    padding: 16px 24px;
    border-radius: var(--radius, 12px);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    z-index: 10001;
    animation: toastIn 0.3s ease, toastOut 0.3s ease 4.7s forwards;
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

@keyframes toastOut {
    from {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
    to {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }
}

.toast-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.toast-icon {
    font-size: 20px;
}

/* AdSense Responsive */
.adsense-ad {
    min-height: 90px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .ad-container {
        background: #1e293b;
        border-color: #334155;
    }

    .ad-label {
        color: #94a3b8;
    }

    /* Sidebar promo text */
    .sidebar-promo p {
        color: #cbd5e1 !important;
    }

    .contextual-link {
        background: #1e293b;
        border-color: #334155;
    }

    .contextual-info strong {
        color: #f1f5f9;
    }

    .contextual-info span {
        color: #94a3b8;
    }

    /* Modal dark mode */
    .modal-content {
        background: #1e293b;
    }

    .modal-close {
        color: #94a3b8;
    }

    .modal-close:hover {
        background: #334155;
        color: #f1f5f9;
    }

    .adfree-header h2 {
        color: #f1f5f9;
    }

    .adfree-header p {
        color: #94a3b8;
    }

    .adfree-plan {
        background: #0f172a;
        border-color: #334155;
    }

    .adfree-plan:hover {
        border-color: #6366f1;
    }

    .adfree-plan.featured {
        background: linear-gradient(135deg, rgba(99, 102, 241, 0.15) 0%, rgba(139, 92, 246, 0.15) 100%);
        border-color: #6366f1;
    }

    .plan-name {
        color: #94a3b8;
    }

    .plan-price {
        color: #f1f5f9;
    }

    .plan-price span {
        color: #94a3b8;
    }

    .plan-features li {
        color: #cbd5e1;
    }

    .plan-button {
        background: #0f172a;
        border-color: #475569;
        color: #f1f5f9;
    }

    .plan-button:hover {
        border-color: #6366f1;
        color: #818cf8;
    }

    .plan-button.primary {
        background: #6366f1;
        border-color: #6366f1;
        color: white;
    }

    .plan-button.primary:hover {
        background: #4f46e5;
        border-color: #4f46e5;
    }

    .adfree-note {
        color: #94a3b8;
    }

    .ad-free-prompt a {
        color: #818cf8;
    }

    #carbonads .carbon-text {
        color: #e2e8f0;
    }

    #carbonads .carbon-poweredby {
        color: #64748b;
    }
}
