/* =============================================
   PERFORMANCE BELOW AD (.perf-below-ad)
   Positioned right below the score-panel
   Static, closable, non-overlapping
   ============================================= */

.perf-below-ad {
    position: absolute;
    top: 570px;          /* score-panel altından biraz daha aşağıda */
    right: 30px;
    width: 220px;
    background: var(--bg-secondary);
    border: 1px solid rgba(var(--accent-primary-rgb), 0.2);
    border-radius: 16px;
    padding: 18px 16px 14px;
    box-shadow:
        0 6px 24px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.04);
    overflow: hidden;
    z-index: 989;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
}

.perf-below-ad:hover {
    border-color: rgba(var(--accent-primary-rgb), 0.35);
    box-shadow:
        0 10px 36px rgba(var(--accent-primary-rgb), 0.18),
        inset 0 1px 0 rgba(255, 255, 255, 0.06);
    transform: translateY(-2px);
}

/* Animated background orb */
.pba-glow-orb {
    position: absolute;
    top: -30px;
    right: -30px;
    width: 120px;
    height: 120px;
    background: radial-gradient(
        circle,
        rgba(var(--accent-primary-rgb), 0.18) 0%,
        transparent 70%
    );
    border-radius: 50%;
    pointer-events: none;
    animation: pbaOrbFloat 5s ease-in-out infinite;
}

@keyframes pbaOrbFloat {
    0%, 100% { transform: translate(0, 0) scale(1); opacity: 0.6; }
    50%       { transform: translate(-8px, 8px) scale(1.1); opacity: 1; }
}

/* Close button - hidden (ad is not closable) */
.pba-close-btn {
    display: none;
}

/* Sponsor badge */
.pba-badge {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-bottom: 12px;
}

.pba-badge-dot {
    width: 6px;
    height: 6px;
    background: var(--accent-primary);
    border-radius: 50%;
    box-shadow: 0 0 6px var(--accent-primary);
    animation: pbaDotPulse 2s ease-in-out infinite;
}

@keyframes pbaDotPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%       { opacity: 0.5; transform: scale(1.4); }
}

.pba-badge span:last-child {
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--accent-primary);
}

/* Content area */
.pba-content {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
}

/* Icon */
.pba-icon-wrap {
    width: 42px;
    height: 42px;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: #000;
    box-shadow: 0 4px 14px rgba(var(--accent-primary-rgb), 0.35);
    animation: pbaIconFloat 3.5s ease-in-out infinite;
    margin-bottom: 2px;
}

@keyframes pbaIconFloat {
    0%, 100% { transform: translateY(0); }
    50%       { transform: translateY(-4px); }
}

/* Title */
.pba-title {
    margin: 0;
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.3;
    background: linear-gradient(135deg, var(--text-primary) 40%, var(--accent-primary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Description */
.pba-desc {
    margin: 0;
    font-size: 11px;
    line-height: 1.5;
    color: var(--text-secondary);
}

/* CTA button */
.pba-cta-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 7px 12px;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: #000;
    text-decoration: none;
    border-radius: 8px;
    font-size: 10.5px;
    font-weight: 700;
    transition: all 0.3s ease;
    box-shadow: 0 3px 10px rgba(var(--accent-primary-rgb), 0.3);
    margin-top: 4px;
    align-self: center;
}

.pba-cta-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(var(--accent-primary-rgb), 0.45);
}

.pba-cta-btn i {
    font-size: 10px;
    transition: transform 0.3s ease;
}

.pba-cta-btn:hover i {
    transform: translateX(3px);
}

/* Code decoration - removed */
.pba-code-deco {
    display: none;
}

/* Closing animation */
.perf-below-ad.pba-closing {
    animation: pbaDissolve 0.6s ease forwards;
}

@keyframes pbaDissolve {
    0%   { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); }
    40%  { opacity: 0.6; transform: translateY(6px) scale(0.95); filter: blur(1px); }
    100% { opacity: 0; transform: translateY(16px) scale(0.85); filter: blur(6px); pointer-events: none; }
}

/* Responsive: hide on smaller screens where score-panel goes in-flow */
@media (max-width: 1400px) {
    .perf-below-ad {
        display: none !important;
    }
}

/* Light theme adjustments */
html[data-theme="light"] .perf-below-ad {
    background: rgba(255, 255, 255, 0.92);
    border-color: rgba(var(--accent-primary-rgb), 0.2);
    box-shadow:
        0 6px 24px rgba(0, 0, 0, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

html[data-theme="light"] .pba-close-btn {
    background: rgba(0, 0, 0, 0.06);
    border-color: rgba(0, 0, 0, 0.12);
    color: var(--text-secondary);
}

html[data-theme="light"] .pba-cta-btn {
    color: #fff;
}

/* Print mode */
@media print {
    .perf-below-ad { display: none !important; }
}

/* =============================================
   HORIZONTAL AD - BOTTOM (Performance altı)
   Full width, modern design
   ============================================= */

.horizontal-ad-bottom {
    position: fixed;
    right: 20px;
    bottom: 20px;
    width: 280px;
    min-height: 120px;
    background: linear-gradient(135deg, 
        rgba(var(--accent-primary-rgb), 0.08) 0%, 
        rgba(var(--accent-secondary-rgb), 0.05) 100%);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(var(--accent-primary-rgb), 0.15);
    border-radius: 16px;
    padding: 20px;
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    z-index: 900;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.horizontal-ad-bottom:hover {
    transform: translateY(-4px);
    box-shadow: 
        0 12px 48px rgba(var(--accent-primary-rgb), 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

/* Close button */
.ad-close-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 28px;
    height: 28px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 10;
    color: var(--text-secondary);
    font-size: 12px;
}

.ad-close-btn:hover {
    background: rgba(var(--error-color-rgb), 0.8);
    border-color: var(--error-color);
    color: #fff;
    transform: rotate(90deg);
}

/* Glow effect */
.ad-glow-effect {
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(
        circle at center,
        rgba(var(--accent-primary-rgb), 0.15) 0%,
        transparent 70%
    );
    animation: glowPulse 4s ease-in-out infinite;
    pointer-events: none;
}

@keyframes glowPulse {
    0%, 100% { opacity: 0.5; transform: scale(1); }
    50% { opacity: 0.8; transform: scale(1.1); }
}

/* Horizontal body layout */
.ad-body-horizontal {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.ad-left-section {
    display: flex;
    align-items: center;
    gap: 16px;
    flex: 1;
}

.ad-right-section {
    flex-shrink: 0;
}

/* Header inline */
.ad-header-inline {
    position: absolute;
    top: 12px;
    left: 20px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.ad-pulse-dot {
    width: 8px;
    height: 8px;
    background: var(--accent-primary);
    border-radius: 50%;
    animation: pulse 2s ease-in-out infinite;
    box-shadow: 0 0 8px var(--accent-primary);
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(1.2); }
}

.ad-label-inline {
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 1px;
    color: var(--accent-primary);
    text-transform: uppercase;
}

/* Icon */
.ad-icon-horizontal {
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    color: var(--bg-editor);
    box-shadow: 0 6px 20px rgba(var(--accent-primary-rgb), 0.4);
    animation: float 3s ease-in-out infinite;
    flex-shrink: 0;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-6px); }
}

/* Text content */
.ad-text-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.ad-title-horizontal {
    font-size: 15px;
    font-weight: 700;
    line-height: 1.3;
    color: var(--text-primary);
    margin: 0;
    background: linear-gradient(135deg, var(--text-primary), var(--accent-primary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.ad-desc-horizontal {
    font-size: 11px;
    line-height: 1.4;
    color: var(--text-secondary);
    margin: 0;
}

/* CTA button */
.ad-cta-horizontal {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: var(--bg-editor);
    text-decoration: none;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(var(--accent-primary-rgb), 0.3);
    white-space: nowrap;
}

.ad-cta-horizontal:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(var(--accent-primary-rgb), 0.5);
}

.ad-cta-horizontal i {
    font-size: 11px;
    transition: transform 0.3s ease;
}

.ad-cta-horizontal:hover i {
    transform: translateX(4px);
}

/* =============================================
   BINARY DISSOLVE ANIMATION
   ============================================= */

.ad-dissolve-particles {
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: 0;
    z-index: 20;
}

.binary-particle {
    position: absolute;
    font-family: 'Courier New', monospace;
    font-size: 10px;
    font-weight: 700;
    color: var(--accent-primary);
    opacity: 0;
    pointer-events: none;
}

/* Closing animation */
.horizontal-ad-bottom.closing {
    animation: adDissolveHorizontal 0.8s cubic-bezier(0.4, 0, 1, 1) forwards;
}

@keyframes adDissolveHorizontal {
    0% {
        opacity: 1;
        transform: translateY(0) scale(1);
        filter: blur(0px);
    }
    50% {
        opacity: 0.5;
        transform: translateY(4px) scale(0.95);
        filter: blur(2px);
    }
    100% {
        opacity: 0;
        transform: translateY(8px) scale(0.8);
        filter: blur(8px);
    }
}

/* Binary particle animation */
@keyframes binaryFall {
    0% {
        opacity: 0;
        transform: translateY(0) rotate(0deg);
    }
    10% {
        opacity: 1;
    }
    100% {
        opacity: 0;
        transform: translateY(100px) rotate(360deg);
    }
}

/* =============================================
   RESPONSIVE DESIGN
   ============================================= */

@media (max-width: 1400px) {
    .horizontal-ad-bottom {
        display: none !important;
    }
}

@media (max-width: 768px) {
    .horizontal-ad-bottom {
        width: calc(100% - 40px);
        left: 20px;
        right: 20px;
    }
    
    .ad-body-horizontal {
        flex-direction: column;
        text-align: center;
    }
    
    .ad-left-section {
        flex-direction: column;
    }
}

/* Light theme adjustments */
html[data-theme="light"] .horizontal-ad-bottom {
    background: linear-gradient(135deg, 
        rgba(var(--accent-primary-rgb), 0.12) 0%, 
        rgba(var(--accent-secondary-rgb), 0.08) 100%);
    border-color: rgba(var(--accent-primary-rgb), 0.25);
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

html[data-theme="light"] .ad-close-btn {
    background: rgba(255, 255, 255, 0.9);
    border-color: rgba(0, 0, 0, 0.15);
    color: var(--text-primary);
}

html[data-theme="light"] .ad-close-btn:hover {
    background: rgba(var(--error-color-rgb), 0.9);
    color: #fff;
}

html[data-theme="light"] .ad-title-horizontal {
    background: linear-gradient(135deg, var(--text-primary), var(--accent-primary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Print mode */
@media print {
    .horizontal-ad-bottom {
        display: none !important;
    }
}
