/* Stili specifici per la pagina Profilo */

.profile-card {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    padding: 2rem;
    margin-bottom: 2rem;
}

.profile-header {
    display: flex;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid #ecf0f1;
}

.profile-avatar {
    margin-right: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-avatar-large {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.3);
    border: 3px solid rgba(255, 255, 255, 0.5);
}

.user-initial-large {
    font-size: 3rem;
    font-weight: 700;
    color: white;
    text-transform: uppercase;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.profile-info h3 {
    margin: 0;
    color: #2c3e50;
    font-size: 1.5rem;
}

.profile-info p {
    margin: 0.5rem 0 0 0;
    color: #7f8c8d;
}

/* Statistiche Account */
.account-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.stat-item i {
    font-size: 2rem;
    color: #667eea;
}

.stat-content {
    display: flex;
    flex-direction: column;
}

.stat-label {
    font-size: 0.9rem;
    color: #7f8c8d;
}

.stat-value {
    font-size: 1.1rem;
    font-weight: 600;
    color: #2c3e50;
}

/* Sezioni del profilo */
.profile-section {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    padding: 2rem;
    margin-bottom: 2rem;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.section-header h3 {
    margin: 0;
    color: #2c3e50;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.backup-tooltip {
    font-size: 1rem;
    color: #667eea;
    margin-left: 0.5rem;
    cursor: help;
    position: relative;
    opacity: 0.7;
}

.backup-tooltip:hover {
    color: #667eea;
    opacity: 1;
}

.backup-tooltip::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 150%;
    left: 50%;
    transform: translateX(-50%);
    background: #2c3e50;
    color: white;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 0.8rem;
    white-space: nowrap;
    max-width: 300px;
    white-space: normal;
    width: 280px;
    text-align: left;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
    z-index: 1000;
    line-height: 1.4;
}

.backup-tooltip::after {
    content: '';
    position: absolute;
    bottom: 140%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: #2c3e50;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
    z-index: 1000;
}

.backup-tooltip:hover::before,
.backup-tooltip:hover::after {
    opacity: 1;
    visibility: visible;
}

/* Form del profilo */
.profile-form {
    margin-top: 1.5rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #2c3e50;
}

.form-group input {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

.form-group input:focus {
    border-color: #667eea;
    outline: none;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

.form-group input[readonly] {
    background-color: #f8f9fa;
    cursor: not-allowed;
}

.form-group small {
    display: block;
    margin-top: 0.3rem;
    color: #7f8c8d;
    font-size: 0.85rem;
}

/* Display delle informazioni */
.info-display {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.info-row {
    display: flex;
    padding: 0.8rem 0;
    border-bottom: 1px solid #ecf0f1;
}

.info-row:last-child {
    border-bottom: none;
}

.info-label {
    font-weight: 500;
    color: #7f8c8d;
    width: 120px;
}

.info-value {
    color: #2c3e50;
    flex: 1;
    min-width: 0;
    overflow-wrap: break-word;
    word-break: break-word;
}

/* Informazioni sicurezza */
.security-info {
    background-color: #f8f9fa;
    border-radius: 4px;
    padding: 1.5rem;
    margin-top: 1rem;
}

.security-info p {
    margin: 0.5rem 0;
    color: #7f8c8d;
}

.security-info i {
    color: #667eea;
    margin-right: 0.5rem;
}

.danger-actions {
    display: flex;
    gap: 1rem;
    margin: 1.5rem 0;
}

/* Bottoni */
.btn {
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary {
    background-color: #667eea;
    color: white;
}

.btn-primary:hover {
    background-color: #667eea;
}

.btn-secondary {
    background-color: #ecf0f1;
    color: #7f8c8d;
}

.btn-secondary:hover {
    background-color: #dfe6e9;
}

.btn-danger {
    background-color: #e74c3c;
    color: white;
}

.btn-danger:hover {
    background-color: #c0392b;
}

.btn-danger:disabled {
    background-color: #95a5a6;
    cursor: not-allowed;
    opacity: 0.6;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid #ecf0f1;
}

/* Responsive */
@media (max-width: 768px) {
    .profile-header {
        flex-direction: column;
        text-align: center;
    }

    .profile-avatar {
        margin-right: 0;
        margin-bottom: 1rem;
        align-self: center;
    }

    .account-stats {
        grid-template-columns: 1fr;
    }

    .info-row {
        flex-direction: column;
        gap: 0.25rem;
    }

    .info-label {
        width: auto;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

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

    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .backup-item {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
    }
    
    .backup-actions {
        width: 100%;
        justify-content: stretch;
        gap: 8px;
    }
    
    .backup-actions .btn {
        flex: 1;
        min-width: 0;
        padding: 8px 6px;
        font-size: 0.75rem;
    }
    
    .backup-actions .btn i {
        font-size: 1rem;
    }
    
    .backup-actions .btn .btn-text {
        display: none;
    }
}

/* Responsive per tablet */
@media (max-width: 1024px) and (min-width: 769px) {
    .backup-actions .btn {
        padding: 6px 8px;
        font-size: 0.8rem;
    }
}

/* Sezione Backup */
.backup-info {
    background: #e0e7ff;
    border-left: 4px solid #667eea;
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 6px;
}

.backup-info p {
    margin: 0 0 8px 0;
    color: #064e5a;
}

.backup-info p:last-child {
    margin-bottom: 0;
}

.backup-controls {
    margin-bottom: 20px;
    text-align: right;
}

.backup-list-container {
    min-height: 200px;
    max-height: 500px;
    overflow-y: auto;
}

.backup-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.backup-item {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 16px;
    transition: all 0.2s ease;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 15px;
    min-height: auto;
}

.backup-item:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

.backup-item.backup-today {
    border-color: #667eea;
    background: linear-gradient(135deg, #f8fff9 0%, #e8f5e8 100%);
}

.backup-info {
    flex: 1;
    min-width: 0;
}

.backup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.backup-header h4 {
    margin: 0;
    color: #2c3e50;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
}

.backup-size {
    background: #6c757d;
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
}

.backup-details {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.backup-filename {
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    color: #6c757d;
    word-break: break-all;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.backup-datetime {
    font-size: 0.8rem;
    color: #95a5a6;
}

.backup-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
    flex-wrap: wrap;
}

.backup-actions .btn {
    padding: 6px 10px;
    font-size: 0.8rem;
    white-space: nowrap;
    min-width: 70px;
    text-align: center;
}

.backup-actions .btn-danger {
    background-color: #e74c3c;
    color: white;
    border: 1px solid #c0392b;
}

.backup-actions .btn-danger:hover {
    background-color: #c0392b;
    transform: translateY(-1px);
}

.no-backups {
    text-align: center;
    padding: 40px 20px;
    color: #6c757d;
}

.no-backups i {
    font-size: 3rem;
    margin-bottom: 15px;
    opacity: 0.5;
}

.no-backups p {
    margin: 0 0 8px 0;
    font-size: 1.1rem;
    font-weight: 500;
}

.no-backups small {
    font-size: 0.9rem;
    opacity: 0.8;
}

.loading-backup {
    text-align: center;
    padding: 40px 20px;
    color: #6c757d;
}

.loading-backup .spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

/* Modal specifico per backup */
.backup-restore-modal .modal-content {
    max-width: 500px;
}

.warning-message {
    background: #fff3cd;
    border: 1px solid #ffeeba;
    border-radius: 6px;
    padding: 15px;
    margin-bottom: 15px;
}

.warning-message p {
    margin: 0 0 8px 0;
    color: #856404;
}

.warning-message p:last-child {
    margin-bottom: 0;
}

.backup-info-restore {
    background: #f8f9fa;
    padding: 10px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    color: #495057;
    margin: 15px 0;
}

.confirmation-checkbox {
    background: #fff3cd;
    border: 1px solid #ffeeba;
    border-radius: 6px;
    padding: 15px;
    margin-top: 15px;
}

.confirmation-checkbox label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 0;
    cursor: pointer;
    font-weight: 500;
    color: #856404;
}

.confirmation-checkbox input[type="checkbox"] {
    margin-top: 2px;
    transform: scale(1.2);
}

.warning-message ul {
    margin: 10px 0;
    padding-left: 20px;
}

.warning-message li {
    margin-bottom: 8px;
    line-height: 1.4;
}

.btn-disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Notifiche backup */
.backup-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1050;
    min-width: 300px;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    animation: slideInRight 0.3s ease;
}

.backup-notification.success {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #064e5a;
}

.backup-notification.error {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.notification-content {
    display: flex;
    align-items: center;
    gap: 10px;
}

.notification-content i {
    font-size: 1.2rem;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Stili per la sezione Piani di Abbonamento */
.plan-display {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.current-plan {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 8px;
    border-left: 4px solid #667eea;
}

.plan-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.plan-label {
    font-weight: 500;
    color: #7f8c8d;
}

.plan-value {
    font-size: 1.2rem;
    font-weight: 600;
    color: #2c3e50;
    text-transform: capitalize;
}

.plan-status .status-active {
    background: #667eea;
    color: white;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
}

.plan-details {
    padding: 1rem 0;
}

.plan-description {
    color: #7f8c8d;
    margin: 0;
}

/* Modal per selezione piano */
.modal-large {
    max-width: 900px;
}

.plans-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin: 1rem 0;
}

.plan-card {
    background: white;
    border: 2px solid #ecf0f1;
    border-radius: 12px;
    padding: 2rem;
    transition: all 0.3s ease;
    position: relative;
    display: flex;
    flex-direction: column;
}

.plan-card:hover {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    transform: translateY(-5px);
}

.plan-card.plan-recommended {
    border-color: #667eea;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fb 100%);
}

.plan-card.plan-disabled {
    opacity: 0.6;
    background: #f8f9fa;
}

.plan-badge {
    position: absolute;
    top: -10px;
    right: 20px;
    background: #667eea;
    color: white;
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.plan-header {
    text-align: center;
    margin-bottom: 2rem;
}

.plan-header h4 {
    margin: 0 0 1rem 0;
    font-size: 1.5rem;
    color: #2c3e50;
}

.plan-price {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 0.3rem;
}

.plan-price .price {
    font-size: 2.5rem;
    font-weight: 700;
    color: #667eea;
}

.plan-price .period {
    font-size: 1rem;
    color: #7f8c8d;
}

.plan-features {
    flex: 1;
    margin-bottom: 2rem;
}

.plan-features ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.plan-features li {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.8rem 0;
    border-bottom: 1px solid #f8f9fa;
}

.plan-features li:last-child {
    border-bottom: none;
}

.plan-features li i {
    color: #667eea;
    font-size: 1.1rem;
    width: 20px;
    text-align: center;
}

.plan-features li i.fa-info-circle {
    color: #f39c12;
}

.plan-select-btn {
    width: 100%;
    padding: 1rem;
    font-size: 1.1rem;
    font-weight: 600;
    text-align: center;
}

.btn-disabled {
    background: #95a5a6 !important;
    color: white !important;
    cursor: not-allowed !important;
}

/* Modal pagamento */
.payment-info {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    border-left: 4px solid #667eea;
}

.payment-info p {
    margin: 0.5rem 0;
    color: #2c3e50;
}

.payment-details {
    margin-top: 1.5rem;
    padding: 1.5rem;
    background: #f8f9fa;
    border-radius: 8px;
}

.payment-details input {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

.payment-details select {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    background: white;
}

.payment-details input:focus,
.payment-details select:focus {
    border-color: #667eea;
    outline: none;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

/* Responsive per piani */
@media (max-width: 768px) {
    .plans-grid {
        grid-template-columns: 1fr;
    }
    
    .current-plan {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }
    
    .plan-info {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .modal-large {
        max-width: 95%;
    }
}

/* Backup Note Styles */
.backup-note {
    margin-top: 15px;
    padding: 12px;
    background: #f8f9fa;
    border-left: 4px solid #667eea;
    border-radius: 6px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 14px;
}

.backup-note .note-icon {
    color: #667eea;
    font-size: 16px;
    margin-top: 2px;
    flex-shrink: 0;
}

.backup-note .note-text {
    color: #495057;
    line-height: 1.4;
    word-wrap: break-word;
    flex: 1;
    font-style: italic;
}

.backup-item:hover .backup-note {
    background: #e8f5e8;
}

.backup-item.backup-with-note {
    border-left: 4px solid #667eea;
}

.backup-time {
    font-size: 0.9rem;
    color: #6c757d;
    font-weight: normal;
    margin-left: 8px;
}

.backup-item.backup-with-note .backup-header h4 {
    color: #064e5a;
}

/* Responsive backup note */
@media (max-width: 768px) {
    .backup-note {
        margin-top: 10px;
        padding: 10px;
        font-size: 13px;
    }
}

/* PWA Install Section */
.install-content { padding: 16px 0; }
.install-content p { margin-bottom: 16px; color: #4a5568; }
.pwa-install-modal {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5); z-index: 10000;
    display: flex; align-items: center; justify-content: center;
}
.pwa-install-modal-content {
    background: white; border-radius: 16px; padding: 28px;
    max-width: 400px; width: 90%; position: relative;
    box-shadow: 0 8px 30px rgba(0,0,0,0.2);
}
.pwa-install-modal-content h3 {
    margin: 0 0 16px; color: #2c3e50;
    display: flex; align-items: center; gap: 8px;
}
.pwa-install-modal-content p {
    margin: 0; color: #4a5568; line-height: 1.6;
}
.pwa-install-modal-content .close {
    position: absolute; top: 12px; right: 16px;
    font-size: 1.5rem; cursor: pointer; color: #9ca3af;
}
.ios-install-guide {
    margin-top: 16px; padding: 16px;
    background: #FFF7ED; border: 1px solid #FFEDD5;
    border-radius: 12px; color: #9a3412; font-size: 0.9rem;
}