/* css/components/_buttons.css */

/* === BUTTON SYSTEM BASE === */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    gap: 0.5rem;
    line-height: 1.2;
    text-decoration: none !important;
    white-space: nowrap;
}

.btn:active { transform: scale(0.97); }
.btn:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.3); }
.btn:disabled, .btn[disabled] { opacity: 0.6; cursor: not-allowed; transform: none !important; box-shadow: none !important; }

/* === VARIANTI COLORE === */

/* Primary (Action) */
.btn-primary { 
    background-color: var(--primary-color); 
    color: #ffffff; 
    box-shadow: 0 2px 4px rgba(0, 102, 204, 0.2); 
}
.btn-primary:hover { 
    background-color: var(--primary-hover); 
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 102, 204, 0.3); 
}

/* Secondary (Neutral/Cancel) */
.btn-secondary { 
    background-color: transparent; 
    border-color: var(--border-color); 
    color: var(--text-color); 
}
.btn-secondary:hover { 
    background-color: var(--input-bg-color); 
    border-color: var(--secondary-color);
    color: var(--text-color);
}

/* Success (Save/Confirm) */
.btn-success { 
    background-color: var(--success-color); 
    color: white; 
    box-shadow: 0 2px 4px rgba(16, 185, 129, 0.2);
}
.btn-success:hover { 
    filter: brightness(0.95); 
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(16, 185, 129, 0.3);
}

/* Danger (Delete/Alert) */
.btn-danger { 
    background-color: var(--danger-color); 
    color: white; 
    box-shadow: 0 2px 4px rgba(239, 68, 68, 0.2);
}
.btn-danger:hover { 
    filter: brightness(0.95); 
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(239, 68, 68, 0.3);
}

/* Utility Sizes */
.btn-sm { 
    padding: 0.4rem 0.8rem; 
    font-size: 0.85rem; 
    border-radius: 6px; 
}

.btn-lg { 
    padding: 0.8rem 1.8rem; 
    font-size: 1.1rem; 
    border-radius: 10px; 
}

/* === ICON BUTTONS (Theme Toggle, Collapse) === */
.icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid transparent;
    cursor: pointer;
    width: 40px; height: 40px;
    border-radius: 50%; /* Cerchio perfetto */
    color: var(--secondary-color);
    font-size: 1.1rem;
    transition: all 0.2s ease;
}

.icon-btn:hover {
    background-color: var(--input-bg-color);
    color: var(--primary-color);
    transform: rotate(15deg); /* Effetto rotazione simpatico */
}

/* === TOGGLE GROUP (Language Selector) === */
/* Correzione specifica per i tasti IT/EN dell'header */
.toggle-group {
    display: flex;
    background-color: var(--input-bg-color); /* Sfondo grigio chiaro contenitore */
    padding: 4px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    gap: 2px;
}

.toggle-btn {
    background: transparent;
    border: none;
    border-radius: 6px;
    padding: 4px 12px;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--secondary-color);
    cursor: pointer;
    transition: all 0.2s ease;
}

.toggle-btn:hover {
    color: var(--text-color);
}

/* Stato Attivo (Gestito da JS) */
.toggle-btn.active {
    background-color: var(--card-bg-color); /* Bianco/Scuro */
    color: var(--primary-color);
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* === ACTION BUTTONS (Table/List Actions) === */
.btn-remove, .btn-remove-small, .btn-delete, .btn-duplicate, .remove-item-btn {
    background: none; border: none; cursor: pointer;
    padding: 4px 8px; border-radius: 4px;
    transition: background 0.2s;
    font-size: 1rem; color: var(--secondary-color);
}
.btn-remove:hover, .btn-remove-small:hover, .btn-delete:hover {
    background: #fee2e2; color: var(--danger-color);
}
.btn-duplicate:hover {
    background: #e0f2fe; color: var(--primary-color);
}