/**
 * Layout base para Desperta
 * Usado en todas las paginas para consistencia
 */

/* Variables */
:root {
    --color-fondo: #0a0a0f;
    --color-texto: #eaeaea;
    --color-texto-secundario: #888;
    --color-acento: #e94560;
    --color-tarjeta: #12121a;
    --color-borde: #2a2a3a;
    --sidebar-width: 240px;
    --content-max-width: 680px;
}

/* Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Space Grotesk', -apple-system, sans-serif;
    background: var(--color-fondo);
    color: var(--color-texto);
    min-height: 100vh;
    line-height: 1.6;
}

/* Container principal */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar fijo */
.sidebar {
    width: var(--sidebar-width);
    min-width: var(--sidebar-width);
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    background: var(--color-tarjeta);
    border-right: 1px solid var(--color-borde);
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    z-index: 100;
}

.sidebar-logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-acento);
    text-decoration: none;
    margin-bottom: 30px;
    display: block;
}

.sidebar-nav {
    flex: 1;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    color: var(--color-texto-secundario);
    text-decoration: none;
    border-radius: 10px;
    margin-bottom: 5px;
    transition: all 0.2s;
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
    background: rgba(233, 69, 96, 0.1);
    color: var(--color-texto);
}

.sidebar-nav a.active {
    color: var(--color-acento);
}

.sidebar-section {
    margin-top: 25px;
    padding-top: 15px;
    border-top: 1px solid var(--color-borde);
}

.sidebar-section-title {
    font-size: 0.75rem;
    color: var(--color-texto-secundario);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 10px;
    padding-left: 15px;
}

.sidebar-footer {
    padding-top: 20px;
    border-top: 1px solid var(--color-borde);
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border-radius: 10px;
    text-decoration: none;
    color: var(--color-texto);
}

.sidebar-user:hover {
    background: rgba(255,255,255,0.05);
}

.user-avatar {
    width: 36px;
    height: 36px;
    background: var(--color-acento);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: white;
    flex-shrink: 0;
}

.user-name {
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Contenido principal - CENTRADO */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 30px;
    display: flex;
    justify-content: center;
}

.content-wrapper {
    width: 100%;
    max-width: var(--content-max-width);
}

/* Alternativa: sin sidebar (paginas publicas) */
.main-content.no-sidebar {
    margin-left: 0;
}

/* Header de pagina */
.page-header {
    margin-bottom: 30px;
}

.page-title {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.page-subtitle {
    color: var(--color-texto-secundario);
}

/* Cards/Posts */
.card {
    background: var(--color-tarjeta);
    border: 1px solid var(--color-borde);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 16px;
}

.post {
    background: var(--color-tarjeta);
    border: 1px solid var(--color-borde);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 16px;
}

.post-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.post-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--color-acento);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: white;
    flex-shrink: 0;
}

.post-meta {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
}

.post-author {
    font-weight: 600;
    color: var(--color-texto);
}

.post-author a {
    color: inherit;
    text-decoration: none;
}

.post-author a:hover {
    color: var(--color-acento);
}

.post-time {
    font-size: 13px;
    color: var(--color-texto-secundario);
}

.post-badge {
    display: inline-block;
    padding: 2px 8px;
    background: rgba(233, 69, 96, 0.2);
    color: var(--color-acento);
    border-radius: 10px;
    font-size: 11px;
    margin-left: 8px;
}

.post-content {
    color: var(--color-texto);
    line-height: 1.7;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.post-actions {
    display: flex;
    gap: 20px;
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid var(--color-borde);
}

.post-action {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--color-texto-secundario);
    cursor: pointer;
    font-size: 14px;
    background: none;
    border: none;
    padding: 0;
    font-family: inherit;
}

.post-action:hover {
    color: var(--color-acento);
}

/* Composer */
.composer {
    background: var(--color-tarjeta);
    border: 1px solid var(--color-borde);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 25px;
}

.composer textarea {
    width: 100%;
    background: transparent;
    border: none;
    color: var(--color-texto);
    font-family: inherit;
    font-size: 1rem;
    resize: none;
    outline: none;
    line-height: 1.6;
}

.composer-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid var(--color-borde);
}

/* Botones */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 10px;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background: var(--color-acento);
    color: white;
}

.btn-primary:hover {
    background: #d63850;
}

.btn-secondary {
    background: transparent;
    color: var(--color-texto);
    border: 1px solid var(--color-borde);
}

.btn-secondary:hover {
    border-color: var(--color-texto-secundario);
}

/* Banner de bienvenida */
.welcome-banner {
    background: var(--color-tarjeta);
    border: 1px solid var(--color-borde);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 24px;
    text-align: center;
}

.welcome-banner h2 {
    margin-bottom: 8px;
}

.welcome-banner p {
    color: var(--color-texto-secundario);
}

/* Boton hamburguesa para movil */
.menu-toggle {
    display: none;
    position: fixed;
    top: 16px;
    left: 16px;
    z-index: 1001;
    width: 40px;
    height: 40px;
    background: var(--color-tarjeta);
    border: 1px solid var(--color-borde);
    border-radius: 10px;
    cursor: pointer;
    align-items: center;
    justify-content: center;
}

.menu-toggle span {
    display: block;
    width: 20px;
    height: 2px;
    background: var(--color-texto);
    margin: 4px auto;
}

/* Overlay para movil */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99;
}

/* RESPONSIVE */
@media (max-width: 900px) {
    .main-content {
        padding: 20px;
    }
}

@media (max-width: 768px) {
    .menu-toggle {
        display: flex;
    }
    
    .sidebar {
        left: -260px;
        transition: left 0.3s ease;
        z-index: 200;
    }
    
    .sidebar.open {
        left: 0;
    }
    
    .sidebar-overlay.visible {
        display: block;
    }
    
    .main-content {
        margin-left: 0;
        padding: 70px 16px 20px;
    }
    
    .content-wrapper {
        max-width: 100%;
    }
    
    .post-actions {
        flex-wrap: wrap;
        gap: 15px;
    }
}

@media (max-width: 480px) {
    .main-content {
        padding: 60px 12px 16px;
    }
    
    .post {
        padding: 16px;
        border-radius: 12px;
    }
    
    .composer {
        padding: 16px;
    }
}

/* Loading spinner */
.loading {
    text-align: center;
    padding: 40px;
    color: var(--color-texto-secundario);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--color-borde);
    border-top-color: var(--color-acento);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

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

/* Empty state */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--color-texto-secundario);
}

.empty-state h3 {
    color: var(--color-texto);
    margin-bottom: 10px;
}
