/**
 * Layout Responsive CSS - Diseño Elite Mundial
 * Sistema de layout adaptativo profesional para redes sociales
 * 
 * @author MrGreen Development Team
 * @version 3.0.0
 * @since 2025-01-19
 */

/* ===== RESET Y BASE ===== */
* {
    box-sizing: border-box;
}

.container-fluid {
    padding: 0;
    width: 100%;
}

.container-fluid .row {
    margin: 0;
    display: flex;
    flex-wrap: nowrap;
    min-height: calc(100vh - 60px);
    width: 100%;
}

/* ===== SOBRESCRIBIR BOOTSTRAP ===== */
.row > * {
    flex-shrink: 0 !important;
    width: auto !important;
    max-width: none !important;
    padding-right: 0 !important;
    padding-left: 0 !important;
    margin-top: 0 !important;
}

.sidebar-column,
.right-panel-column {
    flex-shrink: 0 !important;
    width: auto !important;
    max-width: none !important;
    padding-right: 0 !important;
    padding-left: 0 !important;
    margin-top: 0 !important;
}

/* ===== SIDEBAR ===== */
.sidebar-column {
    background: #ffffff;
    border-right: 1px solid #e1e5e9;
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.04);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 100;
    position: fixed !important;
    left: 0 !important;
    top: 60px !important;
    height: calc(100vh - 60px) !important;
    width: 16rem !important; /* 256px exactos */
    min-width: 16rem !important;
    max-width: 16rem !important;
    flex: none !important;
    padding: 0 !important;
    margin: 0 !important;
    overflow-y: auto;
}

/* ===== SIDEBAR MODULE DENTRO DEL SIDEBAR COLUMN ===== */
.sidebar-column .sidebar-module {
    position: relative !important;
    top: 0 !important;
    left: 0 !important;
    height: 100% !important;
    width: 100% !important;
    z-index: auto !important;
}

/* ===== CONTENIDO PRINCIPAL ===== */
.content-column {
    background: #f8f9fa;
    flex: 1;
    min-height: calc(100vh - 60px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    margin-left: 16rem; /* Espacio para el sidebar fijo */
    margin-right: 22rem; /* Espacio para el panel derecho fijo */
}

/* Eliminar padding superior cuando contiene perfil de usuario */
.content-column:has(.profile-elite),
.content-column .profile-elite {
    padding-top: 0 !important;
}

/* ===== PANEL DERECHO ===== */
.right-panel-column {
    background: #ffffff;
    border-left: 1px solid #e1e5e9;
    box-shadow: -2px 0 8px rgba(0, 0, 0, 0.04);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 100;
    position: fixed !important;
    right: 0 !important;
    top: 60px !important;
    height: calc(100vh - 60px) !important;
    width: 22rem !important; /* 352px - Un poco más ancho */
    min-width: 22rem !important;
    max-width: 22rem !important;
    flex: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

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

/* MÓVILES (0-767px) - Solo contenido centrado */
@media (max-width: 767px) {
    .container-fluid .row {
        flex-direction: column;
        padding: 0;
    }
    
    .sidebar-column {
        display: none !important;
    }
    
    .right-panel-column {
        display: none !important;
    }
    
    .content-column {
        width: 100% !important;
        max-width: 100% !important;
        flex: none !important;
        padding: 16px;
        margin: 0 !important;
        background: #ffffff;
    }
    
    .content-column:has(.profile-elite) {
        padding-top: 0 !important;
    }
}

/* TABLETS (768px-1023px) - Sidebar + Contenido */
@media (min-width: 768px) and (max-width: 1023px) {
    .container-fluid .row {
        flex-direction: row;
    }
    
    .sidebar-column {
        position: fixed !important;
        left: 0 !important;
        top: 60px !important;
        height: calc(100vh - 60px) !important;
        width: 16rem !important;
        display: block !important;
    }
    
    .right-panel-column {
        display: none !important;
    }
    
    .content-column {
        flex: 1;
        padding: 24px;
        background: #f8f9fa;
        margin-left: 16rem !important;
        margin-right: 0 !important;
    }
    
    .content-column:has(.profile-elite) {
        padding-top: 0 !important;
    }
}

/* TABLETS GRANDES (1024px-1199px) - Sidebar + Contenido */
@media (min-width: 1024px) and (max-width: 1199px) {
    .container-fluid .row {
        flex-direction: row;
    }
    
    .sidebar-column {
        position: fixed !important;
        left: 0 !important;
        top: 60px !important;
        height: calc(100vh - 60px) !important;
        width: 16rem !important;
        display: block !important;
    }
    
    .right-panel-column {
        display: none !important;
    }
    
    .content-column {
        flex: 1;
        padding: 32px;
        background: #f8f9fa;
        margin-left: 16rem !important;
        margin-right: 0 !important;
    }
    
    .content-column:has(.profile-elite) {
        padding-top: 0 !important;
    }
}

/* COMPUTADORAS (1200px-1439px) - Layout completo */
@media (min-width: 1200px) and (max-width: 1439px) {
    .container-fluid .row {
        flex-direction: row;
        max-width: 1400px;
        margin: 0 auto;
    }
    
    .sidebar-column {
        position: fixed !important;
        left: 0 !important;
        top: 60px !important;
        height: calc(100vh - 60px) !important;
        width: 16rem !important;
        display: block !important;
    }
    
    .content-column {
        flex: 1;
        padding: 32px;
        background: #f8f9fa;
        max-width: calc(100% - 38rem);
        margin-left: 16rem !important;
        margin-right: 22rem !important;
    }
    
    .content-column:has(.profile-elite) {
        padding-top: 0 !important;
    }
    
    .right-panel-column {
        position: fixed !important;
        right: 0 !important;
        top: 60px !important;
        height: calc(100vh - 60px) !important;
        width: 22rem !important;
        display: block !important;
    }
}

/* PANTALLAS GRANDES (1440px+) - Layout optimizado */
@media (min-width: 1440px) {
    .container-fluid .row {
        flex-direction: row;
        max-width: 1600px;
        margin: 0 auto;
    }
    
    .sidebar-column {
        position: fixed !important;
        left: 0 !important;
        top: 60px !important;
        height: calc(100vh - 60px) !important;
        width: 16rem !important;
        display: block !important;
    }
    
    .content-column {
        flex: 1;
        padding: 40px;
        background: #f8f9fa;
        max-width: calc(100% - 38rem);
        margin-left: 16rem !important;
        margin-right: 22rem !important;
    }
    
    .content-column:has(.profile-elite) {
        padding-top: 0 !important;
    }
    
    .right-panel-column {
        position: fixed !important;
        right: 0 !important;
        top: 60px !important;
        height: calc(100vh - 60px) !important;
        width: 22rem !important;
        display: block !important;
    }
}

/* ===== CUANDO NO HAY SIDEBAR ===== */
.no-sidebar .content-column {
    flex: 1 !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
}

.no-sidebar .right-panel-column {
    display: none !important;
}

/* ===== DARK MODE ===== */
.dark-mode .sidebar-column {
  background-color: #0F0F0F !important;
  background: #0F0F0F !important;
  border-right-color: #333333;
}

.dark-mode .content-column {
    background: #0f0f0f;
}

.dark-mode .right-panel-column {
    background: #1a1a1a;
    border-left-color: #333333;
}

/* ===== ANIMACIONES SUAVES ===== */
.sidebar-column,
.content-column,
.right-panel-column {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== UTILIDADES ===== */
.hidden-mobile {
    display: block;
}

.hidden-tablet {
    display: block;
}

.hidden-desktop {
    display: none;
}

@media (max-width: 767px) {
    .hidden-mobile {
        display: none !important;
    }
}

@media (min-width: 768px) and (max-width: 1199px) {
    .hidden-tablet {
        display: none !important;
    }
}

@media (min-width: 1200px) {
    .hidden-desktop {
        display: none !important;
    }
}

/* ===== SCROLL SUAVE ===== */
.content-column {
    overflow-y: auto;
    scroll-behavior: smooth;
}

/* ===== SOMBRAS PROFESIONALES ===== */
.sidebar-column {
    box-shadow: 2px 0 12px rgba(0, 0, 0, 0.08);
}

.right-panel-column {
    box-shadow: -2px 0 12px rgba(0, 0, 0, 0.08);
}

/* ===== BORDES SUAVES ===== */
.sidebar-column,
.right-panel-column {
    border-radius: 0;
}

/* ===== RESPONSIVE TYPOGRAPHY ===== */
@media (max-width: 767px) {
    .content-column {
        font-size: 14px;
        line-height: 1.5;
    }
}

@media (min-width: 768px) {
    .content-column {
        font-size: 16px;
        line-height: 1.6;
    }
}

/* ===== FOCUS STATES ===== */
.sidebar-column:focus-within,
.right-panel-column:focus-within {
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.5);
}

/* ===== PRINT STYLES ===== */
@media print {
    .sidebar-column,
    .right-panel-column {
        display: none !important;
    }
    
    .content-column {
        width: 100% !important;
        max-width: 100% !important;
        flex: none !important;
        margin: 0 !important;
        padding: 0 !important;
    }
}