/**
 * DEVBox|WARE - Estilos Principales
 * Sistema de diseño tipo VSCode con PWA (SIN user-info)
 * 
 * @version 2.1
 * @author DEVBoxWARE Team
 */

/* Variables CSS */
:root {
    --vscode-bg: #1e1e1e;
    --vscode-sidebar: #252526;
    --vscode-editor: #1e1e1e;
    --vscode-border: #3c3c3c;
    --vscode-text: #d4d4d4;
    --vscode-text-secondary: #9d9d9d;
    --vscode-accent: #007acc;
    --vscode-accent-hover: #1177bb;
    --vscode-success: #007acc;
    --vscode-warning: #dcdcaa;
    --vscode-error: #f14c4c;
    --vscode-activity-bar: #333333;
    --vscode-tab-inactive: #2d2d30;
    --vscode-scrollbar: #424242;
    
    /* Variables dinámicas para viewport */
    --actual-vh: 1vh;
    --actual-vw: 1vw;
    --sidebar-height: calc(100vh - 56px - 22px);
}

/* Reset y configuración base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--vscode-bg);
    color: var(--vscode-text);
    height: 100vh;
    overflow: hidden;
    padding-bottom: 22px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    -webkit-text-size-adjust: 100%;
}

/* Header con hamburger menu - Optimizado para touch */
.mobile-header {
    display: flex;
    height: 56px;
    background-color: var(--vscode-activity-bar);
    border-bottom: 1px solid var(--vscode-border);
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1001;
}

.hamburger-menu {
    background: none;
    border: none;
    color: var(--vscode-text);
    font-size: 20px;
    cursor: pointer;
    padding: 12px;
    border-radius: 8px;
    transition: all 0.2s ease;
    min-height: 44px;
    min-width: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-tap-highlight-color: rgba(255, 255, 255, 0.1);
    touch-action: manipulation;
}

.hamburger-menu:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--vscode-accent);
}

.hamburger-menu:active {
    background-color: rgba(255, 255, 255, 0.2);
    transform: scale(0.95);
}

.mobile-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--vscode-text);
    display: flex;
    align-items: center;
    flex: 1;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Botones PWA */
.btn {
    background: var(--vscode-accent);
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    min-height: 36px;
    white-space: nowrap;
}

.btn:hover {
    background: var(--vscode-accent-hover);
    transform: translateY(-1px);
}

.btn:active {
    transform: translateY(0);
}

.install-btn {
    background: var(--vscode-success);
    animation: pulse 2s infinite;
}

.update-btn {
    background: var(--vscode-warning);
    color: var(--vscode-bg);
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(78, 201, 176, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(78, 201, 176, 0); }
    100% { box-shadow: 0 0 0 0 rgba(78, 201, 176, 0); }
}

/* Estado PWA */
.pwa-status {
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 4px;
    background: var(--vscode-success);
    color: white;
    display: none;
}

.pwa-status.installed {
    display: inline-block;
}

.pwa-status.installed::after {
    content: "PWA";
}

/* Indicador de conexión */
.connection-status {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: all 0.3s ease;
}

.connection-status.online {
    color: white;
}

.connection-status.offline {
    background: var(--vscode-warning);
    color: var(--vscode-bg);
}

.connection-status.offline i::before {
    content: "\f127"; /* wifi-slash icon */
}

/* Layout principal - Ajustado para header fijo */
.vscode-container {
    display: flex;
    height: calc(100vh - 56px - 22px);
    position: relative;
    margin-top: 56px;
}

/* Activity Bar - Optimizado para touch */
.activity-bar {
    width: 56px;
    background-color: var(--vscode-activity-bar);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px 0;
    border-right: 1px solid var(--vscode-border);
    z-index: 50;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: fixed;
    top: 56px;
    left: 0;
    height: calc(100vh - 56px - 22px);
    bottom: 22px;
}

.activity-bar.hidden {
    transform: translateX(-100%);
}

.activity-item {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
    cursor: pointer;
    color: var(--vscode-text-secondary);
    transition: all 0.2s ease;
    border-radius: 8px;
    position: relative;
    -webkit-tap-highlight-color: rgba(255, 255, 255, 0.1);
    touch-action: manipulation;
    font-size: 16px;
}

.activity-item:hover {
    color: var(--vscode-text);
    background-color: rgba(255, 255, 255, 0.1);
}

.activity-item:active {
    background-color: rgba(255, 255, 255, 0.2);
    transform: scale(0.95);
}

.activity-item.active {
    color: var(--vscode-text);
    background-color: var(--vscode-accent);
}

.activity-item.active::before {
    content: '';
    position: absolute;
    left: -12px;
    width: 3px;
    height: 60%;
    background-color: var(--vscode-text);
    border-radius: 2px;
}

/* Sidebar - ACTUALIZADO: Sin user-info, solo 2 áreas */
.sidebar {
    width: fit-content;
    background-color: var(--vscode-sidebar);
    border-right: 1px solid var(--vscode-border);
    display: grid;
    grid-template-rows: auto 1fr;
    grid-template-areas: 
        "header"
        "content";
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: fixed;
    top: 56px;
    left: 56px;
    min-height: var(--sidebar-height);
    max-height: var(--sidebar-height);
    overflow: hidden;
    z-index: 49;
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.3);
}

.sidebar.hidden {
    transform: translateX(-100%);
}

.sidebar-header {
    grid-area: header;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--vscode-text-secondary);
    border-bottom: 1px solid var(--vscode-border);
    flex-shrink: 0;
    white-space: nowrap;
}

.sidebar-close {
    display: block;
    background: none;
    border: none;
    color: var(--vscode-text-secondary);
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
    transition: all 0.2s ease;
    min-height: 32px;
    min-width: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-tap-highlight-color: rgba(255, 255, 255, 0.1);
    touch-action: manipulation;
}

.sidebar-close:hover {
    color: var(--vscode-text);
    background-color: rgba(255, 255, 255, 0.1);
}

.sidebar-close:active {
    background-color: rgba(255, 255, 255, 0.2);
    transform: scale(0.9);
}

.sidebar-content {
    grid-area: content;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 6px;
    scroll-behavior: smooth;
    white-space: nowrap;
}

/* Navigation items */
.nav-item {
    display: flex;
    align-items: center;
    padding: 6px 8px;
    margin: 4px 0;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s ease;
    color: var(--vscode-text);
    text-decoration: none;
    min-height: 52px;
    font-size: 16px;
    white-space: nowrap;
    -webkit-tap-highlight-color: rgba(255, 255, 255, 0.1);
    touch-action: manipulation;
}

.nav-item:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.nav-item:active {
    background-color: rgba(255, 255, 255, 0.15);
    transform: scale(0.98);
}

.nav-item.active {
    background-color: var(--vscode-accent);
}

.nav-item i {
    width: 24px;
    margin-right: 12px;
    text-align: center;
    font-size: 16px;
    flex-shrink: 0;
}

/* 
 * ESTILOS DE USER-INFO REMOVIDOS
 * Si necesitas restaurarlos en el futuro, descomenta esta sección:
 * 
 * .user-info {
 *     grid-area: user;
 *     padding: 16px;
 *     border-top: 1px solid var(--vscode-border);
 *     display: flex;
 *     align-items: center;
 *     gap: 12px;
 *     min-height: 64px;
 *     max-height: 80px;
 *     background-color: var(--vscode-sidebar);
 *     position: sticky;
 *     bottom: 0;
 *     z-index: 1000;
 *     flex-shrink: 0;
 *     white-space: nowrap;
 * }
 * 
 * .user-avatar {
 *     width: 36px;
 *     height: 36px;
 *     border-radius: 50%;
 *     background-color: var(--vscode-accent);
 *     display: flex;
 *     align-items: center;
 *     justify-content: center;
 *     font-size: 14px;
 *     font-weight: bold;
 *     flex-shrink: 0;
 * }
 * 
 * .user-details {
 *     flex: 1;
 *     min-width: 0;
 * }
 * 
 * .user-name {
 *     font-size: 14px;
 *     font-weight: 500;
 *     white-space: nowrap;
 * }
 * 
 * .user-status {
 *     font-size: 12px;
 *     color: var(--vscode-text-secondary);
 *     white-space: nowrap;
 * }
 */

/* Main content area */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    background-color: var(--vscode-editor);
    min-width: 0;
    position: fixed;
    top: 56px;
    left: 0;
    right: 0;
    bottom: 22px;
    z-index: 10;
    margin-left: 0;
    transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Tab bar */
.tab-bar {
    height: 48px;
    background-color: var(--vscode-tab-inactive);
    border-bottom: 1px solid var(--vscode-border);
    display: flex;
    align-items: center;
    overflow-x: auto;
    margin-left: 0;
    transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    z-index: 15;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.tab-bar::-webkit-scrollbar {
    display: none;
}

.tab-bar.sidebar-hidden {
    margin-left: 0;
}

.tab {
    height: 100%;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--vscode-tab-inactive);
    border-right: 1px solid var(--vscode-border);
    cursor: pointer;
    font-size: 14px;
    white-space: nowrap;
    position: relative;
    color: var(--vscode-text-secondary);
    transition: all 0.2s ease;
    min-width: 140px;
    -webkit-tap-highlight-color: rgba(255, 255, 255, 0.1);
    touch-action: manipulation;
}

.tab.active {
    background-color: var(--vscode-editor);
    color: var(--vscode-text);
    border-bottom: 3px solid var(--vscode-accent);
}

.tab:hover {
    color: var(--vscode-text);
    background-color: rgba(255, 255, 255, 0.05);
}

.tab:active {
    background-color: rgba(255, 255, 255, 0.1);
}

.tab i {
    margin-right: 8px;
    font-size: 14px;
}

.tab-close {
    margin-left: 8px;
    opacity: 1;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s ease;
    min-width: 24px;
    min-height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-tap-highlight-color: rgba(255, 255, 255, 0.1);
    touch-action: manipulation;
}

.tab-close:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.tab-close:active {
    background-color: rgba(255, 255, 255, 0.2);
    transform: scale(0.9);
}

/* Content area - Optimizado para scroll móvil */
.content-area {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 16px;
    position: relative;
    scroll-behavior: smooth;
}

/* Mobile overlay */
.mobile-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: 25;
    display: none;
    opacity: 0;
    transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(2px);
}

.mobile-overlay.show {
    display: block;
    opacity: 1;
}

/* Scrollbar personalizado */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background-color: transparent;
}

::-webkit-scrollbar-thumb {
    background-color: var(--vscode-scrollbar);
    border-radius: 4px;
    border: 1px solid var(--vscode-bg);
}

::-webkit-scrollbar-thumb:hover {
    background-color: #565656;
}

/* Status bar */
.status-bar {
    height: 22px;
    background-color: var(--vscode-accent);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 12px;
    font-size: 11px;
    color: white;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 55;
    border-top: 1px solid var(--vscode-border);
}

.status-left,
.status-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.status-left {
    flex: 1;
}

.status-right {
    flex-shrink: 0;
}

/* Welcome screen - Optimizado para móvil */
.welcome-screen {
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    height: auto;
    text-align: center;
    padding: 16px;
    padding-top: 32px;
}

.logo-container {
    margin-bottom: 32px;
}

.logo {
    font-size: 36px;
    font-weight: bold;
    color: var(--vscode-accent);
    margin-bottom: 12px;
    line-height: 1.2;
}

.tagline {
    font-size: 16px;
    color: var(--vscode-text-secondary);
    margin-bottom: 32px;
    line-height: 1.4;
}

/* Profile styles - Optimizado para móvil */
.profile-container {
    max-width: 100%;
    margin: 0;
    padding: 0;
}

.profile-header {
    display: flex;
    flex-direction: column;
    text-align: center;
    align-items: center;
    margin-bottom: 24px;
    padding: 16px;
    background-color: var(--vscode-sidebar);
    border-radius: 12px;
    border: 1px solid var(--vscode-border);
}

.profile-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    margin-bottom: 16px;
    border: 3px solid var(--vscode-accent);
}

.profile-info h2 {
    color: var(--vscode-text);
    margin-bottom: 8px;
    font-size: 24px;
}

.profile-info p {
    color: var(--vscode-text-secondary);
    font-size: 16px;
}

.profile-fields {
    display: grid;
    gap: 16px;
    grid-template-columns: 1fr;
}

.profile-field {
    display: flex;
    align-items: center;
    padding: 16px;
    background-color: var(--vscode-sidebar);
    border-radius: 12px;
    border: 1px solid var(--vscode-border);
    transition: all 0.2s ease;
    min-height: 64px;
}

.profile-field:hover {
    border-color: var(--vscode-accent);
    transform: translateY(-1px);
}

.field-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--vscode-accent);
    border-radius: 50%;
    margin-right: 16px;
    font-size: 18px;
    flex-shrink: 0;
}

.field-content {
    flex: 1;
    min-width: 0;
}

.field-label {
    font-size: 11px;
    color: var(--vscode-text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 4px;
}

.field-value {
    font-size: 16px;
    color: var(--vscode-text);
    word-wrap: break-word;
}

/* Carousel styles - Optimizado para móvil */
.carousel-container {
    width: 100%;
    max-width: 100%;
    height: 240px;
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    margin: 0 auto 32px auto;
    background-color: var(--vscode-sidebar);
    touch-action: pan-y;
}

.carousel-inner {
    display: flex;
    transition: transform 1s cubic-bezier(0.4, 0, 0.2, 1);
    width: 300%;
    height: 100%;
    transform: translateX(0%);
}

.carousel-slide {
    width: 33.333%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    flex-shrink: 0;
}

.carousel-indicators {
    position: absolute;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 12px;
}

.carousel-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-tap-highlight-color: rgba(255, 255, 255, 0.1);
    touch-action: manipulation;
}

.carousel-indicator::before {
    content: '';
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.5);
    transition: all 0.3s ease;
}

.carousel-indicator.active::before {
    background-color: var(--vscode-accent);
}

.carousel-indicator:hover::before {
    background-color: rgba(255, 255, 255, 0.8);
}

/* Mission section - Optimizado para móvil */
.mission-section {
    background-color: var(--vscode-sidebar);
    border: 1px solid var(--vscode-border);
    border-radius: 12px;
    padding: 16px;
    text-align: center;
    margin-bottom: 24px;
    max-width: 100%;
}

.mission-section h2 {
    color: var(--vscode-accent);
    font-size: 24px;
    margin-bottom: 16px;
    line-height: 1.3;
}

.mission-section p {
    font-size: 16px;
    line-height: 1.6;
    color: var(--vscode-text);
    margin-bottom: 24px;
}

.cta-button {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    background-color: var(--vscode-accent);
    color: white;
    padding: 16px 24px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    font-size: 16px;
    transition: all 0.2s ease;
    min-height: 44px;
    border: none;
    cursor: pointer;
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
    touch-action: manipulation;
}

.cta-button:hover {
    background-color: var(--vscode-accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 122, 204, 0.3);
}

.cta-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(0, 122, 204, 0.2);
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Telegram Widget Styles */
#telegram-login-widget {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 80px;
    margin: 20px 0;
}

.telegram-widget-wrapper {
    background-color: var(--vscode-sidebar);
    border: 1px solid var(--vscode-border);
    border-radius: 12px;
    padding: 16px;
    text-align: center;
    width: 100%;
}

/* Toast notifications para PWA */
.pwa-toast {
    position: fixed;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--vscode-sidebar);
    color: var(--vscode-text);
    padding: 12px 20px;
    border-radius: 8px;
    border: 1px solid var(--vscode-border);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 10000;
    max-width: 90vw;
    text-align: center;
    opacity: 0;
    transition: all 0.3s ease;
    pointer-events: none;
}

.pwa-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(-10px);
}

.pwa-toast.success {
    border-color: var(--vscode-success);
    background: var(--vscode-success);
    color: white;
}

.pwa-toast.error {
    border-color: var(--vscode-error);
    background: var(--vscode-error);
    color: white;
}

.pwa-toast.warning {
    border-color: var(--vscode-warning);
    background: var(--vscode-warning);
    color: var(--vscode-bg);
}

/* Spinner de carga para actualizaciones */
.loading-spinner {
    display: inline-block;
    width: 12px;
    height: 12px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Estilos para estados de carga */
.loading-spinner-large {
    width: 48px;
    height: 48px;
    border: 4px solid var(--vscode-border);
    border-top: 4px solid var(--vscode-accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loading-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 60vh;
    text-align: center;
    padding: 20px;
}

.loading-container .loading-text {
    color: var(--vscode-text);
    font-size: 16px;
    margin-bottom: 8px;
    font-weight: 500;
}

.loading-container .loading-subtext {
    color: var(--vscode-text-secondary);
    font-size: 14px;
}

.error-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 60vh;
    text-align: center;
    padding: 20px;
}

.error-container .error-icon {
    color: var(--vscode-error);
    font-size: 48px;
    margin-bottom: 20px;
}

.error-container .error-title {
    color: var(--vscode-text);
    font-size: 16px;
    margin-bottom: 8px;
    font-weight: 500;
}

.error-container .error-message {
    color: var(--vscode-text-secondary);
    font-size: 14px;
    margin-bottom: 20px;
}

.retry-btn {
    background: var(--vscode-accent);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
    touch-action: manipulation;
}

.retry-btn:hover {
    background: var(--vscode-accent-hover);
    transform: translateY(-1px);
}

.retry-btn:active {
    transform: translateY(0);
}

/* ESTILOS PARA MANEJO DE VIEWPORT MÓVIL */

/* Estilos para cuando el teclado está abierto */
.keyboard-open .sidebar {
    min-height: var(--sidebar-height) !important;
    max-height: var(--sidebar-height) !important;
}

/* Usar viewport dinámico donde esté disponible */
@supports (height: 100dvh) {
    :root {
        --sidebar-height: calc(100dvh - 56px - 22px);
    }
    
    .vscode-container {
        height: calc(100dvh - 56px - 22px);
    }
    
    .activity-bar,
    .main-content {
        height: calc(100dvh - 56px - 22px);
    }
}

/* Mejoras para dispositivos con notch */
@supports (padding: max(0px)) {
    .mobile-header {
        padding-left: max(16px, env(safe-area-inset-left));
        padding-right: max(16px, env(safe-area-inset-right));
        padding-top: env(safe-area-inset-top);
        height: calc(56px + env(safe-area-inset-top));
    }
    
    :root {
        --sidebar-height: calc(100vh - 56px - 22px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
    }
    
    .vscode-container {
        margin-top: calc(56px + env(safe-area-inset-top));
        height: calc(100vh - 56px - 22px - env(safe-area-inset-top));
    }
    
    .activity-bar,
    .sidebar,
    .main-content {
        top: calc(56px + env(safe-area-inset-top));
        height: calc(100vh - 56px - 22px - env(safe-area-inset-top));
    }
    
    .status-bar {
        padding-bottom: env(safe-area-inset-bottom);
        height: calc(22px + env(safe-area-inset-bottom));
    }

    /* Viewport dinámico con safe areas */
    @supports (height: 100dvh) {
        :root {
            --sidebar-height: calc(100dvh - 56px - 22px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
        }
        
        .vscode-container {
            height: calc(100dvh - 56px - 22px - env(safe-area-inset-top));
        }
        
        .activity-bar,
        .sidebar,
        .main-content {
            height: calc(100dvh - 56px - 22px - env(safe-area-inset-top));
        }
    }
}

/* Utility classes */
.hidden {
    display: none !important;
}

.loading {
    opacity: 0.5;
    pointer-events: none;
}

/* Responsive Design */

/* Tablets */
@media (min-width: 769px) and (max-width: 1024px) {
    .sidebar {
        max-width: 450px;
    }
    
    .profile-fields {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .carousel-container {
        height: 300px;
    }
    
    .logo {
        font-size: 42px;
    }
    
    .mission-section h2 {
        font-size: 28px;
    }


    .loading-container,
    .error-container {
        height: 50vh;
        padding: 24px;
    }
}

/* Móviles */
@media (max-width: 768px) {
    .mobile-header {
        height: 52px;
        padding: 0 12px;
    }

    :root {
        --sidebar-height: calc(100vh - 52px - 22px);
    }

    .vscode-container {
        height: calc(100vh - 52px - 22px);
        margin-top: 52px;
    }

    .activity-bar,
    .sidebar,
    .main-content {
        top: 52px;
        height: calc(100vh - 52px - 22px);
    }

    .sidebar {
        width: fit-content;
        max-width: calc(100vw - 56px);
    }

    .sidebar.hidden {
        transform: translateX(calc(-100% - 56px));
    }

    .carousel-container {
        height: 200px;
        margin-bottom: 24px;
    }

    .logo {
        font-size: 28px;
    }

    .tagline {
        font-size: 14px;
    }

    .mission-section {
        padding: 20px;
        margin-bottom: 20px;
    }

    .mission-section h2 {
        font-size: 20px;
    }

    .mission-section p {
        font-size: 14px;
    }

    .status-left {
        gap: 6px;
        font-size: 10px;
    }


    .tab {
        padding: 0 16px;
        min-width: 120px;
    }

    .loading-container,
    .error-container {
        height: 50vh;
        padding: 16px;
    }
    
    .loading-spinner-large {
        width: 40px;
        height: 40px;
        border-width: 3px;
    }
    
    .error-container .error-icon {
        font-size: 40px;
    }

    @supports (height: 100dvh) {
        :root {
            --sidebar-height: calc(100dvh - 52px - 22px);
        }
        
        .vscode-container {
            height: calc(100dvh - 52px - 22px);
        }
        
        .activity-bar,
        .sidebar,
        .main-content {
            height: calc(100dvh - 52px - 22px);
        }
    }

    @supports (padding: max(0px)) {
        .mobile-header {
            height: calc(52px + env(safe-area-inset-top));
        }
        
        :root {
            --sidebar-height: calc(100vh - 52px - 22px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
        }
        
        .vscode-container {
            height: calc(100vh - 52px - 22px - env(safe-area-inset-top));
            margin-top: calc(52px + env(safe-area-inset-top));
        }
        
        .activity-bar,
        .sidebar,
        .main-content {
            top: calc(52px + env(safe-area-inset-top));
            height: calc(100vh - 52px - 22px - env(safe-area-inset-top));
        }

        @supports (height: 100dvh) {
            :root {
                --sidebar-height: calc(100dvh - 52px - 22px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
            }
            
            .vscode-container {
                height: calc(100dvh - 52px - 22px - env(safe-area-inset-top));
            }
            
            .activity-bar,
            .sidebar,
            .main-content {
                height: calc(100dvh - 52px - 22px - env(safe-area-inset-top));
            }
        }
    }
}

/* Móviles muy pequeños */
@media (max-width: 480px) {
    .btn {
        padding: 6px 8px;
        font-size: 11px;
        min-height: 32px;
    }
    
    .header-actions {
        gap: 4px;
    }
    
    .mobile-title {
        font-size: 16px;
    }
    
    .connection-status {
        width: 28px;
        height: 28px;
        font-size: 12px;
    }

    .tab {
        padding: 0 12px;
        min-width: 100px;
        font-size: 13px;
    }

    .mission-section {
        padding: 16px;
    }


    .logo {
        font-size: 24px;
    }

    .profile-avatar {
        width: 64px;
        height: 64px;
    }

    .field-icon {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }

    .carousel-container {
        height: 180px;
    }
}

/* Orientación landscape en móviles */
@media (max-height: 500px) and (orientation: landscape) {
    .mobile-header {
        height: 48px;
    }
    
    :root {
        --sidebar-height: calc(100vh - 48px - 22px);
    }
    
    .vscode-container {
        height: calc(100vh - 48px - 22px);
        margin-top: 48px;
    }
    
    .activity-bar,
    .sidebar,
    .main-content {
        top: 48px;
        height: calc(100vh - 48px - 22px);
    }

    .welcome-screen {
        padding-top: 16px;
    }

    .logo-container {
        margin-bottom: 16px;
    }

    .carousel-container {
        height: 150px;
    }

    .mission-section {
        padding: 12px;
        margin-bottom: 16px;
    }
}

/* Mejoras para dispositivos táctiles */
@media (hover: none) and (pointer: coarse) {
    .activity-item,
    .nav-item,
    .tab,
    .hamburger-menu,
    .sidebar-close,
    .tab-close,
    .cta-button,
    .carousel-indicator,
    .retry-btn {
        min-height: 44px;
        min-width: 44px;
    }

    .activity-item:hover,
    .nav-item:hover,
    .tab:hover {
        transform: none;
    }
}

/* Reduce motion para accesibilidad */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    .carousel-inner {
        transition: none;
    }
}