/**
 * Sidebars CSS - InkaBox Express
 * Estilos para las barras laterales del CMS
 */

/* Contenedores principales de sidebars */
.sidebar-ads-container {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    width: 150px;
    max-height: 80vh;
    overflow-y: auto;
    z-index: 9999;
    transition: all 0.3s ease;
}

.sidebar-ads-container.left {
    left: 25px;
}

.sidebar-ads-container.right {
    right: 25px;
}

/* Contenido del sidebar */
.sidebar-content {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* Elementos individuales del sidebar */
.sidebar-item {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: all 0.3s ease;
}

.sidebar-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

/* Títulos de sidebar */
.sidebar-title {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    margin: 0;
    padding: 8px 12px;
    font-size: 12px;
    font-weight: 600;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Banners con imagen */
.sidebar-banner {
    display: block;
}

.sidebar-banner a {
    display: block;
    text-decoration: none;
}

.sidebar-banner img {
    width: 100%;
    height: auto;
    display: block;
    transition: all 0.3s ease;
}

.sidebar-banner:hover img {
    transform: scale(1.05);
}

/* Contenido HTML */
.sidebar-html {
    padding: 15px;
    font-size: 13px;
    line-height: 1.4;
    color: #333;
}

.sidebar-html h1,
.sidebar-html h2,
.sidebar-html h3,
.sidebar-html h4,
.sidebar-html h5,
.sidebar-html h6 {
    margin: 0 0 8px 0;
    font-size: 14px;
    color: #667eea;
}

.sidebar-html p {
    margin: 0 0 8px 0;
}

.sidebar-html a {
    color: #667eea;
    text-decoration: none;
}

.sidebar-html a:hover {
    text-decoration: underline;
}

/* Códigos de anuncio */
.sidebar-ad {
    padding: 10px;
    text-align: center;
}

.sidebar-ad iframe,
.sidebar-ad img {
    max-width: 100%;
    height: auto;
}

/* Scrollbar personalizado */
.sidebar-ads-container::-webkit-scrollbar {
    width: 4px;
}

.sidebar-ads-container::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 2px;
}

.sidebar-ads-container::-webkit-scrollbar-thumb {
    background: rgba(102, 126, 234, 0.5);
    border-radius: 2px;
}

.sidebar-ads-container::-webkit-scrollbar-thumb:hover {
    background: rgba(102, 126, 234, 0.8);
}

/* Responsive Design */
@media (max-width: 1400px) {
    .sidebar-ads-container {
        width: 140px;
    }
    
    .sidebar-ads-container.left {
        left: 5px;
    }
    
    .sidebar-ads-container.right {
        right: 5px;
    }
}

@media (max-width: 1200px) {
    .sidebar-ads-container {
        width: 120px;
    }
    
    .sidebar-title {
        font-size: 11px;
        padding: 6px 8px;
    }
    
    .sidebar-html {
        padding: 10px;
        font-size: 12px;
    }
}

@media (max-width: 1024px) {
    .sidebar-ads-container {
        display: none !important;
    }
}

/* Animaciones de entrada */
@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-100%) translateY(-50%);
    }
    to {
        opacity: 1;
        transform: translateX(0) translateY(-50%);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100%) translateY(-50%);
    }
    to {
        opacity: 1;
        transform: translateX(0) translateY(-50%);
    }
}

.sidebar-ads-container.left {
    animation: slideInLeft 0.5s ease-out;
}

.sidebar-ads-container.right {
    animation: slideInRight 0.5s ease-out;
}

/* Estados especiales */
.sidebar-item[data-type="banner"] {
    border: 2px solid transparent;
}

.sidebar-item[data-type="banner"]:hover {
    border-color: #667eea;
}

.sidebar-item[data-type="html"] {
    border-left: 3px solid #28a745;
}

.sidebar-item[data-type="ad"] {
    border-left: 3px solid #ffc107;
}

/* Efectos de hover mejorados */
.sidebar-item {
    position: relative;
    overflow: hidden;
}

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

.sidebar-item:hover::before {
    left: 100%;
}

/* Indicadores de tipo de contenido */
.sidebar-item[data-type="banner"]::after {
    content: '\f03e'; /* fa-image */
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    top: 5px;
    right: 5px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    z-index: 2;
    opacity: 0;
    transition: opacity 0.3s;
}

.sidebar-item[data-type="html"]::after {
    content: '\f121'; /* fa-code */
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    top: 5px;
    right: 5px;
    background: rgba(40, 167, 69, 0.9);
    color: white;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    z-index: 2;
    opacity: 0;
    transition: opacity 0.3s;
}

.sidebar-item[data-type="ad"]::after {
    content: '\f0ad'; /* fa-bullhorn */
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    top: 5px;
    right: 5px;
    background: rgba(255, 193, 7, 0.9);
    color: white;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    z-index: 2;
    opacity: 0;
    transition: opacity 0.3s;
}

.sidebar-item:hover::after {
    opacity: 1;
}

/* Mejoras de accesibilidad */
.sidebar-item:focus-within {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

.sidebar-banner a:focus {
    outline: none;
}

/* Modo oscuro (opcional) */
@media (prefers-color-scheme: dark) {
    .sidebar-item {
        background: #2d3748;
        color: #e2e8f0;
    }
    
    .sidebar-html {
        color: #e2e8f0;
    }
    
    .sidebar-html h1,
    .sidebar-html h2,
    .sidebar-html h3,
    .sidebar-html h4,
    .sidebar-html h5,
    .sidebar-html h6 {
        color: #90cdf4;
    }
}