/* ===== SISTEMA COMPLETO DE ANUNCIOS - ESTILOS INDEPENDIENTES ===== */

/* ===== ESPACIOS PUBLICITARIOS MODERNOS ===== */

/* Espacios publicitarios básicos - Diseño moderno */
.ad-space {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 20px 0;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 2px solid #e9ecef;
    border-radius: 16px;
    min-height: 90px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    z-index: 50;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.ad-space::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transition: left 0.6s;
    z-index: 1;
}

.ad-space:hover {
    border-color: #007bff;
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 123, 255, 0.15);
}

.ad-space:hover::before {
    left: 100%;
}

/* Contenedor de anuncio */
.ad-container {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 728px;
    height: 90px;
    position: relative;
    z-index: 2;
    padding: 10px;
}

/* Placeholder cuando no hay anuncios */
.ad-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: #6c757d;
    font-size: 0.9rem;
    text-align: center;
    padding: 20px;
    width: 100%;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 12px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.ad-placeholder i {
    font-size: 32px;
    color: #007bff;
    margin-bottom: 8px;
    filter: drop-shadow(0 2px 4px rgba(0, 123, 255, 0.3));
}

.ad-placeholder p {
    margin: 0;
    font-weight: 700;
    color: #333;
    font-size: 1rem;
    letter-spacing: 0.5px;
}

.ad-placeholder small {
    font-size: 0.8rem;
    color: #6c757d;
    font-style: italic;
    background: rgba(0, 123, 255, 0.1);
    padding: 4px 12px;
    border-radius: 20px;
    border: 1px solid rgba(0, 123, 255, 0.2);
}

/* Espacios publicitarios específicos */
.ad-header {
    margin: 10px 0 20px 0;
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    border-color: #ffc107;
}

.ad-header:hover {
    background: linear-gradient(135deg, #ffeaa7 0%, #fdcb6e 100%);
    border-color: #ff8c00;
}

.ad-between-news {
    margin: 30px 0;
    background: linear-gradient(135deg, #d1ecf1 0%, #bee5eb 100%);
    border-color: #17a2b8;
}

.ad-between-news:hover {
    background: linear-gradient(135deg, #bee5eb 0%, #a6e5ea 100%);
    border-color: #138496;
}

.ad-footer {
    margin: 20px 0 10px 0;
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    border-color: #28a745;
}

.ad-footer:hover {
    background: linear-gradient(135deg, #c3e6cb 0%, #b1dfbb 100%);
    border-color: #218838;
}

.ad-sidebar {
    position: sticky;
    top: 120px;
    margin-left: 20px;
    z-index: 50;
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    border-color: #dc3545;
}

.ad-sidebar:hover {
    background: linear-gradient(135deg, #f5c6cb 0%, #f1b0b7 100%);
    border-color: #c82333;
}

.ad-mobile {
    display: none;
}

/* ===== CONTENIDO DE ANUNCIOS REALES ===== */

/* Contenedor de anuncio real */
.ad-content {
    position: relative;
    width: 100%;
    height: 100%;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.ad-content:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

/* Enlace del anuncio */
.ad-link {
    display: block;
    width: 100%;
    height: 100%;
    text-decoration: none;
    color: inherit;
    position: relative;
    overflow: hidden;
    border-radius: 12px;
}

.ad-link:hover {
    text-decoration: none;
    color: inherit;
}

/* Imagen del anuncio */
.ad-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: all 0.3s ease;
    border-radius: 12px;
}

.ad-link:hover .ad-image {
    transform: scale(1.05);
}

/* Contenido de fallback cuando no carga la imagen */
.ad-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-align: center;
    border-radius: 12px;
}

.ad-fallback-content {
    padding: 20px;
}

.ad-fallback-content i {
    font-size: 2rem;
    margin-bottom: 10px;
    display: block;
}

.ad-fallback-content h4 {
    margin: 0 0 8px 0;
    font-size: 1.1rem;
    font-weight: 600;
}

.ad-fallback-content p {
    margin: 0;
    font-size: 0.9rem;
    opacity: 0.9;
}

/* Etiqueta "Publicidad" */
.ad-label {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 500;
    letter-spacing: 0.5px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 10;
}

/* Efectos de hover para el anuncio completo */
.ad-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 30%, rgba(255, 255, 255, 0.1) 50%, transparent 70%);
    transform: translateX(-100%);
    transition: transform 0.6s;
    z-index: 5;
    pointer-events: none;
}

.ad-content:hover::before {
    transform: translateX(100%);
}

/* Animaciones de entrada */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.ad-content {
    animation: fadeInUp 0.5s ease-out;
}

/* Efectos especiales para diferentes tipos de anuncios */
.ad-content[data-ad-type="premium"] {
    border: 2px solid #ffd700;
    box-shadow: 0 4px 16px rgba(255, 215, 0, 0.2);
}

.ad-content[data-ad-type="premium"]:hover {
    box-shadow: 0 6px 20px rgba(255, 215, 0, 0.3);
}

.ad-content[data-ad-type="standard"] {
    border: 2px solid #007bff;
    box-shadow: 0 4px 16px rgba(0, 123, 255, 0.2);
}

.ad-content[data-ad-type="standard"]:hover {
    box-shadow: 0 6px 20px rgba(0, 123, 255, 0.3);
}

/* Indicador de carga */
.ad-content.loading {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* ===== RESPONSIVE DESIGN ===== */

/* Desktop - Espacios publicitarios visibles */
@media (min-width: 769px) {
    .ad-space,
    .ad-space.ad-header,
    .ad-space.ad-between-news,
    .ad-space.ad-footer {
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
        margin: 25px 0 !important;
        background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%) !important;
        border: 2px solid #e9ecef !important;
        border-radius: 16px !important;
        justify-content: center !important;
        align-items: center !important;
        min-height: 100px !important;
        position: relative !important;
        z-index: 50 !important;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05) !important;
        transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1) !important;
    }
    
    .ad-container {
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
        width: 100% !important;
        max-width: 728px !important;
        height: 100px !important;
        align-items: center !important;
        justify-content: center !important;
        position: relative !important;
        z-index: 2 !important;
        padding: 15px !important;
    }
    
    .ad-placeholder {
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 8px !important;
        color: #6c757d !important;
        font-size: 1rem !important;
        text-align: center !important;
        padding: 20px !important;
        width: 100% !important;
        background: rgba(255, 255, 255, 0.8) !important;
        border-radius: 12px !important;
        backdrop-filter: blur(10px) !important;
        -webkit-backdrop-filter: blur(10px) !important;
    }
    
    .ad-placeholder i {
        font-size: 36px !important;
        color: #007bff !important;
        margin-bottom: 8px !important;
        filter: drop-shadow(0 2px 4px rgba(0, 123, 255, 0.3)) !important;
    }
    
    .ad-placeholder p {
        margin: 0 !important;
        font-weight: 700 !important;
        color: #333 !important;
        font-size: 1.1rem !important;
        letter-spacing: 0.5px !important;
    }
    
    .ad-placeholder small {
        font-size: 0.85rem !important;
        color: #6c757d !important;
        font-style: italic !important;
        background: rgba(0, 123, 255, 0.1) !important;
        padding: 6px 16px !important;
        border-radius: 20px !important;
        border: 1px solid rgba(0, 123, 255, 0.2) !important;
    }
}

/* Móviles - Espacios publicitarios más pequeños y modernos */
@media (max-width: 768px) {
    .ad-space {
        margin: 15px 0;
        min-height: 70px;
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
        border-radius: 12px !important;
        background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%) !important;
        border: 2px solid #e9ecef !important;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05) !important;
        z-index: 50 !important;
    }
    
    .ad-container {
        height: 70px;
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
        padding: 8px !important;
    }
    
    .ad-placeholder {
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
        padding: 12px !important;
        font-size: 0.85rem !important;
        background: rgba(255, 255, 255, 0.9) !important;
        border-radius: 8px !important;
        gap: 4px !important;
    }
    
    .ad-placeholder i {
        font-size: 24px !important;
        color: #007bff !important;
        filter: drop-shadow(0 1px 2px rgba(0, 123, 255, 0.3)) !important;
    }
    
    .ad-placeholder p {
        font-size: 0.9rem !important;
        font-weight: 600 !important;
        margin: 0 !important;
    }
    
    .ad-placeholder small {
        font-size: 0.75rem !important;
        background: rgba(0, 123, 255, 0.1) !important;
        padding: 3px 8px !important;
        border-radius: 12px !important;
        border: 1px solid rgba(0, 123, 255, 0.2) !important;
    }
    
    .ad-label {
        top: 6px;
        right: 6px;
        padding: 3px 6px;
        font-size: 0.65rem;
    }
    
    .ad-fallback-content {
        padding: 15px;
    }
    
    .ad-fallback-content i {
        font-size: 1.5rem;
        margin-bottom: 8px;
    }
    
    .ad-fallback-content h4 {
        font-size: 1rem;
        margin-bottom: 6px;
    }
    
    .ad-fallback-content p {
        font-size: 0.8rem;
    }
}

/* ===== SIDEBAR ESPECIAL PARA DESKTOP ===== */
@media (min-width: 1024px) {
    .ad-sidebar {
        position: fixed;
        top: 50%;
        right: 20px;
        transform: translateY(-50%);
        width: 300px;
        height: 250px;
        margin: 0;
        z-index: 50;
    }
    
    .ad-sidebar .ad-container {
        max-width: 300px;
        height: 250px;
    }
    
    .ad-sidebar .ad-placeholder {
        height: 250px;
    }
    
    .ad-sidebar .ad-placeholder i {
        font-size: 32px;
    }
    
    .ad-sidebar .ad-placeholder p {
        font-size: 1rem;
    }
}

/* Ocultar sidebar en móviles */
@media (max-width: 1023px) {
    .ad-sidebar {
        display: none;
    }
    
    .ad-mobile {
        display: block;
    }
}