:root {
    --bg-dark: #000000;
    --bg-sidebar: #1e293b;
    --bg-card: #1e293b;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --accent-primary: #38bdf8;
    /* Sky Blue */
    --accent-secondary: #818cf8;
    /* Indigo */
    --accent-glow: rgba(56, 189, 248, 0.5);
    --border-color: #334155;
    --font-main: 'Inter', sans-serif;
}

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

body {
    font-family: var(--font-main);
    background-color: var(--bg-dark);
    color: var(--text-primary);
    height: 100vh;
    overflow: hidden;
}

.app-container {
    display: flex;
    height: 100%;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background-color: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: 20px;
}

/* Logo CSS Animation */
.logo-container {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 40px;
    padding: 10px;
}

.brain-logo {
    width: 40px;
    height: 40px;
    position: relative;
}

.node {
    position: absolute;
    width: 6px;
    height: 6px;
    background-color: var(--accent-primary);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--accent-glow);
    animation: pulse 2s infinite ease-in-out;
}

.n1 {
    top: 10%;
    left: 50%;
    animation-delay: 0s;
}

.n2 {
    top: 40%;
    left: 20%;
    animation-delay: 0.4s;
}

.n3 {
    top: 40%;
    left: 80%;
    animation-delay: 0.8s;
}

.n4 {
    top: 70%;
    left: 35%;
    animation-delay: 1.2s;
}

.n5 {
    top: 70%;
    left: 65%;
    animation-delay: 1.6s;
}

.connection {
    position: absolute;
    background-color: var(--accent-secondary);
    opacity: 0.4;
    transform-origin: center;
    z-index: 0;
}

/* Connecting lines (simplified for CSS) */
.c1 {
    width: 14px;
    height: 1px;
    top: 25%;
    left: 35%;
    transform: rotate(45deg);
}

.c2 {
    width: 14px;
    height: 1px;
    top: 25%;
    left: 53%;
    transform: rotate(-45deg);
}

.c3 {
    width: 24px;
    height: 1px;
    top: 43%;
    left: 23%;
}

/* Horizontal */
.c4 {
    width: 14px;
    height: 1px;
    top: 55%;
    left: 28%;
    transform: rotate(45deg);
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
        opacity: 0.8;
    }

    50% {
        transform: scale(1.5);
        opacity: 1;
        box-shadow: 0 0 12px var(--accent-primary);
    }
}

.app-name {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.5px;
}

/* Navigation */
.main-nav ul {
    list-style: none;
}

.main-nav li {
    margin-bottom: 8px;
}

.main-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.3s ease;
    font-weight: 500;
}

.main-nav li.active a,
.main-nav a:hover {
    background-color: rgba(56, 189, 248, 0.1);
    color: var(--accent-primary);
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    background-color: var(--bg-dark);
}

.top-bar {
    height: 70px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px;
}

.search-bar {
    display: flex;
    align-items: center;
    background-color: var(--bg-sidebar);
    padding: 8px 16px;
    border-radius: 20px;
    width: 400px;
    border: 1px solid transparent;
    transition: border-color 0.3s;
}

.search-bar:focus-within {
    border-color: var(--accent-primary);
}

.search-bar input {
    background: transparent;
    border: none;
    color: var(--text-primary);
    margin-left: 10px;
    width: 100%;
    outline: none;
}

.user-profile .avatar {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--accent-secondary), var(--accent-primary));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: white;
    cursor: pointer;
}

.content-area {
    padding: 30px;
    overflow-y: auto;
}

.welcome-section {
    margin-bottom: 30px;
}

.welcome-section h2 {
    font-size: 2rem;
    margin-bottom: 5px;
}

.grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    min-height: 200px;
}

.card h3 {
    margin-bottom: 15px;
    color: var(--text-secondary);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.empty-state {
    color: var(--text-secondary);
    font-style: italic;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100px;
    opacity: 0.6;
}

/* Menu Toggle Button */
.menu-toggle {
    display: none;
    color: var(--text-primary);
    font-size: 1.5rem;
    margin-right: 15px;
    cursor: pointer;
    background: none;
    border: none;
}

/* Responsive Design */
@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: -260px;
        top: 0;
        bottom: 0;
        z-index: 1000;
        transition: left 0.3s ease;
        box-shadow: 5px 0 15px rgba(0, 0, 0, 0.5);
    }

    .sidebar.active {
        left: 0;
    }

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

    .sidebar-overlay.active {
        display: block;
    }

    .main-content {
        width: 100%;
    }

    .top-bar {
        padding: 0 15px;
        justify-content: flex-start;
        /* Align items to start */
    }

    .menu-toggle {
        display: block;
    }

    .search-bar {
        width: auto;
        flex: 1;
        margin: 0 10px;
    }

    .search-bar input {
        width: 100%;
        /* Ensure input takes available space */
    }

    .user-profile {
        margin-left: auto;
        /* Push user profile to the right */
    }
}

/* 
 * Brain Form Theme 
 * Aplicado para uniformizar cores de formulários e áreas de conteúdo escuras
 */
.brain-form-theme,
.tab-content {
    background-color: var(--bg-sidebar) !important;
    color: var(--text-primary) !important;
    border-radius: 12px;
}

.brain-form-theme label,
.tab-content label {
    color: var(--text-secondary) !important;
    font-weight: 500;
    margin-bottom: 5px;
}

.brain-form-theme .form-control,
.brain-form-theme .form-select,
.tab-content .form-control,
.tab-content .form-select {
    background-color: rgba(0, 0, 0, 0.2) !important;
    border: 1px solid var(--border-color) !important;
    color: var(--text-primary) !important;
}

.brain-form-theme .form-control::placeholder,
.tab-content .form-control::placeholder {
    color: var(--text-secondary) !important;
    opacity: 0.5;
}

.brain-form-theme .form-control:focus,
.brain-form-theme .form-select:focus,
.tab-content .form-control:focus,
.tab-content .form-select:focus {
    background-color: rgba(0, 0, 0, 0.3) !important;
    border-color: var(--accent-primary) !important;
    box-shadow: 0 0 0 0.25rem rgba(56, 189, 248, 0.25) !important;
    color: var(--text-primary) !important;
}

#container-main {
    padding-bottom: 30px;
}