/**
 * Stili CSS per CmbAd - Cambio Password Dominio
 * IIS Alberghetti - Sistema di gestione utenti
 */

/* ===== RESET E BASE ===== */
* {
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f8f9fa;
    color: #333;
    line-height: 1.6;
}

/* ===== HEADER ===== */
.cmbad-header {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: white;
    padding: 1rem 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1rem;
}

.header-left img {
    height: 60px;
    width: auto;
}

.header-center {
    text-align: center;
    flex-grow: 1;
    margin: 0 2rem;
}

.header-center h1 {
    margin: 0;
    font-size: 1.8rem;
    font-weight: 600;
}

.header-center p {
    margin: 0.5rem 0 0 0;
    font-size: 0.9rem;
    opacity: 0.9;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-email {
    font-size: 0.9rem;
    opacity: 0.9;
}

/* ===== CONTAINER PRINCIPALE ===== */
.cmbad-container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1rem;
}

/* ===== CARD E SEZIONI ===== */
.cmbad-card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
    overflow: hidden;
}

.card-header {
    background: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    padding: 1rem 1.5rem;
}

.card-header h3 {
    margin: 0;
    color: #495057;
    font-size: 1.2rem;
}

.card-body {
    padding: 1.5rem;
}

/* ===== FORM STYLING ===== */
.form-section {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.form-section.bg-info {
    background: #d1ecf1;
    border-color: #bee5eb;
}

.form-section.bg-success {
    background: #d4edda;
    border-color: #c3e6cb;
}

.form-section.bg-warning {
    background: #fff3cd;
    border-color: #ffeaa7;
}

.form-section.bg-secondary {
    background: #e2e3e5;
    border-color: #d6d8db;
}

.form-section legend {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 0.5rem 1rem;
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 1rem;
    width: auto;
}

/* ===== FORM CONTROLS ===== */
.form-group {
    margin-bottom: 1rem;
}

.form-control {
    width: 100%;
    padding: 0.5rem 0.75rem;
    font-size: 1rem;
    border: 1px solid #ced4da;
    border-radius: 4px;
    background-color: #fff;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-control:focus {
    border-color: #80bdff;
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(0,123,255,0.25);
}

.form-control:disabled,
.form-control[readonly] {
    background-color: #e9ecef;
    opacity: 1;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #495057;
}

.control-label {
    font-weight: 600;
}

/* ===== BUTTONS ===== */
.btn {
    display: inline-block;
    padding: 0.5rem 1rem;
    font-size: 1rem;
    font-weight: 400;
    text-align: center;
    text-decoration: none;
    border: 1px solid transparent;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s ease-in-out;
}

.btn-primary {
    background-color: #007bff;
    border-color: #007bff;
    color: white;
}

.btn-primary:hover {
    background-color: #0056b3;
    border-color: #004085;
}

.btn-success {
    background-color: #28a745;
    border-color: #28a745;
    color: white;
}

.btn-success:hover {
    background-color: #1e7e34;
    border-color: #1c7430;
}

.btn-danger {
    background-color: #dc3545;
    border-color: #dc3545;
    color: white;
}

.btn-danger:hover {
    background-color: #c82333;
    border-color: #bd2130;
}

.btn-outline-light {
    border-color: rgba(255,255,255,0.5);
    color: white;
}

.btn-outline-light:hover {
    background-color: rgba(255,255,255,0.1);
    border-color: white;
}

.btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
}

/* ===== GRID SYSTEM ===== */
.row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -0.5rem;
}

.col-6 {
    flex: 0 0 50%;
    max-width: 50%;
    padding: 0 0.5rem;
}

.col-4 {
    flex: 0 0 33.333333%;
    max-width: 33.333333%;
    padding: 0 0.5rem;
}

.col-8 {
    flex: 0 0 66.666667%;
    max-width: 66.666667%;
    padding: 0 0.5rem;
}

.col-12 {
    flex: 0 0 100%;
    max-width: 100%;
    padding: 0 0.5rem;
}

/* ===== ALERTS ===== */
.alert {
    padding: 0.75rem 1.25rem;
    margin-bottom: 1rem;
    border: 1px solid transparent;
    border-radius: 4px;
}

.alert-success {
    color: #155724;
    background-color: #d4edda;
    border-color: #c3e6cb;
}

.alert-danger {
    color: #721c24;
    background-color: #f8d7da;
    border-color: #f5c6cb;
}

.alert-info {
    color: #0c5460;
    background-color: #d1ecf1;
    border-color: #bee5eb;
}

.alert-warning {
    color: #856404;
    background-color: #fff3cd;
    border-color: #ffeaa7;
}

/* ===== LISTA RICHIESTE ===== */
.richieste-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.richiesta-item {
    display: flex;
    align-items: center;
    padding: 0.75rem;
    border-bottom: 1px solid #dee2e6;
    background: white;
}

.richiesta-item:last-child {
    border-bottom: none;
}

.richiesta-info {
    flex-grow: 1;
    margin-left: 0.5rem;
}

.richiesta-actions {
    margin-left: auto;
}

.delete-link {
    color: #dc3545;
    text-decoration: none;
    font-size: 1.2rem;
    padding: 0.25rem;
}

.delete-link:hover {
    color: #c82333;
}

/* ===== AUTENTICAZIONE ===== */
.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60vh;
}

.auth-card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    padding: 2rem;
    max-width: 400px;
    width: 100%;
    text-align: center;
}

.auth-card h2 {
    margin-bottom: 1rem;
    color: #495057;
}

/* ===== FOOTER ===== */
.cmbad-footer {
    background: #343a40;
    color: white;
    text-align: center;
    padding: 2rem 0;
    margin-top: 3rem;
}

.cmbad-footer p {
    margin: 0.25rem 0;
    font-size: 0.9rem;
}

/* ===== SEARCH INPUT ===== */
.search-input {
    position: relative;
}

.search-input input {
    padding-left: 2.5rem;
}

.search-input::before {
    content: "🔍";
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: #6c757d;
    z-index: 1;
}

/* Stile per opzioni nascoste */
option[style*="display: none"] {
    display: none !important;
}

/* Evidenzia il campo di ricerca quando attivo */
input[id*="search"]:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0,123,255,0.25);
}

/* ===== MESSAGGI INFORMATIVI ===== */
.text-info {
    color: #17a2b8 !important;
}

.text-success {
    color: #28a745 !important;
}

.text-warning {
    color: #ffc107 !important;
}

small.text-info,
small.text-success,
small.text-warning {
    font-weight: 500;
    display: block;
    margin-top: 0.25rem;
}

/* ===== PULSANTI ATTIVI ===== */
.btn-success {
    background-color: #28a745;
    border-color: #28a745;
    font-weight: 600;
}

.btn-success:hover {
    background-color: #218838;
    border-color: #1e7e34;
}

/* ===== UTILITIES ===== */
.clearfix::after {
    content: "";
    display: table;
    clear: both;
}

.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 1rem; }
.mt-4 { margin-top: 1.5rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 1.5rem; }

.d-none { display: none; }
.d-block { display: block; }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        text-align: center;
    }
    
    .header-center {
        margin: 1rem 0;
    }
    
    .header-right {
        justify-content: center;
    }
    
    .row {
        flex-direction: column;
    }
    
    .col-4, .col-6, .col-8 {
        flex: 0 0 100%;
        max-width: 100%;
        margin-bottom: 1rem;
    }
    
    .cmbad-container {
        padding: 0 0.5rem;
    }
}

/* ===== LOADING SPINNER ===== */
.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #007bff;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 2s linear infinite;
    margin: 1rem auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ===== ICONE ===== */
.icon {
    display: inline-block;
    width: 1em;
    height: 1em;
    vertical-align: middle;
}

.icon-trash::before {
    content: "🗑️";
}

.icon-user::before {
    content: "👤";
}

.icon-email::before {
    content: "📧";
}
