/* =========================================================
   Ad Grid Manager — Frontend Styles
   ========================================================= */

/* Contenedor principal de la grilla */
.agm-grid-wrapper {
    display: grid;
    width: 100%;
    box-sizing: border-box;
}

/* Cada tarjeta de anuncio */
.agm-ad-item {
    position: relative;
    box-sizing: border-box;
    background: #fff;
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

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

/* Envuelve la imagen + overlay */
.agm-ad-image-wrap {
    position: relative;
    overflow: hidden;
    flex: 1;
    line-height: 0;
}

.agm-ad-img {
    width: 100%;
    height: auto;
    display: block;
    transition: filter 0.35s ease;
}

/* ── Estado DESACTIVADO ──────────────────────────────── */
.agm-disabled .agm-ad-img {
    filter: grayscale(100%) blur(3px);
}

.agm-disabled-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.30);
    z-index: 2;
}

.agm-disabled-overlay span {
    font-size: 1.1rem;
    font-weight: 700;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    text-shadow: 0 2px 8px rgba(0,0,0,0.6);
    background: rgba(0,0,0,0.45);
    padding: 6px 18px;
    border-radius: 4px;
}

/* Nombre del anunciante */
.agm-ad-name {
    font-size: 0.88rem;
    font-weight: 600;
    color: #333;
    margin: 8px 0 0;
    line-height: 1.3;
    text-align: center;
}

/* ── Controles de toggle ─────────────────────────────── */
.agm-ad-controls {
    display: flex;
    justify-content: center;
    margin-top: 8px;
}

.agm-toggle-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    border: none;
    cursor: pointer;
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.04em;
    line-height: 1;
    transition: opacity 0.2s ease, transform 0.1s ease;
    background: #222;
    color: #fff;
    padding: 6px 14px;
    border-radius: 4px;
}

.agm-toggle-btn:hover  { opacity: 0.82; }
.agm-toggle-btn:active { transform: scale(0.97); }

.agm-deactivate-btn { background: #c0392b; }
.agm-deactivate-btn:hover { background: #a93226; }

.agm-activate-btn   { background: #27ae60; }
.agm-activate-btn:hover { background: #229954; }

/* Etiqueta para editores (sin botón de activar) */
.agm-toggle-label {
    font-size: 11px;
    font-style: italic;
    color: #888;
}

/* Sin imagen */
.agm-no-image {
    width: 100%;
    padding: 40px 0;
    background: #f0f0f0;
    color: #aaa;
    text-align: center;
    font-size: 0.8rem;
}

/* Mensaje de parrilla vacía */
.agm-empty {
    color: #888;
    font-style: italic;
    text-align: center;
    padding: 20px;
}

/* ── Spinner (AJAX loading) ─────────────────────────── */
.agm-spinner {
    display: inline-block;
    width: 12px;
    height: 12px;
    border: 2px solid rgba(255,255,255,0.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: agm-spin 0.6s linear infinite;
    vertical-align: middle;
}

@keyframes agm-spin {
    to { transform: rotate(360deg); }
}
