:root {
    --bg-color: #f4f7f9;
    --sidebar-white: #ffffff;
    --primary: #5a91e6;
    --text: #2c3e50;
    --accent: #4caf50;
    --orange: #ff9800;
}

body {
    margin: 0;
    font-family: 'Inter', sans-serif;
    background: var(--bg-color);
    color: var(--text);
}

.container {
    display: flex;
    height: 100vh;
}

/* --- Sidebar & Sofia Widget --- */
.sidebar {
    width: 260px;
    background: var(--sidebar-white);
    padding: 25px;
    display: flex;
    flex-direction: column;
    border-right: 1px solid #e0e6ed;
}

.logo {
    font-size: 1.4rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 40px;
    color: var(--primary);
}

nav { flex-grow: 1; }

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    text-decoration: none;
    color: #7f8c8d;
    border-radius: 10px;
    transition: 0.2s;
    margin-bottom: 5px;
    cursor: pointer;
}

.nav-link.active, .nav-link:hover {
    background: #f0f7ff;
    color: var(--primary);
    font-weight: 600;
}

.sofia-widget {
    background: #f8fafd;
    padding: 15px;
    border-radius: 15px;
    border: 1px solid #eef2f7;
    margin-top: 20px;
}

.sofia-header {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    font-weight: bold;
    margin-bottom: 10px;
}

.dot.online {
    width: 8px;
    height: 8px;
    background: var(--accent);
    border-radius: 50%;
}

.sofia-body {
    height: 60px;
    background: white;
    border-radius: 8px;
    padding: 8px;
    font-size: 0.75rem;
    border: 1px solid #eef2f7;
    overflow-y: auto;
}

.sofia-input {
    display: flex;
    gap: 5px;
    margin-top: 8px;
}

.sofia-input input {
    flex: 1;
    border: 1px solid #ddd;
    border-radius: 5px;
    padding: 5px;
    font-size: 0.7rem;
}

.sofia-input button {
    background: var(--primary);
    border: none;
    color: white;
    border-radius: 5px;
    padding: 5px 10px;
    cursor: pointer;
}

/* --- Main Content --- */
.content {
    flex: 1;
    padding: 40px;
    overflow-y: auto;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 25px;
}

.profile {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 500;
}

.profile img {
    border-radius: 50%;
}

/* --- Dashboard Elements --- */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 25px;
}

.card {
    background: white;
    padding: 25px;
    border-radius: 20px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.02);
}

.card.wide {
    grid-column: span 2;
}

.btn-action {
    background: var(--primary);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 10px;
    cursor: pointer;
    margin-top: 15px;
    width: 100%;
    font-weight: 600;
}

/* Progress Bar */
.progress-container { margin-top: 10px; }
.progress-bar {
    background: #eee;
    height: 8px;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 5px;
}
.fill {
    background: var(--primary);
    height: 100%;
    border-radius: 4px;
}

/* Activity List */
.activity-list { list-style: none; padding: 0; }
.activity-list li { margin-bottom: 10px; font-size: 0.9rem; color: #555; }
.activity-list span { font-size: 0.75rem; color: #999; margin-left: 5px; }

/* --- Tabs Logic --- */
.tab-content { display: none; }
.tab-content.active {
    display: block;
    animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- Video Area (Antigo - Mantido por segurança ou reuso de classes internas) --- */
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.video-container {
    height: 400px;
    background: #2c3e50;
    border-radius: 15px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: #ecf0f1;
    text-align: center;
}
.video-container i { font-size: 4rem; margin-bottom: 20px; opacity: 0.5; }
.video-container .btn-action { width: auto; padding: 12px 40px; }

/* --- Styles da Aba Meu Projeto --- */
.project-header-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
    padding: 20px;
    border-radius: 15px;
    margin-bottom: 25px;
    border-left: 5px solid var(--primary);
}

.status-badge {
    background: #fff4e5;
    color: var(--orange);
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: bold;
}

.file-table { width: 100%; border-collapse: collapse; margin-top: 15px; }
.file-table th { text-align: left; color: #888; font-size: 0.85rem; padding-bottom: 10px; border-bottom: 1px solid #eee; }
.file-table td { padding: 12px 0; border-bottom: 1px solid #f9f9f9; font-size: 0.9rem; }
.file-table td i { cursor: pointer; color: var(--primary); font-size: 1.2rem; transition: 0.2s; }
.file-table td i:hover { color: #333; }

/* Roadmap / Milestones */
.milestone-list { margin-top: 15px; display: flex; flex-direction: column; gap: 15px; }
.milestone { display: flex; gap: 12px; align-items: flex-start; }
.milestone i { font-size: 1.2rem; color: #ccc; }
.milestone.done i { color: var(--accent); }
.milestone.active i { color: var(--primary); animation: pulse-soft 2s infinite; }
.milestone div strong { display: block; font-size: 0.9rem; }
.milestone div span { font-size: 0.75rem; color: #888; }

@keyframes pulse-soft {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

/* --- Header Actions (Notificações & Perfil) --- */
.action-group {
    position: relative;
    cursor: pointer;
}

.icon-wrapper {
    position: relative;
    font-size: 1.4rem;
    color: #7f8c8d;
    transition: 0.2s;
}

.icon-wrapper:hover { color: var(--primary); }

.badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ff4757;
    color: white;
    font-size: 0.6rem;
    font-weight: bold;
    padding: 2px 5px;
    border-radius: 50%;
    border: 2px solid var(--bg-color);
}

.text-info { text-align: right; line-height: 1.2; }
.text-info .name { display: block; font-weight: 600; font-size: 0.9rem; }
.text-info .role { display: block; font-size: 0.7rem; color: #999; }
.profile i { font-size: 0.8rem; color: #aaa; }

/* --- Dropdowns Gerais --- */
.dropdown-menu {
    position: absolute;
    top: 140%;
    right: 0;
    background: white;
    width: 280px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    border: 1px solid #f0f0f0;
    display: none;
    z-index: 1000;
    animation: slideDown 0.2s ease;
}

.dropdown-menu.show { display: block; }

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

.dropdown-header { padding: 15px; font-weight: bold; border-bottom: 1px solid #eee; font-size: 0.9rem; }
.notification-item { padding: 12px 15px; border-bottom: 1px solid #f9f9f9; font-size: 0.85rem; display: flex; align-items: center; gap: 10px; transition: 0.2s; }
.notification-item:hover { background: #f8fafd; }
.notification-item p { margin: 0; color: #555; }
.notification-item.unread p { font-weight: 600; color: #333; }
.notification-item .dot { width: 8px; height: 8px; background: var(--primary); border-radius: 50%; }
.dropdown-footer { padding: 10px; text-align: center; font-size: 0.75rem; color: var(--primary); cursor: pointer; font-weight: 600; }

.profile-options { width: 200px; padding: 5px; }
.profile-options a { display: flex; align-items: center; gap: 10px; padding: 10px; text-decoration: none; color: #555; font-size: 0.9rem; border-radius: 8px; transition: 0.2s; }
.profile-options a:hover { background: #f4f7f9; color: var(--primary); }
.profile-options .divider { height: 1px; background: #eee; margin: 5px 0; }
.profile-options a.danger { color: #ff4757; }
.profile-options a.danger:hover { background: #fff0f1; }

/* --- Modais (Janelas) --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    display: none;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    display: flex;
    opacity: 1;
}

.modal-box {
    background: white;
    width: 100%;
    max-width: 500px;
    border-radius: 15px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.2);
    overflow: hidden;
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

.modal-overlay.active .modal-box { transform: translateY(0); }

.modal-header {
    padding: 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 { margin: 0; display: flex; align-items: center; gap: 10px; font-size: 1.1rem; }
.modal-header .close-modal { cursor: pointer; font-size: 1.2rem; color: #999; }
.modal-header .close-modal:hover { color: #ff4757; }

.modal-body { padding: 25px; }

.avatar-edit { display: flex; flex-direction: column; align-items: center; gap: 10px; margin-bottom: 20px; }
.avatar-edit img { border-radius: 50%; width: 80px; height: 80px; object-fit: cover; border: 3px solid var(--bg-color); }

.btn-small { background: #eee; border: none; padding: 5px 10px; border-radius: 5px; cursor: pointer; font-size: 0.75rem; }

.form-grid { display: grid; gap: 15px; }
.input-group label { display: block; font-size: 0.8rem; color: #7f8c8d; margin-bottom: 5px; }
.input-group input { width: 100%; padding: 10px; border: 1px solid #ddd; border-radius: 8px; font-family: inherit; box-sizing: border-box; }

.modal-footer {
    padding: 15px 20px;
    background: #f9f9f9;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.btn-ghost { background: transparent; border: none; color: #7f8c8d; cursor: pointer; padding: 10px 20px; }

.btn-primary {
    background: var(--primary);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
}

.btn-outline { background: transparent; border: 1px solid #ddd; color: var(--text); padding: 10px; border-radius: 8px; cursor: pointer; }

.w-100 { width: 100%; }

/* --- Configurações (Switches) --- */
.config-section { margin-bottom: 20px; }
.config-section h4 {
    margin: 0 0 10px 0;
    font-size: 0.85rem;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.toggle-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #f5f5f5;
}

.toggle-item span { display: flex; align-items: center; gap: 8px; font-size: 0.95rem; }

/* O Botão Switch (CSS Puro) */
.switch { position: relative; display: inline-block; width: 40px; height: 20px; }
.switch input { opacity: 0; width: 0; height: 0; }

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    transition: .4s;
}

input:checked + .slider { background-color: var(--primary); }
input:checked + .slider:before { transform: translateX(20px); }

.slider.round { border-radius: 34px; }
.slider.round:before { border-radius: 50%; }

/* --- ESTILOS DO SANDBOX (FULL SCREEN) --- */
.full-screen-modal {
    max-width: 95vw;
    height: 90vh;
    display: flex;
    flex-direction: column;
}

.sandbox-header {
    background: #2c3e50;
    color: white;
    border-bottom: none;
    padding: 15px 25px;
}

.sandbox-header h3 { color: white; margin: 0; }

.sandbox-header .close-modal-btn {
    color: white;
    opacity: 0.7;
    transition: 0.3s;
}

.sandbox-header .close-modal-btn:hover {
    opacity: 1;
    color: #ff4757;
}

.badge-status {
    background: #27ae60;
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 4px;
    margin-left: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Controles de Dispositivo (Mobile/Desktop) */
.device-controls {
    display: flex;
    gap: 10px;
    background: rgba(255,255,255,0.1);
    padding: 5px;
    border-radius: 8px;
}

.btn-device {
    background: transparent;
    border: none;
    color: #95a5a6;
    cursor: pointer;
    padding: 5px 10px;
    border-radius: 5px;
    transition: 0.2s;
    font-size: 1.1rem;
}

.btn-device.active, .btn-device:hover {
    background: rgba(255,255,255,0.2);
    color: white;
}

/* Corpo do Sandbox e Iframe */
.sandbox-body {
    background: #34495e; /* Fundo escuro para destacar o app */
    flex: 1;
    padding: 0;
    display: flex;
    justify-content: center; /* Centraliza o iframe */
    align-items: center;
    overflow: hidden;
}

.iframe-container {
    height: 100%;
    width: 100%;
    transition: width 0.3s ease;
    background: white;
    box-shadow: 0 0 50px rgba(0,0,0,0.5);
}

iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* --- Estilos do Jitsi Integrado --- */
iframe.jitsi-frame {
    width: 100%;
    height: 100%;
    border: none;
    border-radius: 0 0 15px 15px;
}

/* --- TELA DE LOGIN (NOVO) --- */
#login-screen {
position: fixed;
top: 0;
left: 0;
width: 100vw;
height: 100vh;
background: #2c3e50; /* Cor de fundo elegante */
display: flex;
justify-content: center;
align-items: center;
z-index: 9999; /* Fica por cima de tudo */
transition: opacity 0.5s ease, visibility 0.5s ease;
}

/* Classe para esconder o login depois de entrar */
#login-screen.fade-out {
opacity: 0;
visibility: hidden;
}

.login-box {
    background: white;
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    text-align: center;
    width: 90%;
    max-width: 400px;
    animation: slideUp 0.5s ease;
}

@keyframes slideUp {
    from { transform: translateY(30px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.login-logo {
    margin-bottom: 25px;
}

.login-logo img {
    max-height: 60px; /* Tamanho do logo no login */
}

.login-box h3 { margin: 0 0 10px 0; color: var(--text); }
.login-box p { margin: 0 0 25px 0; color: #888; font-size: 0.9rem; }

/* Classe utilitária para esconder o painel principal no início */
.container.hidden {
    display: none !important;
}

/* Animação de erro (Tremer) usada no JS */
.shake {
    animation: shake 0.5s;
}

@keyframes shake {
    0%, 100% {transform: translateX(0);}
    25% {transform: translateX(-5px);}
    75% {transform: translateX(5px);}
}

/* --- VÍDEO GLOBAL (PERSISTENTE) --- */
.global-video {
    position: fixed;
    z-index: 2500; /* Acima de tudo, até do Sandbox */
    background: white;
    box-shadow: 0 0 100px rgba(0,0,0,0.5);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 2px solid var(--primary);

    /* Estado Padrão (Centralizado - Modo Foco) */
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 600px;
    height: 450px;
    display: flex;
    flex-direction: column;
}

/* Estado Escondido */
.global-video.hidden {
    display: none !important;
}

/* Estado Flutuante (Canto Inferior) */
.global-video.floating-mode {
    top: auto;
    left: auto;
    bottom: 20px;
    right: 20px;
    transform: none; /* Reseta a centralização */
    width: 320px;
    height: 240px;
    border-radius: 15px;
}

/* Ajustes internos quando flutuar */
.global-video.floating-mode h3 { font-size: 0.8rem; }
.global-video.floating-mode .card-header { padding: 8px 15px; }
.global-video.floating-mode .btn-action { padding: 5px 15px; font-size: 0.8rem; }

/* Ajuste do iframe para ocupar tudo */
.global-video .video-container {
    flex: 1;
    height: auto; /* Deixa o flex controlar a altura */
    border-radius: 0 0 15px 15px;
}

/* --- TOOLBOX (FAB & Menu Flutuante) --- */
.toolbox-container {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 1500;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 15px;
}

.toolbox-trigger {
    width: 60px;
    height: 60px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 50%;
    box-shadow: 0 4px 15px rgba(90, 145, 230, 0.4);
    font-size: 1.5rem;
    cursor: pointer;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    align-items: center;
    justify-content: center;
}

.toolbox-trigger:hover {
    transform: scale(1.1);
}

.toolbox-trigger.active {
    transform: rotate(45deg);
    background: #ff4757; /* Fica vermelho para fechar */
}

.toolbox-menu {
    background: white;
    padding: 10px 15px;
    border-radius: 50px; /* Formato de pílula */
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    gap: 15px;

    /* Animação de entrada */
    opacity: 0;
    transform: translateY(20px) scale(0.9);
    pointer-events: none;
    transition: all 0.3s ease;
}

.toolbox-menu.show {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: all;
}

.tool-btn {
    background: transparent;
    border: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    color: #555;
    transition: 0.2s;
    min-width: 50px;
}

.tool-btn i {
    font-size: 1.4rem;
    color: var(--primary);
    background: #f0f7ff;
    padding: 10px;
    border-radius: 12px;
    transition: 0.2s;
}

.tool-btn span {
    font-size: 0.7rem;
    font-weight: 600;
}

.tool-btn:hover i {
    background: var(--primary);
    color: white;
    transform: translateY(-3px);
}

.tool-divider {
    width: 1px;
    height: 30px;
    background: #eee;
}
