/* Reset y Variables */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Modo Claro (Default) */
:root {
    --bg-primary: #f5f7fa;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f0f4f8;
    --text-primary: #1a202c;
    --text-secondary: #4a5568;
    --accent: #667eea;
    --accent-hover: #5568d3;
    --success: #48bb78;
    --warning: #ed8936;
    --danger: #f56565;
    --border: #e2e8f0;
    --shadow: rgba(102, 126, 234, 0.15);
    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-accent: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --body-gradient: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
}

/* Modo Oscuro */
[data-theme="dark"] {
    --bg-primary: #0f0f23;
    --bg-secondary: #1a1a2e;
    --bg-tertiary: #16213e;
    --text-primary: #eaeaea;
    --text-secondary: #b8b8b8;
    --accent: #4a90e2;
    --accent-hover: #357abd;
    --success: #4caf50;
    --warning: #ff9800;
    --danger: #f44336;
    --border: #2a2a3e;
    --shadow: rgba(0, 0, 0, 0.3);
    --gradient-primary: linear-gradient(135deg, #4a90e2 0%, #357abd 100%);
    --gradient-accent: linear-gradient(135deg, #4a90e2 0%, #357abd 100%);
    --body-gradient: linear-gradient(135deg, #0f0f23 0%, #1a1a2e 100%);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: var(--body-gradient);
    background-attachment: fixed;
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
    transition: background 0.3s ease, color 0.3s ease;
}

/* Navegación */
.navbar {
    background: var(--bg-secondary);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 1rem 0;
    box-shadow: 0 2px 10px var(--shadow);
    transition: background 0.3s ease, border-color 0.3s ease;
}

[data-theme="dark"] .navbar {
    background: rgba(26, 26, 46, 0.95);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--accent);
}

.nav-menu {
    display: flex;
    gap: 0.5rem;
}

.nav-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 0.5rem 1rem;
    cursor: pointer;
    border-radius: 12px;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    font-weight: 500;
}

.nav-btn:hover {
    background: var(--gradient-primary);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--shadow);
}

.nav-btn.active {
    background: var(--gradient-primary);
    color: white;
    box-shadow: 0 4px 15px var(--shadow);
}

.theme-selector {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.auth-buttons {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.auth-btn {
    padding: 0.5rem 1rem;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.login-btn {
    background: transparent;
    color: var(--text-primary);
    border: 2px solid var(--border);
}

.login-btn:hover {
    background: var(--bg-tertiary);
    border-color: var(--accent);
}

.register-btn {
    background: var(--gradient-primary);
    color: white;
    box-shadow: 0 2px 8px var(--shadow);
}

.register-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--shadow);
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-name {
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.95rem;
}

.logout-btn {
    background: var(--danger);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.85rem;
}

.logout-btn:hover {
    background: #e53e3e;
    transform: translateY(-1px);
}

.hidden {
    display: none !important;
}

.theme-btn {
    background: var(--bg-tertiary);
    border: 2px solid var(--border);
    border-radius: 8px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.2rem;
    transition: all 0.3s ease;
    padding: 0;
}

.theme-btn:hover {
    transform: scale(1.1);
    border-color: var(--accent);
    box-shadow: 0 4px 12px var(--shadow);
}

.theme-btn.active {
    background: var(--gradient-primary);
    border-color: var(--accent);
    box-shadow: 0 4px 15px var(--shadow);
}

.menu-toggle {
    display: none;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 1.5rem;
    cursor: pointer;
}

/* Secciones */
.section {
    display: none;
    min-height: calc(100vh - 80px);
    padding: 2rem 1rem;
    padding-right: 370px; /* Espacio para el chat sidebar */
    transition: padding 0.3s ease;
}

.section.active {
    display: block;
}

body:has(.chat-sidebar.collapsed) .section {
    padding-right: 1rem;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

h2 {
    font-size: 2rem;
    margin-bottom: 2rem;
    color: var(--accent);
}

/* Reloj */
.clock-container {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
    padding: 2rem;
}

.weather-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 3rem;
    padding: 1.5rem;
    background: var(--gradient-primary);
    border-radius: 20px;
    border: none;
    box-shadow: 0 10px 30px var(--shadow);
    color: white;
}

.weather-icon {
    font-size: 4rem;
}

.weather-details {
    text-align: left;
}

.temperature {
    font-size: 2.5rem;
    font-weight: bold;
    color: white;
}

.condition {
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.9);
    margin: 0.5rem 0;
}

.location {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.8);
}

.clock-display {
    margin: 2rem 0;
}

.time {
    font-size: 5rem;
    font-weight: 300;
    letter-spacing: 0.1em;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: none;
}

.date {
    font-size: 1.5rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.clock-theme {
    margin-top: 2rem;
    padding: 1rem;
    border-radius: 12px;
    min-height: 200px;
    transition: all 0.5s ease;
}

/* Aprendizaje */
.learning-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.learning-card, .game-card {
    background: var(--bg-secondary);
    border: 2px solid var(--border);
    border-radius: 16px;
    padding: 1.5rem;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.learning-card:hover, .game-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 40px rgba(102, 126, 234, 0.25);
    border-color: var(--accent);
    background: linear-gradient(135deg, #ffffff 0%, #f0f4f8 100%);
}

.learning-card h3, .game-card h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.game-level-info {
    margin: 0.75rem 0;
}

.level-badge {
    display: inline-block;
    background: var(--gradient-primary);
    color: white;
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    box-shadow: 0 2px 8px var(--shadow);
}

.learning-card p, .game-card p {
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.card-btn {
    background: var(--gradient-primary);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 12px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s ease;
    width: 100%;
    box-shadow: 0 4px 15px var(--shadow);
}

.card-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--shadow);
}

.learning-content {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 2rem;
    margin-top: 2rem;
}


/* Juegos */
.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.game-area {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 2rem;
    margin-top: 2rem;
    min-height: 400px;
}

/* Chat Integrado */
.chat-sidebar {
    position: fixed;
    right: 0;
    top: 80px;
    width: 350px;
    height: calc(100vh - 80px);
    background: var(--bg-secondary);
    border-left: 2px solid var(--border);
    display: flex;
    flex-direction: column;
    z-index: 100;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.chat-sidebar.collapsed {
    transform: translateY(calc(100% - 60px));
}

.chat-sidebar-header {
    padding: 1rem;
    border-bottom: 2px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-tertiary);
}

.chat-sidebar-header h3 {
    margin: 0;
    font-size: 1.1rem;
    color: var(--accent);
}

.chat-toggle-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.chat-toggle-btn:hover {
    background: var(--bg-secondary);
    color: var(--accent);
    transform: scale(1.1);
}

/* Botón flotante para abrir chat cuando está oculto */
.chat-float-btn {
    position: fixed;
    bottom: 1rem;
    right: 1rem;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--gradient-primary);
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 200;
    box-shadow: 0 4px 15px var(--shadow);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    opacity: 0;
    transform: scale(0);
    pointer-events: none;
}

.chat-float-btn.visible {
    opacity: 1;
    transform: scale(1);
    pointer-events: all;
}

.chat-float-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.chat-float-btn:active {
    transform: scale(0.95);
}

#chatFloatIcon {
    display: block;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

.chat-sidebar-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Chat */
.chat-container {
    max-width: 800px;
    margin: 0 auto;
    background: var(--bg-secondary);
    border: 2px solid var(--border);
    border-radius: 16px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 600px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    min-height: 0;
}

.message {
    padding: 0.75rem 1rem;
    border-radius: 12px;
    max-width: 70%;
    word-wrap: break-word;
}

.message.user {
    background: var(--gradient-primary);
    color: white;
    align-self: flex-end;
    margin-left: auto;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    box-shadow: 0 4px 15px var(--shadow);
}

.message.system {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    align-self: center;
    text-align: center;
    font-size: 0.9rem;
}

.chat-input-container {
    display: flex;
    padding: 1rem;
    border-top: 1px solid var(--border);
    gap: 0.5rem;
}

.chat-input {
    flex: 1;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 0.75rem;
    border-radius: 8px;
    font-size: 1rem;
}

.chat-input:focus {
    outline: none;
    border-color: var(--accent);
}

.send-btn {
    background: var(--gradient-primary);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 12px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px var(--shadow);
}

.send-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--shadow);
}

/* Salud */
.health-dashboard {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.health-card {
    background: var(--bg-secondary);
    border: 2px solid var(--border);
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.health-card:hover {
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.15);
    transform: translateY(-2px);
}

.health-card h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--accent);
}

.sleep-status {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    padding: 1rem;
    background: var(--bg-tertiary);
    border-radius: 8px;
}

.sleep-chart {
    height: 150px;
    background: var(--bg-tertiary);
    border-radius: 8px;
    margin-bottom: 1rem;
    display: flex;
    align-items: flex-end;
    padding: 1rem;
    gap: 0.5rem;
}

.health-btn {
    background: var(--gradient-primary);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 12px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    width: 100%;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px var(--shadow);
}

.health-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--shadow);
}

.stats {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    padding: 1rem;
    background: var(--bg-tertiary);
    border-radius: 8px;
}

.stat-label {
    color: var(--text-secondary);
}

.stat-value {
    color: var(--accent);
    font-weight: bold;
}

/* Notificaciones */
.notifications {
    position: fixed;
    top: 90px;
    right: 1rem;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.connection-status {
    position: fixed;
    bottom: 1rem;
    left: 1rem;
    background: var(--bg-secondary);
    border: 2px solid var(--border);
    border-radius: 12px;
    padding: 0.5rem 1rem;
    z-index: 2000;
    box-shadow: 0 4px 15px var(--shadow);
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.connection-status.offline {
    border-color: var(--warning);
    background: var(--bg-tertiary);
}

.connection-status.offline #connectionText {
    color: var(--warning);
}

.connection-status.api-offline {
    border-color: var(--warning);
    background: var(--bg-tertiary);
}

.connection-status.api-offline #connectionText {
    color: var(--warning);
}

.notification {
    background: var(--bg-secondary);
    border: 2px solid var(--border);
    border-left: 4px solid var(--accent);
    padding: 1rem;
    border-radius: 12px;
    min-width: 300px;
    box-shadow: 0 8px 25px var(--shadow);
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Pantalla Principal - Inicio */
.home-header {
    background: var(--bg-secondary);
    border-bottom: 2px solid var(--border);
    padding: 1rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    position: relative;
}

.header-lines {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex: 1;
}

.header-line {
    height: 3px;
    background: var(--gradient-primary);
    border-radius: 2px;
    width: 100%;
}

.header-line:nth-child(1) {
    width: 60%;
}

.header-line:nth-child(2) {
    width: 80%;
}

.header-line:nth-child(3) {
    width: 70%;
}

.header-content {
    flex: 1;
    display: flex;
    justify-content: center;
}

.header-time {
    font-size: 1.5rem;
    font-weight: 600;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header-circle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--gradient-accent);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 25px var(--shadow);
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    flex-shrink: 0;
}

.header-circle:hover {
    transform: scale(1.1) rotate(15deg);
    box-shadow: 0 12px 35px var(--shadow);
}

.circle-icon {
    font-size: 1.8rem;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.home-main-container {
    display: flex;
    gap: 2rem;
    padding: 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

.home-sidebar {
    width: 280px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.sidebar-section {
    background: var(--bg-secondary);
    border: 2px solid var(--border);
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.home-content {
    flex: 1;
    min-width: 0;
}

.weather-info-compact {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-direction: column;
    text-align: center;
}

.weather-icon-compact {
    font-size: 2.5rem;
}

.weather-details-compact {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.temperature-compact {
    font-size: 1.8rem;
    font-weight: bold;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.condition-compact {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

.clock-display-compact {
    text-align: center;
}

.time-compact {
    font-size: 2rem;
    font-weight: 300;
    letter-spacing: 0.05em;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
}

.date-compact {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-top: 0.5rem;
}

/* Formulario de Publicación */
.post-form-container {
    margin-bottom: 2rem;
}

.post-form {
    background: var(--bg-secondary);
    border: 2px solid var(--border);
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.post-form-header h3 {
    margin-bottom: 1rem;
    color: var(--accent);
    font-size: 1.2rem;
}

.post-input {
    width: 100%;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 1rem;
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    resize: vertical;
    min-height: 100px;
    margin-bottom: 1rem;
}

.post-input:focus {
    outline: none;
    border-color: var(--accent);
}

.post-form-actions {
    margin-bottom: 1rem;
    display: flex;
    gap: 0.5rem;
}

.media-upload-btn {
    background: var(--bg-tertiary);
    border: 2px dashed var(--border);
    border-radius: 8px;
    padding: 0.75rem 1.5rem;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--text-secondary);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
}

.media-upload-btn:hover {
    border-color: var(--accent);
    background: var(--bg-secondary);
    color: var(--accent);
}

.media-preview {
    margin-bottom: 1rem;
    position: relative;
}

.media-preview-item {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    border: 2px solid var(--border);
    background: var(--bg-tertiary);
}

.preview-media {
    width: 100%;
    max-height: 300px;
    object-fit: contain;
    display: block;
}

.remove-media-btn {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: var(--danger);
    color: white;
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.remove-media-btn:hover {
    transform: scale(1.1);
    background: var(--danger);
}

.post-form-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.char-count {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.post-btn {
    background: var(--gradient-primary);
    color: white;
    border: none;
    padding: 0.75rem 2rem;
    border-radius: 12px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px var(--shadow);
}

.post-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--shadow);
}

.post-btn:active {
    transform: translateY(0);
}

/* Feed de Publicaciones */
.posts-feed {
    margin-top: 2rem;
}

.feed-title {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: var(--accent);
}

.posts-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.post-card {
    background: var(--bg-secondary);
    border: 2px solid var(--border);
    border-radius: 16px;
    padding: 1.5rem;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.post-card:hover {
    border-color: var(--accent);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.2);
    transform: translateY(-2px);
}

.post-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.post-user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.post-avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: var(--gradient-primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.2rem;
    box-shadow: 0 4px 15px var(--shadow);
}

.post-user-details {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.post-username {
    font-weight: 600;
    color: var(--text-primary);
}

.post-time {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.post-delete-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
    line-height: 1;
}

.post-delete-btn:hover {
    background: var(--danger);
    color: white;
    transform: rotate(90deg);
}

.post-content {
    color: var(--text-primary);
    line-height: 1.6;
    margin-bottom: 1rem;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.post-media {
    margin-bottom: 1rem;
    border-radius: 12px;
    overflow: hidden;
    background: var(--bg-tertiary);
}

.post-image {
    width: 100%;
    max-height: 500px;
    object-fit: contain;
    display: block;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.post-image:hover {
    transform: scale(1.02);
}

.post-video {
    width: 100%;
    max-height: 500px;
    display: block;
    border-radius: 12px;
}

.post-footer {
    display: flex;
    align-items: center;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.post-like-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    transition: all 0.3s ease;
    font-size: 1rem;
}

.post-like-btn:hover {
    background: linear-gradient(135deg, #fef5e7 0%, #fdebd0 100%);
    color: var(--danger);
    transform: scale(1.05);
}

.like-icon {
    font-size: 1.2rem;
}

.like-count {
    font-size: 0.9rem;
}

.empty-posts {
    text-align: center;
    padding: 3rem;
    background: var(--bg-secondary);
    border: 2px dashed var(--border);
    border-radius: 16px;
    color: var(--text-secondary);
}

.empty-posts p:first-child {
    font-size: 1.2rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

/* Modales de Autenticación */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3000;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.modal-content {
    background: var(--bg-secondary);
    border-radius: 16px;
    padding: 2rem;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.modal-header h2 {
    margin: 0;
    color: var(--accent);
    font-size: 1.5rem;
}

.modal-close {
    background: transparent;
    border: none;
    font-size: 2rem;
    color: var(--text-secondary);
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: var(--bg-tertiary);
    color: var(--danger);
    transform: rotate(90deg);
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    color: var(--text-primary);
    font-size: 0.9rem;
    font-weight: 500;
}

.form-input {
    padding: 0.75rem;
    border: 2px solid var(--border);
    border-radius: 8px;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-input:focus {
    outline: none;
    border-color: var(--accent);
    background: var(--bg-secondary);
}

.form-btn {
    background: var(--gradient-primary);
    color: white;
    border: none;
    padding: 0.75rem;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 0.5rem;
    box-shadow: 0 4px 15px var(--shadow);
}

.form-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--shadow);
}

/* Responsive */
@media (max-width: 768px) {
    .section {
        padding-right: 1rem;
    }

    .chat-sidebar {
        width: 100%;
        height: calc(100vh - 80px);
        transform: translateY(100%);
        top: 80px;
        right: 0;
    }

    .chat-sidebar.collapsed {
        transform: translateY(calc(100% - 60px));
    }

    .chat-sidebar:not(.collapsed) {
        transform: translateY(0);
    }
    
    .chat-float-btn {
        bottom: 1rem;
        right: 1rem;
    }

    .auth-buttons {
        flex-direction: column;
        gap: 0.5rem;
        width: 100%;
    }

    .auth-btn {
        width: 100%;
        font-size: 0.85rem;
        padding: 0.6rem 1rem;
    }

    .user-menu {
        flex-direction: column;
        gap: 0.5rem;
        width: 100%;
        align-items: flex-start;
    }

    .logout-btn {
        width: 100%;
    }

    .home-main-container {
        flex-direction: column;
        padding: 1rem;
    }

    .home-sidebar {
        width: 100%;
    }

    .home-header {
        padding: 1rem;
        flex-wrap: wrap;
    }

    .header-circle {
        width: 50px;
        height: 50px;
    }

    .circle-icon {
        font-size: 1.5rem;
    }

    .theme-selector {
        order: -1;
        width: 100%;
        justify-content: center;
        margin-bottom: 0.5rem;
    }

    .post-form-footer {
        flex-direction: column;
        gap: 0.5rem;
        align-items: stretch;
    }

    .post-btn {
        width: 100%;
    }
    .nav-menu {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--bg-secondary);
        flex-direction: column;
        padding: 1rem;
        border-top: 1px solid var(--border);
    }

    .nav-menu.active {
        display: flex;
    }

    .menu-toggle {
        display: block;
    }

    .time {
        font-size: 3rem;
    }

    .weather-info {
        flex-direction: column;
        text-align: center;
    }

    .weather-details {
        text-align: center;
    }

    .chat-container {
        height: 500px;
    }

    .learning-grid, .games-grid {
        grid-template-columns: 1fr;
    }
}

/* Temas del reloj según clima */
.clock-theme.sunny {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    box-shadow: 0 10px 30px rgba(245, 87, 108, 0.3);
}

.clock-theme.rainy {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    box-shadow: 0 10px 30px rgba(79, 172, 254, 0.3);
}

.clock-theme.cloudy {
    background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
    box-shadow: 0 10px 30px rgba(168, 237, 234, 0.3);
}

.clock-theme.night {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
}

.clock-theme.snowy {
    background: linear-gradient(135deg, #e0c3fc 0%, #8ec5fc 100%);
    box-shadow: 0 10px 30px rgba(142, 197, 252, 0.3);
}

