/* File: frontend/html/css/components.css */
/* Cards, buttons e componenti riutilizzabili - SEMPLIFICATO */

/* Cards */
.card {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    border: 1px solid #e1e8ed;
    margin-bottom: 2rem;
}

.card h3 {
    margin-bottom: 1.5rem;
    color: #2c3e50;
    font-weight: 400;
}

.add-transaction-card {
    max-width: none;
    width: 100%;
}

.transactions-card {
    width: 100%;
}

/* Buttons */
button {
    background: #3498db;
    color: white;
    border: none;
    padding: 0.75rem 2rem;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

button:hover {
    background: #2980b9;
}

button:disabled {
    background: #bdc3c7;
    cursor: not-allowed;
}

/* Action buttons in tables */
.action-btn {
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    padding: 0;
    transition: all 0.2s ease;
}

.edit-btn {
    background-color: #2196f3;
    color: white;
}

.edit-btn:hover {
    background-color: #1976d2;
}

.save-btn {
    background-color: #4caf50;
    color: white;
}

.save-btn:hover {
    background-color: #388e3c;
}

.delete-btn {
    background-color: #f44336;
    color: white;
}

.delete-btn:hover {
    background-color: #d32f2f;
}

/* Icons usando Unicode */
.icon-edit::before {
    content: "✏";
}

.icon-save::before {
    content: "✓";
}

.icon-delete::before {
    content: "🗑";
}

.icon-trash::before {
    content: "🗑";
}

/* Period total container */
.period-total-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    min-height: 48px;
}

.period-total {
    color: #2c3e50;
    flex: 0 0 auto;
}

.period-total h2 {
    font-size: 1.5rem;
    font-weight: 500;
    margin: 0;
}

.total-amount {
    font-weight: 600;
}

.total-amount.positive {
    color: #27ae60;
}

.total-amount.negative {
    color: #e74c3c;
}

/* Inline bulk actions */
.bulk-actions-inline {
    display: none;
    align-items: center;
    gap: 1rem;
    color: #666;
    font-size: 0.9rem;
    flex: 0 0 auto;
}

.bulk-actions-inline.show {
    display: flex;
}

.bulk-actions-inline .selected-count {
    color: #666;
    font-weight: 500;
}

.bulk-clear-btn-inline,
.bulk-delete-btn-inline {
    border: none;
    padding: 0.4rem 0.8rem;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    font-weight: 500;
    transition: background-color 0.2s ease;
    color: white;
    min-width: 160px; /* Aumentato da 140px a 160px */
    justify-content: center;
}

.bulk-clear-btn-inline {
    background-color: #3498db;
}

.bulk-clear-btn-inline:hover {
    background-color: #2980b9;
}

.bulk-delete-btn-inline {
    background-color: #f44336;
}

.bulk-delete-btn-inline:hover {
    background-color: #d32f2f;
}

/* Autocomplete */
.autocomplete-container {
    position: relative;
}

.autocomplete-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #ddd;
    border-top: none;
    border-radius: 0 0 4px 4px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
}

.autocomplete-suggestions.show {
    display: block;
}

.suggestion-item {
    padding: 0.75rem;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.2s ease;
}

.suggestion-item:hover,
.suggestion-item.selected {
    background-color: #f8f9fa;
}

.suggestion-item:last-child {
    border-bottom: none;
}

/* Responsive per bulk actions */
@media (max-width: 768px) {
    .period-total-container {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
        min-height: auto;
    }

    .bulk-actions-inline {
        font-size: 0.85rem;
        justify-content: flex-start;
        width: 100%;
    }

    .bulk-clear-btn-inline,
    .bulk-delete-btn-inline {
        padding: 0.3rem 0.6rem;
        font-size: 0.8rem;
        min-width: 120px;
    }
}