/* Variáveis CSS para temas */
:root {
    /* Tema claro */
    --bg-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --bg-secondary: rgba(255, 255, 255, 0.1);
    --bg-glass: rgba(255, 255, 255, 0.15);
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.8);
    --border-glass: rgba(255, 255, 255, 0.2);
    --shadow-glass: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
    --neon-color: #ff00ff;
    --accent-blue: #4f46e5;
    --accent-purple: #7c3aed;
    --accent-violet: #8b5cf6;
    --accent-magenta: #ec4899;
    --accent-yellow: #fbbf24;
}

[data-theme="dark"] {
    /* Tema escuro */
    --bg-primary: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    --bg-secondary: rgba(0, 0, 0, 0.3);
    --bg-glass: rgba(0, 0, 0, 0.25);
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.7);
    --border-glass: rgba(255, 255, 255, 0.1);
    --shadow-glass: 0 8px 32px 0 rgba(0, 0, 0, 0.5);
    --neon-color: #00ffff;
    --accent-yellow: #f59e0b;
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    overflow: hidden;
    height: 100vh;
    position: relative;
}

/* Efeito neon que segue o mouse */
.neon-cursor {
    position: fixed;
    width: 300px;
    height: 300px;
    border-radius: 50%;
    background: radial-gradient(circle, var(--neon-color) 0%, transparent 70%);
    opacity: 0.3;
    pointer-events: none;
    z-index: -1;
    transform: translate(-50%, -50%);
    transition: opacity 0.3s ease;
    filter: blur(20px);
}

.container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    position: relative;
    z-index: 1;
}

/* Header */
.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 2rem;
    background: var(--bg-glass);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-glass);
    box-shadow: var(--shadow-glass);
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-image {
    height: 40px;
    width: auto;
    transition: all 0.3s ease;
    filter: drop-shadow(0 0 10px rgba(255, 0, 255, 0.5));
    animation: logoGlow 3s ease-in-out infinite alternate;
}

@keyframes logoGlow {
    0% {
        filter: drop-shadow(0 0 10px rgba(255, 0, 255, 0.5)) drop-shadow(0 0 20px rgba(0, 255, 255, 0.3));
    }
    25% {
        filter: drop-shadow(0 0 15px rgba(0, 255, 255, 0.6)) drop-shadow(0 0 25px rgba(255, 255, 0, 0.3));
    }
    50% {
        filter: drop-shadow(0 0 20px rgba(255, 255, 0, 0.7)) drop-shadow(0 0 30px rgba(255, 0, 0, 0.3));
    }
    75% {
        filter: drop-shadow(0 0 15px rgba(255, 0, 0, 0.6)) drop-shadow(0 0 25px rgba(0, 255, 0, 0.3));
    }
    100% {
        filter: drop-shadow(0 0 10px rgba(0, 255, 0, 0.5)) drop-shadow(0 0 20px rgba(255, 0, 255, 0.3));
    }
}

.search-container {
    flex: 1;
    max-width: 500px;
    margin: 0 2rem;
}

.search-input {
    width: 100%;
    padding: 0.75rem 1.5rem;
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    border-radius: 25px;
    color: var(--text-primary);
    font-size: 1rem;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.search-input::placeholder {
    color: var(--text-secondary);
}

.search-input:focus {
    outline: none;
    border-color: var(--accent-violet);
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.3);
}

/* Toggle de tema */
.theme-toggle {
    display: flex;
    align-items: center;
}

.toggle-container {
    position: relative;
}

.toggle-input {
    display: none;
}

.toggle-label {
    display: block;
    width: 60px;
    height: 30px;
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    border-radius: 15px;
    cursor: pointer;
    position: relative;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.toggle-slider {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 22px;
    height: 22px;
    background: linear-gradient(45deg, var(--accent-blue), var(--accent-violet));
    border-radius: 50%;
    transition: transform 0.3s ease;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.toggle-input:checked + .toggle-label .toggle-slider {
    transform: translateX(30px);
}

/* Conteúdo principal */
.main-content {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* Sidebar */
.sidebar {
    width: 250px;
    background: var(--bg-glass);
    backdrop-filter: blur(10px);
    border-right: 1px solid var(--border-glass);
    padding: 1rem;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100vh;
    position: relative;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex: 1;
    overflow-y: auto;
    padding-right: 4px;
    margin-right: -4px;
    min-height: 0;
}

/* Espaçador para empurrar elementos para baixo */
.sidebar-spacer {
    flex: 1;
    min-height: 20px;
}

/* Card de usuário */
.user-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.15), rgba(79, 70, 229, 0.15));
    border: 2px solid rgba(139, 92, 246, 0.3);
    border-radius: 16px;
    backdrop-filter: blur(15px);
    box-shadow: 0 8px 32px rgba(139, 92, 246, 0.2);
    transition: all 0.3s ease;
    cursor: pointer;
    position: absolute;
    bottom: 96px;
    left: 16px;
    right: 16px;
}

.user-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(139, 92, 246, 0.3);
    border-color: rgba(139, 92, 246, 0.5);
}

.user-avatar {
    position: relative;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    overflow: hidden;
    background: linear-gradient(45deg, var(--accent-blue), var(--accent-violet));
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
}

.user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.user-avatar-placeholder {
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.user-name {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary);
    line-height: 1.2;
}

.user-status {
    font-size: 12px;
    color: var(--text-secondary);
    opacity: 0.8;
}

.user-actions {
    display: flex;
    align-items: center;
}

.login-btn {
    background: linear-gradient(45deg, var(--accent-blue), var(--accent-violet));
    border: none;
    border-radius: 8px;
    padding: 8px;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(139, 92, 246, 0.3);
}

.login-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.4);
}

/* Container de configurações */
.settings-container {
    display: flex;
    justify-content: center;
    margin-top: auto;
}

.settings-item {
    width: 100%;
    justify-content: center;
    background: linear-gradient(135deg, rgba(236, 72, 153, 0.15), rgba(168, 85, 247, 0.15));
    border: 2px solid rgba(236, 72, 153, 0.3);
    transition: all 0.3s ease;
}

.settings-item:hover {
    background: linear-gradient(135deg, rgba(236, 72, 153, 0.25), rgba(168, 85, 247, 0.25));
    border-color: rgba(236, 72, 153, 0.5);
    box-shadow: 0 8px 25px rgba(236, 72, 153, 0.3);
}

.nav-item,
.menu-item {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.8rem;
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    position: relative;
}

/* Botão de favoritar */
.favorite-btn {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px;
    border-radius: 50%;
    transition: all 0.3s ease;
    opacity: 0;
    visibility: hidden;
}

.menu-item:hover .favorite-btn {
    opacity: 1;
    visibility: visible;
}

.favorite-btn:hover {
    color: var(--accent-yellow);
    background: rgba(255, 193, 7, 0.1);
    transform: translateY(-50%) scale(1.1);
}

.favorite-btn.favorited {
    opacity: 1;
    visibility: visible;
    color: var(--accent-yellow);
}

.favorite-btn.favorited svg {
    fill: var(--accent-yellow);
    stroke: var(--accent-yellow);
    transform: scale(1.1);
}

.menu-item .nav-text {
    flex: 1;
    margin-right: 30px;
}

.nav-item:hover,
.menu-item:hover {
    background: rgba(139, 92, 246, 0.2);
    border-color: var(--accent-violet);
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(139, 92, 246, 0.3);
}

.nav-item.active,
.menu-item.active {
    background: linear-gradient(45deg, var(--accent-blue), var(--accent-violet));
    border-color: transparent;
    box-shadow: 0 5px 20px rgba(139, 92, 246, 0.4);
}

.menu-separator {
    height: 1px;
    background: var(--border-glass);
    margin: 8px 16px;
    opacity: 0.3;
}

.nav-icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.nav-text {
    font-weight: 500;
    color: var(--text-primary);
}

/* Área do iframe com sistema de abas */
.iframe-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    overflow: hidden;
    margin: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

/* Sistema de abas */
.tabs-container {
    display: flex;
    align-items: center;
    background: rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding: 0 10px;
    min-height: 45px;
}

.tabs-wrapper {
    display: flex;
    flex: 1;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.tabs-wrapper::-webkit-scrollbar {
    display: none;
}

.tab {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px 8px 0 0;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    min-width: 120px;
    max-width: 200px;
    margin-right: 2px;
    position: relative;
    white-space: nowrap;
    transform: translateY(0);
    opacity: 1;
    animation: tabSlideIn 0.3s ease-out;
}

.tab:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.2);
}

.tab.active {
    background: rgba(255, 255, 255, 0.15);
    border-bottom: 2px solid var(--primary-color);
    box-shadow: 0 0 15px rgba(var(--primary-rgb), 0.3), 0 4px 20px rgba(139, 92, 246, 0.3);
    transform: translateY(-1px);
}

.tab-icon {
    display: flex;
    align-items: center;
    color: var(--primary-color);
}

.tab-title {
    flex: 1;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-color);
    overflow: hidden;
    text-overflow: ellipsis;
}

.tab-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    background: none;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.6);
    transition: all 0.2s ease;
    opacity: 0;
    padding: 4px;
    margin-left: 8px;
}

.tab:hover .tab-close {
    opacity: 1;
}

.tab-close:hover {
    background: rgba(255, 0, 0, 0.2);
    color: #ff4444;
    transform: scale(1.1);
}

.tab-close svg {
    width: 12px;
    height: 12px;
}

.new-tab-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    cursor: pointer;
    color: var(--primary-color);
    transition: all 0.3s ease;
    margin-left: 10px;
}

.new-tab-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: scale(1.05);
    box-shadow: 0 0 10px rgba(var(--primary-rgb), 0.3);
}

/* Área dos iframes */
.iframes-container {
    flex: 1;
    position: relative;
    overflow: hidden;
}

.app-iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.app-iframe.active {
    opacity: 1;
    visibility: visible;
    z-index: 1;
    animation: iframeSlideIn 0.4s ease-out;
}

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

::-webkit-scrollbar-track {
    background: var(--bg-glass);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(45deg, var(--accent-violet), var(--accent-magenta));
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(45deg, var(--accent-blue), var(--accent-purple));
}

/* Animações */
@keyframes glow {
    0%, 100% {
        box-shadow: 0 0 20px var(--neon-color);
    }
    50% {
        box-shadow: 0 0 40px var(--neon-color), 0 0 60px var(--neon-color);
    }
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes tabSlideIn {
    from {
        transform: translateY(-10px);
        opacity: 0;
        scale: 0.95;
    }
    to {
        transform: translateY(0);
        opacity: 1;
        scale: 1;
    }
}

@keyframes tabSlideOut {
    from {
        transform: translateY(0);
        opacity: 1;
        scale: 1;
    }
    to {
        transform: translateY(-10px);
        opacity: 0;
        scale: 0.95;
    }
}

@keyframes iframeSlideIn {
    from {
        transform: translateX(20px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.glow-effect {
    animation: glow 2s ease-in-out infinite;
}

/* Responsividade */
@media (max-width: 768px) {
    .sidebar {
        width: 200px;
    }
    
    .search-container {
        margin: 0 1rem;
    }
    
    .header {
        padding: 1rem;
    }
}