/* ===== TOOLBAR CONTAINER ===== */
.toolbar {
    background: white;
    padding: 12px;
    border-right: 1px solid #e0e0e0;
    width: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow-y: auto;
    flex-shrink: 0;
}

.toolbar::-webkit-scrollbar {
    width: 4px;
}

.toolbar::-webkit-scrollbar-track {
    background: transparent;
}

.toolbar::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 2px;
}

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

/* ===== TOOLBAR BOTÕES ===== */
.toolbar-btn {
    padding: 10px 16px;
    border: 1px solid #ccc;
    background: white;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
    position: relative;
    color: #333;
    font-weight: 500;
    white-space: nowrap;
    min-width: 100px;
}

.toolbar-btn:hover {
    background: #e3f2fd;
    border-color: #2196f3;
    transform: translateY(-2px);
    color: #2196f3;
    box-shadow: 0 2px 6px rgba(33, 150, 243, 0.15);
}

.toolbar-btn:active {
    transform: translateY(0);
}

.toolbar-btn.active {
    background: #2196f3;
    color: white;
    border-color: #1976d2;
    box-shadow: 0 2px 8px rgba(33, 150, 243, 0.3);
}

.toolbar-btn.active:hover {
    background: #1976d2;
    box-shadow: 0 2px 12px rgba(33, 150, 243, 0.4);
}

/* ===== DIVISOR ===== */
.toolbar-divider {
    height: 1px;
    background: linear-gradient(to right, transparent, #ccc, transparent);
    margin: 4px 0;
    flex-shrink: 0;
}

.toolbar-divider.space {
    margin: 8px 0;
}

/* ===== GRUPOS DE BOTÕES ===== */
.toolbar-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 4px 0;
}

.toolbar-group:not(:last-child) {
    border-bottom: 1px solid #f0f0f0;
    padding-bottom: 8px;
    margin-bottom: 4px;
}

.toolbar-group-label {
    font-size: 9px;
    text-transform: uppercase;
    color: #999;
    letter-spacing: 0.5px;
    font-weight: 600;
    padding: 2px 6px;
    text-align: center;
}

/* ===== BOTÕES ESPECÍFICOS ===== */
#select-state-btn {
    background: linear-gradient(135deg, #e3f2fd 0%, #f0f7ff 100%);
}

#select-state-btn:hover {
    background: #bbdefb;
}

#select-state-btn.active {
    background: #2196f3;
    color: white;
}

#add-state-btn {
    background: linear-gradient(135deg, #e8f5e9 0%, #f4fbf4 100%);
}

#add-state-btn:hover {
    background: #c8e6c9;
}

#add-state-btn.active {
    background: #4caf50;
    color: white;
}

#add-transition-btn {
    background: linear-gradient(135deg, #f3e5f5 0%, #faf5fe 100%);
}

#add-transition-btn:hover {
    background: #e1bee7;
}

#add-transition-btn.active {
    background: #9c27b0;
    color: white;
}

/* ===== BOTÕES DE AÇÃO ===== */
#save-btn {
    background: linear-gradient(135deg, #e8f5e9 0%, #f1f8e9 100%);
}

#save-btn:hover {
    background: #c8e6c9;
}

#save-btn.active {
    background: #4caf50;
    color: white;
    border-color: #388e3c;
}

#load-btn {
    background: linear-gradient(135deg, #ede7f6 0%, #f8f5fc 100%);
}

#load-btn:hover {
    background: #d1c4e9;
}

#load-btn.active {
    background: #673ab7;
    color: white;
}

#clear-btn {
    background: linear-gradient(135deg, #fce4ec 0%, #fff3e0 100%);
}

#clear-btn:hover {
    background: #f8bbd0;
}

#clear-btn.active {
    background: #ff5722;
    color: white;
}

/* ===== ANIMAÇÕES PARA FEEDBACK ===== */
@keyframes buttonPulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

.toolbar-btn.pulse {
    animation: buttonPulse 0.4s ease-in-out;
}

@keyframes buttonBounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-2px);
    }
}

.toolbar-btn.bounce {
    animation: buttonBounce 0.3s ease-in-out;
}

/* ===== ESTADOS DE CARREGAMENTO ===== */
.toolbar-btn.loading {
    position: relative;
    color: transparent;
}

.toolbar-btn.loading::after {
    content: '';
    position: absolute;
    width: 14px;
    height: 14px;
    top: 50%;
    left: 50%;
    margin-left: -7px;
    margin-top: -7px;
    border: 2px solid rgba(33, 150, 243, 0.3);
    border-top-color: #2196f3;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ===== TOOLBAR HORIZONTAL (Mobile) ===== */
@media (max-width: 768px) {
    .toolbar {
        flex-direction: row;
        width: 100%;
        height: auto;
        border-right: none;
        border-bottom: 1px solid #e0e0e0;
        overflow-x: auto;
        overflow-y: hidden;
        padding: 8px;
        gap: 6px;
    }

    .toolbar-divider {
        width: 1px;
        height: 40px;
        margin: 0 4px;
    }

    .toolbar-btn {
        min-width: auto;
        font-size: 12px;
        padding: 8px 12px;
        border-radius: 4px;
    }

    .toolbar-group {
        flex-direction: row;
        gap: 2px;
    }

    .toolbar-group:not(:last-child) {
        border-right: 1px solid #f0f0f0;
        border-bottom: none;
        padding-right: 6px;
        margin-right: 6px;
    }

    .toolbar-group-label {
        display: none;
    }
}

@media (max-width: 480px) {
    .toolbar-btn {
        font-size: 11px;
        padding: 6px 10px;
    }

    .toolbar {
        padding: 6px;
        gap: 4px;
    }

    .toolbar-divider {
        margin: 0 2px;
        height: 34px;
    }
}

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