/**
 * AdSense Master Pro v3.0
 * Estilos para Posicionamento Avançado de Anúncios
 * 
 * @package AdSense Master Pro
 * @version 3.0.0
 * @since 3.0.0
 */

/* ============================================================================
   1. ANÚNCIOS FLUTUANTES (STICKY)
   ============================================================================ */

.amp-floating-ad {
    background: #ffffff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    max-width: 320px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif;
    z-index: 9999;
    transition: all 0.3s ease;
}

/* Posição Superior */
.amp-floating-ad.amp-floating-top {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    right: auto;
    width: 100%;
    max-width: 728px;
}

/* Posição Inferior (Padrão) */
.amp-floating-ad.amp-floating-bottom {
    position: fixed;
    bottom: 20px;
    left: 20px;
    right: auto;
}

/* Posição Esquerda */
.amp-floating-ad.amp-floating-left {
    position: fixed;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 300px;
}

/* Posição Direita */
.amp-floating-ad.amp-floating-right {
    position: fixed;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 300px;
}

/* Botão Fechar */
.amp-floating-close {
    position: absolute;
    top: 8px;
    right: 8px;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #999;
    padding: 4px 8px;
    line-height: 1;
    transition: color 0.2s ease;
}

.amp-floating-close:hover {
    color: #333;
}

.amp-floating-close:focus {
    outline: 2px solid #2271b1;
    outline-offset: 2px;
}

/* Estados */
.amp-floating-ad.hidden {
    display: none !important;
    opacity: 0;
    visibility: hidden;
}

.amp-floating-ad.visible {
    display: block;
    opacity: 1;
    visibility: visible;
}

/* ============================================================================
   2. ANÚNCIOS POP-UP
   ============================================================================ */

.amp-popup-ad {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    padding: 20px;
}

.amp-popup-ad.hidden {
    display: none !important;
}

/* Overlay Escuro */
.amp-popup-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    cursor: pointer;
    transition: background 0.3s ease;
}

/* Container do Pop-up */
.amp-popup-content {
    position: relative;
    background: white;
    padding: 30px;
    border-radius: 8px;
    max-width: 600px;
    width: 100%;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    overflow-y: auto;
    max-height: 90vh;
}

/* Botão Fechar Pop-up */
.amp-popup-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #999;
    padding: 4px 8px;
    line-height: 1;
    transition: color 0.2s ease;
    z-index: 1;
}

.amp-popup-close:hover,
.amp-popup-close:focus {
    color: #333;
}

.amp-popup-close:focus {
    outline: 2px solid #2271b1;
    outline-offset: 2px;
}

/* ============================================================================
   3. ANIMAÇÕES
   ============================================================================ */

@keyframes amp-fadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

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

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

@keyframes amp-slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes amp-slideInRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Aplicar animações */
.amp-popup-fadeIn {
    animation: amp-fadeIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.amp-popup-slideUp {
    animation: amp-slideUp 0.4s ease;
}

.amp-popup-slideDown {
    animation: amp-slideDown 0.4s ease;
}

.amp-floating-ad.amp-floating-bottom {
    animation: amp-slideUp 0.3s ease;
}

.amp-floating-ad.amp-floating-top {
    animation: amp-slideDown 0.3s ease;
}

.amp-floating-ad.amp-floating-left {
    animation: amp-slideInLeft 0.3s ease;
}

.amp-floating-ad.amp-floating-right {
    animation: amp-slideInRight 0.3s ease;
}

/* ============================================================================
   4. ANÚNCIOS ENTRE POSTS
   ============================================================================ */

.amp-between-posts {
    margin: 40px 0;
    padding: 20px 0;
    border-top: 1px solid #eee;
    border-bottom: 1px solid #eee;
}

.amp-between-posts-label {
    font-size: 12px;
    color: #999;
    text-transform: uppercase;
    margin-bottom: 15px;
    letter-spacing: 0.5px;
}

/* ============================================================================
   5. ANÚNCIOS EM COMENTÁRIOS
   ============================================================================ */

.amp-comment-ad {
    margin: 20px 0;
    padding: 20px;
    background: #f9f9f9;
    border-left: 4px solid #2271b1;
    border-radius: 4px;
}

.amp-comment-ad-label {
    font-size: 12px;
    color: #2271b1;
    text-transform: uppercase;
    margin-bottom: 10px;
    font-weight: 600;
}

/* ============================================================================
   6. BARRA DE FILTROS
   ============================================================================ */

.amp-filter-bar {
    margin-bottom: 30px;
    padding: 20px;
    background: #f5f5f5;
    border-radius: 4px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.amp-filter-button {
    padding: 8px 16px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
}

.amp-filter-button:hover {
    border-color: #2271b1;
    color: #2271b1;
}

.amp-filter-button.active {
    background: #2271b1;
    color: white;
    border-color: #2271b1;
}

/* ============================================================================
   7. RESPONSIVIDADE
   ============================================================================ */

/* Tablet */
@media screen and (max-width: 768px) {
    .amp-floating-ad {
        max-width: 280px;
    }

    .amp-floating-ad.amp-floating-left,
    .amp-floating-ad.amp-floating-right {
        display: none;
    }

    .amp-floating-ad.amp-floating-top {
        max-width: 100%;
        padding: 15px;
    }

    .amp-floating-ad.amp-floating-bottom {
        padding: 15px;
    }

    .amp-popup-content {
        padding: 20px;
        border-radius: 4px;
    }

    .amp-popup-close {
        top: 10px;
        right: 10px;
        font-size: 24px;
    }

    .amp-filter-bar {
        padding: 15px;
        gap: 8px;
    }
}

/* Mobile */
@media screen and (max-width: 480px) {
    .amp-floating-ad {
        max-width: 100%;
        border-radius: 0;
    }

    .amp-floating-ad.amp-floating-top {
        top: 0;
        left: 0;
        right: 0;
        transform: none;
    }

    .amp-floating-ad.amp-floating-bottom {
        bottom: 0;
        left: 0;
        right: 0;
    }

    .amp-popup-ad {
        padding: 0;
    }

    .amp-popup-content {
        max-width: 100%;
        width: 100%;
        border-radius: 0;
        padding: 20px;
        max-height: 100vh;
    }

    .amp-filter-bar {
        overflow-x: auto;
        padding: 12px;
        gap: 6px;
    }

    .amp-filter-button {
        padding: 6px 12px;
        font-size: 13px;
        white-space: nowrap;
    }

    .amp-between-posts {
        margin: 20px 0;
        padding: 15px 0;
    }
}

/* ============================================================================
   8. ACESSIBILIDADE
   ============================================================================ */

/* Respeita preferências de movimento reduzido */
@media (prefers-reduced-motion: reduce) {
    .amp-floating-ad,
    .amp-popup-ad,
    .amp-filter-button {
        animation: none !important;
        transition: none !important;
    }
}

/* Modo escuro */
@media (prefers-color-scheme: dark) {
    .amp-floating-ad {
        background: #2d2d2d;
        color: #e0e0e0;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    }

    .amp-floating-close {
        color: #666;
    }

    .amp-floating-close:hover {
        color: #e0e0e0;
    }

    .amp-popup-content {
        background: #2d2d2d;
        color: #e0e0e0;
    }

    .amp-popup-close {
        color: #666;
    }

    .amp-popup-close:hover {
        color: #e0e0e0;
    }

    .amp-popup-overlay {
        background: rgba(0, 0, 0, 0.9);
    }

    .amp-filter-bar {
        background: #3d3d3d;
    }

    .amp-filter-button {
        background: #2d2d2d;
        color: #e0e0e0;
        border-color: #444;
    }

    .amp-filter-button:hover {
        border-color: #2271b1;
    }

    .amp-comment-ad {
        background: #3d3d3d;
        border-left-color: #2271b1;
    }

    .amp-between-posts {
        border-color: #444;
    }
}

/* ============================================================================
   9. UTILITÁRIOS
   ============================================================================ */

/* Esconder elemento */
.amp-hidden {
    display: none !important;
}

/* Visível apenas para screen readers */
.screen-reader-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Clearfix */
.amp-clearfix::after {
    content: '';
    display: table;
    clear: both;
}

/* No print */
@media print {
    .amp-floating-ad,
    .amp-popup-ad,
    .amp-between-posts,
    .amp-comment-ad,
    .amp-filter-bar {
        display: none !important;
    }
}