/* style.css - Rho Soccorso Reset Password System */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
}

:root {
    --primary: #0066cc;
    --primary-dark: #004c99;
    --primary-light: #e6f0ff;
    --secondary: #6c757d;
    --success: #28a745;
    --success-light: #d4edda;
    --danger: #dc3545;
    --danger-light: #f8d7da;
    --warning: #ffc107;
    --warning-light: #fff3cd;
    --info: #17a2b8;
    --info-light: #d1ecf1;
    --purple: #6f42c1;
    --purple-light: #e2d9f3;
    --dark: #343a40;
    --gray: #6c757d;
    --gray-light: #f8f9fa;
    --border: #dee2e6;
    --test: #ff9800;
    --test-light: #fff3e0;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.07), 0 1px 3px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
    --radius: 12px;
    --radius-sm: 8px;
}

body {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.app-container {
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
}

.glass-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.header {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    padding: 24px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    animation: rotate 20s linear infinite;
}

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

.header h1 {
    font-size: clamp(1.5rem, 5vw, 2rem);
    font-weight: 700;
    margin-bottom: 8px;
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.header p {
    font-size: clamp(0.875rem, 3vw, 1rem);
    opacity: 0.95;
    position: relative;
    z-index: 1;
}

.test-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--test);
    color: white;
    padding: 6px 12px;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 600;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.content {
    padding: 24px;
}

/* Messaggi */
.message {
    padding: 16px 20px;
    border-radius: var(--radius-sm);
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    animation: slideIn 0.3s ease;
    border-left: 4px solid;
}

.message i {
    font-size: 1.25rem;
}

.message.success {
    background: var(--success-light);
    color: #155724;
    border-left-color: var(--success);
}

.message.error {
    background: var(--danger-light);
    color: #721c24;
    border-left-color: var(--danger);
}

.message.test {
    background: var(--test-light);
    color: #856404;
    border-left-color: var(--test);
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Form e input moderni */
.form-container {
    background: white;
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--dark);
    font-size: 0.9rem;
    letter-spacing: 0.3px;
}

.input-wrapper {
    position: relative;
}

.input-wrapper i {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray);
    font-size: 1rem;
}

input[type="text"],
input[type="email"],
input[type="password"],
textarea,
select {
    width: 100%;
    padding: 14px 16px 14px 48px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    transition: all 0.3s ease;
    background: white;
}

textarea {
    padding-left: 16px;
    resize: vertical;
    min-height: 80px;
}

input:focus,
textarea:focus,
select:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 4px rgba(0, 102, 204, 0.1);
}

/* Button moderni */
.btn {
    padding: 14px 28px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
    color: white;
    background: var(--primary);
    border: 2px solid transparent;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    background: var(--primary-dark);
}

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

.btn-secondary {
    background: var(--secondary);
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn-success {
    background: var(--success);
}

.btn-success:hover {
    background: #218838;
}

.btn-danger {
    background: var(--danger);
}

.btn-danger:hover {
    background: #c82333;
}

.btn-info {
    background: var(--info);
}

.btn-info:hover {
    background: #138496;
}

.btn-email {
    background: var(--purple);
}

.btn-email:hover {
    background: #5a32a3;
}

.btn-test {
    background: var(--test);
}

.btn-test:hover {
    background: #f57c00;
}

.btn-outline {
    background: transparent;
    color: var(--primary);
    border-color: var(--primary);
}

.btn-outline:hover {
    background: var(--primary);
    color: white;
}

/* Stats cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: linear-gradient(135deg, white, var(--gray-light));
    padding: 20px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    text-align: center;
    transition: transform 0.3s ease;
    border: 1px solid rgba(0,0,0,0.05);
}

.stat-card:hover {
    transform: translateY(-4px);
}

.stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 8px;
}

.stat-label {
    color: var(--gray);
    font-size: 0.875rem;
    font-weight: 500;
}

/* Admin bar */
.admin-bar {
    background: var(--gray-light);
    padding: 16px 20px;
    border-radius: var(--radius);
    margin-bottom: 24px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    border: 1px solid var(--border);
}

.admin-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.admin-badge {
    background: var(--primary);
    color: white;
    padding: 6px 12px;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.test-badge-admin {
    background: var(--test);
    color: white;
    padding: 6px 12px;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.admin-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.admin-actions .btn {
    padding: 10px 20px;
}

/* Bulk actions */
.bulk-actions {
    background: var(--gray-light);
    padding: 20px;
    border-radius: var(--radius);
    margin-bottom: 24px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 20px;
    border: 1px solid var(--border);
}

.bulk-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    flex: 1;
}

.bulk-select, .bulk-input {
    padding: 10px 16px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    min-width: 180px;
    flex: 1 1 auto;
}

/* Tabella moderna */
.table-container {
    overflow-x: auto;
    margin: 20px 0;
    border-radius: var(--radius);
    background: white;
    box-shadow: var(--shadow);
}

.requests-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    min-width: 800px;
}

.requests-table th {
    background: var(--gray-light);
    color: var(--dark);
    font-weight: 600;
    padding: 16px 12px;
    text-align: left;
    border-bottom: 2px solid var(--border);
    white-space: nowrap;
}

.requests-table td {
    padding: 16px 12px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

.requests-table tr {
    transition: background 0.2s ease;
}

.requests-table tbody tr:hover {
    background: var(--primary-light);
}

.status-select {
    padding: 8px 12px;
    border-radius: 50px;
    border: 2px solid transparent;
    font-weight: 600;
    cursor: pointer;
    background: white;
    transition: all 0.2s;
}

.status-si {
    background: var(--success-light);
    color: #155724;
    border-color: var(--success);
}

.status-no {
    background: var(--danger-light);
    color: #721c24;
    border-color: var(--danger);
}

.editable-field, .note-field {
    padding: 8px 12px;
    border: 2px solid transparent;
    border-radius: var(--radius-sm);
    width: 100%;
    background: transparent;
    transition: all 0.2s;
}

.editable-field:hover, .note-field:hover {
    background: white;
    border-color: var(--border);
}

.editable-field:focus, .note-field:focus {
    background: white;
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

.note-field {
    min-width: 150px;
    resize: vertical;
}

.action-buttons {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.action-buttons .btn {
    padding: 8px 12px;
    font-size: 0.85rem;
}

/* Checkbox status per i nuovi campi Gestione in corso e Chiuso */
.status-checkbox {
    width: 24px;
    height: 24px;
    cursor: pointer;
    accent-color: var(--success);
    transition: all 0.2s ease;
}

.status-checkbox.status-si {
    accent-color: var(--success);
}

.status-checkbox.status-no {
    accent-color: var(--danger);
}

.checkbox-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Checkbox personalizzati (per selezione righe) */
.checkbox-wrapper input[type="checkbox"]:not(.status-checkbox) {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: var(--primary);
}

/* Modal moderno */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.modal-content {
    background: white;
    padding: 32px;
    border-radius: var(--radius);
    max-width: 600px;
    width: 100%;
    box-shadow: var(--shadow-lg);
    animation: modalSlide 0.3s ease;
}

@keyframes modalSlide {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal h3 {
    font-size: 1.5rem;
    margin-bottom: 16px;
    color: var(--dark);
}

.modal p {
    margin-bottom: 12px;
    color: var(--gray);
}

.modal pre {
    background: var(--gray-light);
    padding: 16px;
    border-radius: var(--radius-sm);
    margin: 16px 0;
    white-space: pre-wrap;
    word-wrap: break-word;
    max-height: 300px;
    overflow-y: auto;
}

.modal-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 20px;
}

.footer {
    text-align: center;
    padding: 24px;
    background: linear-gradient(135deg, #1a2634, #0d1a2b);
    margin-top: 24px;
    color: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border-top: 1px solid rgba(255,255,255,0.1);
}

.footer p {
    margin: 8px 0;
    color: rgba(255, 255, 255, 0.95);
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

.footer i {
    margin: 0 4px;
    color: #ffd700;
}

.version-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255,255,255,0.15);
    padding: 6px 16px;
    border-radius: 50px;
    font-weight: 600;
    border: 1px solid rgba(255,255,255,0.2);
    backdrop-filter: blur(5px);
    margin: 0 4px;
}

.footer .stats-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(0,102,204,0.3);
    padding: 4px 12px;
    border-radius: 50px;
    font-size: 0.8rem;
    border: 1px solid rgba(255,255,255,0.1);
}

/* Mobile Optimization */
@media (max-width: 768px) {
    body {
        padding: 8px;
    }

    .content {
        padding: 16px;
    }

    .admin-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .admin-info {
        justify-content: center;
    }

    .admin-actions {
        justify-content: center;
    }

    .bulk-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .bulk-controls {
        flex-direction: column;
    }

    .bulk-select, .bulk-input {
        width: 100%;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .stat-card {
        padding: 16px;
    }

    .stat-number {
        font-size: 1.5rem;
    }

    .table-container {
        margin: 16px -16px;
        border-radius: 0;
        width: calc(100% + 32px);
    }

    .action-buttons {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .modal-content {
        padding: 24px;
    }

    .modal-actions {
        flex-direction: column;
    }

    .modal-actions .btn {
        width: 100%;
    }

    .requests-table th, 
    .requests-table td {
        padding: 12px 8px;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .btn {
        padding: 12px 20px;
    }

    .header h1 {
        font-size: 1.25rem;
    }

    .checkbox-wrapper {
        font-size: 0.85rem;
    }

    .action-buttons .btn {
        font-size: 0.8rem;
        padding: 6px 10px;
    }
}

/* Loading animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

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

/* Tooltips */
[data-tooltip] {
    position: relative;
    cursor: help;
}

[data-tooltip]:before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 6px 12px;
    background: var(--dark);
    color: white;
    font-size: 0.8rem;
    border-radius: 4px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s;
    z-index: 10;
}

[data-tooltip]:hover:before {
    opacity: 1;
    visibility: visible;
    bottom: 120%;
}