:root {
    --primary-green: #48bb78;
    --dark-bg: #1a202c;
    --light-gray: #f3f4f6;
    --sidebar-width: 12.8rem;
}

.sidebar-logo { color: var(--primary-green); }
.sidebar { width: var(--sidebar-width); background-color: var(--dark-bg); }

body {
    margin: 0;
    font-family: 'Inter', sans-serif;
    background-color: #f3f4f6;
    display: flex;
    color: #1f2937;
    font-size: 0.8rem;
}

.sidebar {
    background-color: #1a202c;
    color: white;
    width: 12.8rem; 
    min-height: 100vh;
    padding: 0.8rem; 
    flex-shrink: 0;
}

.sidebar-header {
    display: flex;
    align-items: center;
    margin-bottom: 1.6rem;
}

.sidebar-header h1 {
    font-size: 1rem; 
    font-weight: 700;
}

.sidebar-logo {
    color: #48bb78;
    height: 1.6rem; 
    width: 1.6rem; 
    margin-right: 0.6rem; 
    flex-shrink: 0;
}

.sidebar nav ul {
    list-style: none;
    padding: 0;
}

.sidebar nav li {
    margin-bottom: 0.4rem;
}

.sidebar-link {
    display: flex;
    align-items: center;
    padding: 0.6rem; 
    border-radius: 0.5rem;
    text-decoration: none;
    color: white;
    transition: background-color 0.2s;
}

.sidebar-link:hover {
    background-color: #2d3748;
}

.sidebar-link.active {
    background-color: #2d3748;
    border-left: 4px solid #48bb78;
    padding-left: calc(0.6rem - 4px);
}

.sidebar-link.disabled {
    color: #9ca3af;
    cursor: not-allowed;
}

.sidebar-link.disabled:hover {
    background-color: transparent;
}

.sidebar-link svg {
    height: 1rem; 
    width: 1rem; 
    margin-right: 0.6rem; 
    flex-shrink: 0;
}

.main-content {
    flex: 1;
    padding: 1.6rem; 
    display: flex;
    flex-direction: column;
}

.main-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.2rem; 
    padding-bottom: 0.8rem;
    border-bottom: 1px solid #e5e7eb;
}

.main-header h2 {
    font-size: 1.5rem; 
    font-weight: 700;
}

.mensagem {
    padding: 0.8rem; 
    border-radius: 0.5rem;
    font-weight: 500;
    text-align: center;
    margin-bottom: 1.2rem; 
    display: none;
}
.mensagem-sucesso {
    background-color: #d1fae5;
    color: #065f46;
}
.mensagem-erro {
    background-color: #fee2e2;
    color: #991b1b;
}

.controls-container {
    display: flex;
    gap: 1.2rem; 
    margin-bottom: 1.2rem; 
    flex-wrap: wrap;
}

.control-group {
    display: flex;
    flex-grow: 1;
}

.input-field {
    flex-grow: 1;
    padding: 0.6rem 0.8rem;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem 0 0 0.5rem;
    font-size: 0.8rem; 
    min-width: 120px; 
}
.input-field:focus {
    outline: none;
    box-shadow: 0 0 0 2px #48bb78;
    z-index: 10;
}

.btn {
    padding: 0.6rem 1.2rem; 
    border: 1px solid transparent;
    border-radius: 0.5rem;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s;
    white-space: nowrap;
}
.control-group .btn {
    border-radius: 0 0.5rem 0.5rem 0;
}
.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
.btn-primary {
    background-color: #3b82f6;
    color: white;
}
.btn-primary:hover:not(:disabled) {
    background-color: #2563eb;
}

.btn-success {
    background-color: #22c55e;
    color: white;
}
.btn-success:hover:not(:disabled) {
    background-color: #16a34a;
}

.btn-danger {
    background-color: #ef4444;
    color: white;
}
.btn-danger:hover:not(:disabled) {
    background-color: #dc2626;
}

.percurso-section {
    background-color: white;
    padding: 1.2rem; 
    border-radius: 0.75rem;
    margin-bottom: 1.2rem; 
    box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.8rem; 
}
.percurso-section fieldset {
    border: none;
    display: flex;
    align-items: center;
    gap: 1.2rem; 
    padding: 0;
    margin: 0;
}
.percurso-section legend {
    font-weight: 600;
    font-size: 0.9rem; 
    margin-right: 0.8rem; 
}
.radio-group {
    display: flex;
    gap: 1.2rem; 
}
.radio-group label {
    cursor: pointer;
    margin-left: 0.25rem;
}

.canvas-container {
    flex-grow: 1;
    background-color: white;
    padding: 0.8rem; 
    border-radius: 0.75rem;
    box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    overflow: auto;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 1.2rem; 
    position: relative;
}
#tree-canvas {
    background-color: #f9fafb;
    border-radius: 0.5rem;
    display: block;
}

.animation-subtitle {
    text-align: center;
    font-size: 0.9rem; 
    font-weight: 500;
    color: #1f2937;
    height: 1.5em;
    line-height: 1.5em;
    margin-bottom: 0.8rem; 
    transition: color 0.3s ease-in-out;
}

.navigation-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.6rem; 
    margin-top: auto;
    padding-top: 1.2rem; 
    border-top: 1px solid #e5e7eb;
}
.navigation-controls .btn {
    background-color: #e5e7eb;
    color: #374151;
    border: 1px solid #d1d5db;
}
.navigation-controls .btn:hover:not(:disabled) {
    background-color: #d1d5db;
}

.speed-control-group {
    display: flex;
    align-items: center;
    gap: 0.4rem; 
    padding: 0 0.8rem; 
    color: #374151;
    font-weight: 500;
}

.sidebar svg {
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    fill: none;
    stroke: currentColor; 
}