/* ===== SIDEBAR CONTAINER ===== */
.sidebar {
    width: 280px;
    background: white;
    border-left: 1px solid #e0e0e0;
    padding: 16px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
    flex-shrink: 0;
}

.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: #f5f5f5;
}

.sidebar::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: #999;
}

/* ===== SEÇÕES DA SIDEBAR ===== */
.sidebar-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sidebar-section:not(:last-child) {
    padding-bottom: 12px;
    border-bottom: 1px solid #f0f0f0;
}

/* ===== TÍTULOS DAS SEÇÕES ===== */
.sidebar-title {
    font-weight: 600;
    font-size: 13px;
    color: #2196f3;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding-bottom: 8px;
    border-bottom: 2px solid #2196f3;
    display: flex;
    align-items: center;
    gap: 6px;
}

.sidebar-title::before {
    content: '';
    display: inline-block;
    width: 3px;
    height: 3px;
    background: #2196f3;
    border-radius: 50%;
}

/* ===== ITENS DA SIDEBAR ===== */
.sidebar-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sidebar-item.inline {
    flex-direction: row;
    align-items: center;
    gap: 8px;
}

.sidebar-item.inline label {
    margin: 0;
    flex: 1;
}

.sidebar-item.inline input {
    flex-shrink: 0;
}

/* ===== LABELS ===== */
.sidebar-label {
    font-size: 12px;
    font-weight: 500;
    color: #555;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    display: block;
}

.sidebar-label.required::after {
    content: ' *';
    color: #f44336;
}

/* ===== INPUTS NA SIDEBAR ===== */
.sidebar-item input[type="text"],
.sidebar-item textarea,
.sidebar-item select {
    padding: 8px 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 12px;
    font-family: inherit;
    background: white;
    color: #333;
    transition: all 0.2s ease;
}

.sidebar-item input[type="text"]:focus,
.sidebar-item textarea:focus,
.sidebar-item select:focus {
    outline: none;
    border-color: #2196f3;
    box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.1);
    background: #fafbfc;
}

.sidebar-item textarea {
    resize: vertical;
    font-family: 'Courier New', monospace;
    font-size: 11px;
    min-height: 60px;
    max-height: 120px;
}

.sidebar-item input[type="checkbox"] {
    margin-right: 6px;
    cursor: pointer;
    width: 16px;
    height: 16px;
    accent-color: #2196f3;
}

/* ===== BOTÕES NA SIDEBAR ===== */
.sidebar-item .btn,
.sidebar .btn {
    width: 100%;
    justify-content: center;
    font-size: 12px;
    padding: 10px 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s ease;
    text-transform: capitalize;
}

.sidebar-item .btn:hover,
.sidebar .btn:hover {
    transform: translateY(-1px);
}

.sidebar .btn + .btn {
    margin-top: 6px;
}

.sidebar .btn.primary {
    background: #2196f3;
    color: white;
}

.sidebar .btn.primary:hover {
    background: #1976d2;
    box-shadow: 0 2px 8px rgba(33, 150, 243, 0.3);
}

.sidebar .btn.secondary {
    background: #f5f5f5;
    color: #333;
    border: 1px solid #ccc;
}

.sidebar .btn.secondary:hover {
    background: #e8e8e8;
    border-color: #999;
}

.sidebar .btn.danger {
    background: #f44336;
    color: white;
}

.sidebar .btn.danger:hover {
    background: #d32f2f;
    box-shadow: 0 2px 8px rgba(244, 67, 54, 0.3);
}

.sidebar .btn.success {
    background: #4caf50;
    color: white;
}

.sidebar .btn.success:hover {
    background: #388e3c;
    box-shadow: 0 2px 8px rgba(76, 175, 80, 0.3);
}

/* ===== ESTADO SELECIONADO ===== */
#selected-state {
    background: #f5f5f5;
    padding: 10px 12px;
    border-radius: 4px;
    border-left: 3px solid #2196f3;
    font-size: 12px;
    line-height: 1.6;
}

#selected-state strong {
    display: block;
    color: #2196f3;
    margin-bottom: 4px;
}

/* ===== PROPRIEDADES DO AUTÔMATO ===== */
#automata-type,
#automata-name {
    font-size: 12px;
}

/* ===== SIMULADOR PAINEL ===== */
.simulator-panel {
    background: #f9f9f9;
    padding: 12px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.simulator-panel .sidebar-title {
    margin-bottom: 4px;
    padding-bottom: 6px;
}

/* ===== INPUT DE SIMULAÇÃO ===== */
.sim-input-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.sim-input-group.horizontal {
    flex-direction: row;
    gap: 4px;
}

#simInput {
    flex: 1;
    font-family: 'Courier New', monospace;
    font-size: 11px;
    padding: 8px 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

#simInput:focus {
    outline: none;
    border-color: #2196f3;
    box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.1);
}

#btnSimulate {
    white-space: nowrap;
    flex-shrink: 0;
    padding: 8px 12px;
    font-size: 12px;
}

/* ===== OUTPUT DE SIMULAÇÃO ===== */
.simulator-output {
    padding: 12px;
    background: white;
    border-radius: 4px;
    border-left: 4px solid #ccc;
    font-size: 12px;
    font-family: 'Courier New', monospace;
    color: #666;
    display: none;
    word-break: break-word;
    max-height: 100px;
    overflow-y: auto;
    line-height: 1.4;
}

.simulator-output.show {
    display: block;
    animation: slideInUp 0.3s ease;
}

.simulator-output.error {
    border-left-color: #f44336;
    color: #f44336;
    background: #ffebee;
}

.simulator-output.success {
    border-left-color: #4caf50;
    color: #4caf50;
    background: #e8f5e9;
}

.simulator-output.warning {
    border-left-color: #ff9800;
    color: #ff9800;
    background: #fff3e0;
}

.simulator-output.info {
    border-left-color: #2196f3;
    color: #2196f3;
    background: #e3f2fd;
}

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

/* ===== PASSO A PASSO DA SIMULAÇÃO ===== */
.sim-steps {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 120px;
    overflow-y: auto;
}

.sim-step {
    padding: 6px 8px;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 3px;
    font-size: 11px;
    font-family: 'Courier New', monospace;
}

.sim-step.current {
    background: #fffde7;
    border-color: #fbc02d;
    font-weight: 600;
}

.sim-step.accepted {
    background: #e8f5e9;
    border-color: #4caf50;
}

.sim-step.rejected {
    background: #ffebee;
    border-color: #f44336;
}

/* ===== AÇÕES RÁPIDAS ===== */
.quick-actions {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.quick-actions .btn {
    font-size: 11px;
    padding: 8px 10px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ===== ESTATÍSTICAS ===== */
.sidebar-stats {
    background: #f9f9f9;
    padding: 10px;
    border-radius: 4px;
    border: 1px solid #e0e0e0;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    margin: 4px 0;
}

.stat-label {
    color: #666;
    font-weight: 500;
}

.stat-value {
    color: #2196f3;
    font-weight: 600;
    font-family: 'Courier New', monospace;
}

/* ===== INFO BOX ===== */
.info-box {
    padding: 10px;
    background: #e3f2fd;
    border-left: 3px solid #2196f3;
    border-radius: 2px;
    font-size: 11px;
    color: #2196f3;
    line-height: 1.5;
}

.info-box.warning {
    background: #fff3e0;
    border-left-color: #ff9800;
    color: #ff9800;
}

.info-box.error {
    background: #ffebee;
    border-left-color: #f44336;
    color: #f44336;
}

.info-box.success {
    background: #e8f5e9;
    border-left-color: #4caf50;
    color: #4caf50;
}

/* ===== RESPONSIVE - TABLET ===== */
@media (max-width: 1024px) {
    .sidebar {
        width: 240px;
        padding: 12px;
        gap: 12px;
    }

    .sidebar-title {
        font-size: 12px;
    }

    .sidebar-label {
        font-size: 11px;
    }

    .sidebar-item input[type="text"],
    .sidebar-item textarea,
    .sidebar-item select {
        font-size: 11px;
        padding: 6px 8px;
    }
}

/* ===== RESPONSIVE - MOBILE ===== */
@media (max-width: 768px) {
    .sidebar {
        width: 100%;
        max-height: 35vh;
        border-left: none;
        border-top: 1px solid #e0e0e0;
        padding: 12px;
        gap: 12px;
        order: 3;
    }

    .sidebar-section {
        gap: 6px;
    }

    .sidebar-title {
        font-size: 11px;
        padding-bottom: 6px;
    }

    .sidebar-label {
        font-size: 10px;
    }

    .sidebar-item input[type="text"],
    .sidebar-item textarea,
    .sidebar-item select {
        font-size: 12px;
        padding: 8px 10px;
    }

    #selected-state {
        font-size: 11px;
        padding: 8px 10px;
    }

    .simulator-panel {
        padding: 10px;
        gap: 8px;
    }

    .simulator-output {
        font-size: 11px;
        padding: 10px;
        max-height: 60px;
    }

    .sim-input-group {
        gap: 4px;
    }

    .sim-input-group.horizontal {
        flex-direction: column;
    }

    .sim-input-group #btnSimulate {
        padding: 8px 10px;
        width: 100%;
    }

    .sidebar .btn {
        font-size: 11px;
        padding: 8px 10px;
    }
}

/* ===== RESPONSIVE - SMALL MOBILE ===== */
@media (max-width: 480px) {
    .sidebar {
        max-height: 30vh;
        padding: 10px;
    }

    .sidebar-section {
        gap: 6px;
        padding-bottom: 8px;
    }

    .sidebar-title {
        font-size: 10px;
        margin-bottom: 2px;
    }

    .sidebar-label {
        font-size: 9px;
    }

    .sidebar-item input[type="text"],
    .sidebar-item textarea,
    .sidebar-item select {
        font-size: 11px;
    }

    .simulator-panel {
        padding: 8px;
    }

    .simulator-output {
        font-size: 10px;
        padding: 8px;
    }

    #selected-state {
        font-size: 10px;
    }

    .sidebar .btn {
        font-size: 10px;
        padding: 6px 8px;
    }
}

/* ===== PRINT ===== */
@media print {
    .sidebar {
        display: none;
    }
}