/* Alert Bandi - Frontend Styles */

:root {
    --primary: #2c3e50;
    --accent: #3498db;
    --success: #27ae60;
    --warning: #f39c12;
    --danger: #e74c3c;
    --light: #ecf0f1;
    --gray: #95a5a6;
}

/* Container principale */
.alert-bandi-container {
    max-width: 1200px;
    margin: 30px auto;
    padding: 0 15px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Header */
.alert-bandi-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    color: white;
    padding: 25px;
    border-radius: 8px;
    margin-bottom: 25px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.alert-bandi-header h2 {
    margin: 0 0 15px 0;
    font-size: 28px;
    font-weight: 700;
}

.user-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
}

.user-info span {
    display: block;
}

.access-status {
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    font-weight: 600;
}

.access-status .ok {
    color: #2ecc71;
}

.access-status .warning {
    color: #f1c40f;
}

/* Filtri */
.alert-bandi-filters {
    display: flex;
    gap: 15px;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

.alert-bandi-filters input,
.alert-bandi-filters select {
    flex: 1;
    min-width: 200px;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    background: white;
}

.alert-bandi-filters input:focus,
.alert-bandi-filters select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.alert-bandi-filters input::placeholder {
    color: #bbb;
}

/* Lista bandi */
.bandi-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
}

/* Card bando */
.bando-card {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.08);
}

.bando-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transform: translateY(-2px);
}

.bando-card.urgente {
    border-left: 5px solid var(--warning);
    background: #fffaf0;
}

.bando-header {
    padding: 15px;
    border-bottom: 1px solid #e0e0e0;
    background: #f9f9f9;
}

.bando-header h3 {
    margin: 0 0 10px 0;
    font-size: 18px;
    color: var(--primary);
    line-height: 1.4;
}

.categoria {
    display: inline-block;
    background: var(--accent);
    color: white;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.bando-details {
    padding: 15px;
}

.bando-details p {
    margin: 0 0 12px 0;
    font-size: 14px;
    line-height: 1.6;
}

.bando-details strong {
    color: var(--primary);
    display: block;
    margin-bottom: 4px;
}

.data-scadenza {
    font-weight: 600;
}

.urgenza {
    color: var(--warning);
    font-weight: 600;
}

.scaduto {
    color: var(--danger);
    font-weight: 600;
}

.descrizione {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #eee;
    font-size: 13px;
    color: #666;
    line-height: 1.6;
}

.bando-actions {
    padding: 15px;
    border-top: 1px solid #e0e0e0;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.bando-actions .button {
    flex: 1;
    min-width: 140px;
    padding: 10px 15px;
    background: var(--accent);
    color: white;
    text-decoration: none;
    border: none;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    transition: all 0.3s ease;
}

.bando-actions .button:hover {
    background: #2980b9;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(52, 152, 219, 0.4);
}

.bando-actions a.button {
    display: inline-block;
}

/* Messaggi */
.alert-bandi-message {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
    text-align: center;
}

.alert-bandi-message.error {
    border-left: 5px solid var(--danger);
    background: #fef5f5;
}

.alert-bandi-message.error p {
    margin: 10px 0;
    color: var(--danger);
}

.alert-bandi-message.expired {
    border-left: 5px solid var(--warning);
    background: #fffaf0;
}

.alert-bandi-message h3 {
    color: var(--warning);
    margin-top: 0;
}

.alert-bandi-message .button {
    background: var(--accent);
    color: white;
    padding: 10px 20px;
    border-radius: 4px;
    text-decoration: none;
    display: inline-block;
    margin-top: 10px;
}

.loading,
.no-results {
    text-align: center;
    padding: 40px;
    color: var(--gray);
    font-size: 16px;
}

/* Responsive */
@media (max-width: 768px) {
    .alert-bandi-header {
        padding: 15px;
    }
    
    .alert-bandi-header h2 {
        font-size: 22px;
    }
    
    .user-info {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }
    
    .alert-bandi-filters {
        flex-direction: column;
    }
    
    .alert-bandi-filters input,
    .alert-bandi-filters select {
        min-width: unset;
        width: 100%;
    }
    
    .bandi-list {
        grid-template-columns: 1fr;
    }
    
    .bando-actions {
        flex-direction: column;
    }
    
    .bando-actions .button {
        width: 100%;
    }
}

/* Status badges */
.status-attivo {
    color: var(--success);
    font-weight: 600;
}

.status-scaduto {
    color: var(--danger);
    font-weight: 600;
}

.giorni-rimanenti {
    display: inline-block;
    padding: 2px 8px;
    background: #e8f5e9;
    color: var(--success);
    border-radius: 3px;
    font-weight: 600;
    font-size: 12px;
}

.giorni-rimanenti.warning {
    background: #fff3e0;
    color: var(--warning);
}
