/* === STILI PER LA SEZIONE PRESSIONE SANGUIGNA === */

.blood-pressure-section {
    margin-bottom: 30px;
}

.blood-pressure-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding: 1rem;
}

.blood-pressure-header h2 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: bold;
    color: #333;
}

.blood-pressure-toggle-btn {
    background: var(--color-primary-500);
    color: white;
    border: 1px solid var(--color-primary-500);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.blood-pressure-toggle-btn:hover {
    background: #5a6fd8;
    border-color: #5a6fd8;
    transform: translateY(-1px);
}

.blood-pressure-content {
    background: white;
    border-radius: 12px;
    padding: 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.blood-pressure-checker-section {
    position: relative;
    padding: 20px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    overflow: hidden;
}

.blood-pressure-checker-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #e53e3e 0%, #c53030 100%);
    animation: shimmer 3s infinite;
}

@keyframes shimmer {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.blood-pressure-checker-form {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.blood-pressure-checker-form input {
    flex: 1;
    min-width: 150px;
    padding: 12px;
    border: 2px solid rgba(229, 62, 62, 0.2);
    border-radius: 10px;
    font-size: 16px;
    background: rgba(255, 255, 255, 0.8);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.blood-pressure-checker-form input:hover {
    border-color: rgba(229, 62, 62, 0.4);
    background: rgba(255, 255, 255, 0.95);
}

.blood-pressure-checker-form input:focus {
    outline: none;
    border-color: #e53e3e;
    background: white;
    box-shadow: 0 0 0 3px rgba(229, 62, 62, 0.1);
}

.blood-pressure-checker-form button {
    position: relative;
    padding: 12px 20px;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.blood-pressure-checker-form button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s;
}

.blood-pressure-checker-form button:hover::before {
    left: 100%;
}

#check-blood-pressure-btn {
    background: linear-gradient(135deg, var(--color-primary-500), var(--color-primary-600));
    color: white;
}

#check-blood-pressure-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(66, 153, 225, 0.4);
}

#save-blood-pressure-btn {
    background: linear-gradient(135deg, #48bb78, #38a169);
    color: white;
}

#save-blood-pressure-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(72, 187, 120, 0.4);
}

.blood-pressure-note {
    font-size: 14px;
    color: #e53e3e;
    margin: 10px 0;
    padding: 8px 12px;
    background: #fff5f5;
    border-radius: 6px;
    border-left: 3px solid #e53e3e;
}

/* Risultato analisi pressione */
.blood-pressure-result {
    margin-top: 20px;
}

.blood-pressure-result-card {
    background: linear-gradient(135deg, #fed7d7, #feb2b2);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    border-left: 5px solid #e53e3e;
}

.blood-pressure-result-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    margin-bottom: 15px;
}

.blood-pressure-result-systolic,
.blood-pressure-result-diastolic {
    font-size: 2.5rem;
    font-weight: bold;
    color: #2d3748;
}

.blood-pressure-separator {
    font-size: 2rem;
    font-weight: bold;
    color: #4a5568;
}

.blood-pressure-result-unit {
    font-size: 1.2rem;
    color: #4a5568;
    margin-left: 5px;
}

.blood-pressure-result-category {
    font-size: 1.3rem;
    font-weight: bold;
    color: #2d3748;
    margin-bottom: 10px;
}

.blood-pressure-result-description {
    font-size: 1rem;
    color: #4a5568;
    margin-bottom: 10px;
    line-height: 1.4;
}

.blood-pressure-result-advice {
    font-size: 0.9rem;
    color: #2d3748;
    font-weight: 500;
    font-style: italic;
}

/* Colori per diverse categorie */
.blood-pressure-result-card.optimal {
    background: linear-gradient(135deg, #c6f6d5, #9ae6b4);
    border-left-color: #38a169;
}

.blood-pressure-result-card.normal {
    background: linear-gradient(135deg, #bee3f8, #90cdf4);
    border-left-color: var(--color-primary-400);
}

.blood-pressure-result-card.normal-high {
    background: linear-gradient(135deg, #feebc8, #fbd38d);
    border-left-color: #ed8936;
}

.blood-pressure-result-card.hypertension {
    background: linear-gradient(135deg, #fed7d7, #feb2b2);
    border-left-color: #e53e3e;
}

.blood-pressure-result-card.crisis {
    background: linear-gradient(135deg, #fed7e2, #fbb6ce);
    border-left-color: #d53f8c;
}

/* Sezione storico pressione */
.blood-pressure-history-section {
    position: relative;
    margin-top: 30px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    overflow: hidden;
}

.blood-pressure-history-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #e53e3e 0%, #c53030 100%);
    animation: shimmer 3s infinite;
}

.blood-pressure-history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.blood-pressure-history-header h4 {
    margin: 0;
    background: linear-gradient(135deg, #e53e3e 0%, #c53030 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 700;
}

.blood-pressure-history-buttons {
    display: flex;
    gap: 10px;
    align-items: center;
}

.blood-pressure-history-toggle-btn {
    position: relative;
    padding: 8px 16px;
    background: linear-gradient(135deg, var(--color-primary-500), var(--color-primary-600));
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.blood-pressure-history-toggle-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s;
}

.blood-pressure-history-toggle-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.4);
}

.blood-pressure-history-toggle-btn:hover::before {
    left: 100%;
}

.blood-pressure-history-list {
    max-height: 400px;
    overflow-y: auto;
}

.blood-pressure-history-list::-webkit-scrollbar {
    width: 8px;
}

.blood-pressure-history-list::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 10px;
}

.blood-pressure-history-list::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #e53e3e 0%, #c53030 100%);
    border-radius: 10px;
}

.blood-pressure-history-list::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #c53030 0%, #9b2c2c 100%);
}

.blood-pressure-history-item {
    position: relative;
    display: grid;
    grid-template-columns: 1fr 1fr 1fr auto;
    gap: 15px;
    align-items: center;
    padding: 15px;
    border-radius: 12px;
    margin-bottom: 10px;
    background: rgba(247, 250, 252, 0.8);
    backdrop-filter: blur(5px);
    border-left: 4px solid #e2e8f0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.blood-pressure-history-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: inherit;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.blood-pressure-history-item:hover {
    background: rgba(237, 242, 247, 0.9);
    transform: translateX(8px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
}

.blood-pressure-history-item:hover::before {
    width: 6px;
}

.blood-pressure-history-actions {
    display: flex;
    gap: 8px;
}

.blood-pressure-history-date {
    font-weight: 500;
    color: #2d3748;
}

.blood-pressure-history-values {
    display: flex;
    align-items: center;
    gap: 5px;
    font-weight: bold;
    color: #4a5568;
}

.blood-pressure-history-category {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    text-align: center;
}

.edit-blood-pressure-btn {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0.6;
    color: #2c5282;
}

.edit-blood-pressure-btn:hover {
    background: linear-gradient(135deg, #bee3f8 0%, #90cdf4 100%);
    opacity: 1;
    transform: scale(1.15) rotate(-5deg);
    box-shadow: 0 4px 12px rgba(66, 153, 225, 0.3);
}

.delete-blood-pressure-btn {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0.6;
    color: #c53030;
}

.delete-blood-pressure-btn:hover {
    background: linear-gradient(135deg, #fed7d7 0%, #fc8181 100%);
    opacity: 1;
    transform: scale(1.15) rotate(5deg);
    box-shadow: 0 4px 12px rgba(229, 62, 62, 0.3);
}

/* Responsive per mobile */
@media (max-width: 768px) {
    .blood-pressure-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .blood-pressure-checker-form {
        flex-direction: column;
    }
    
    .blood-pressure-checker-form input,
    .blood-pressure-checker-form button {
        width: 100%;
    }
    
    .blood-pressure-result-systolic,
    .blood-pressure-result-diastolic {
        font-size: 2rem;
    }
    
    .blood-pressure-history-buttons {
        flex-direction: column;
        gap: 8px;
    }
    
    .blood-pressure-history-item {
        grid-template-columns: 1fr;
        gap: 8px;
        text-align: center;
    }
    
    .blood-pressure-history-actions {
        justify-content: center;
    }
}

/* === STILI MODAL MODIFICA PRESSIONE === */

.blood-pressure-modal-content {
    max-width: 500px;
}

.blood-pressure-edit-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin: 20px 0;
}

.blood-pressure-edit-form .form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.blood-pressure-edit-form label {
    font-weight: 600;
    color: #2d3748;
    font-size: 14px;
}

.blood-pressure-edit-form .form-input {
    padding: 12px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.blood-pressure-edit-form .form-input:focus {
    outline: none;
    border-color: #e53e3e;
    box-shadow: 0 0 0 3px rgba(229, 62, 62, 0.1);
}

.modal-info-box {
    background: #edf2f7;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 15px;
}

.modal-info-box p {
    margin: 0;
    color: #2d3748;
}

.modal-note {
    background: #fff5f5;
    border-left: 3px solid #e53e3e;
    padding: 12px;
    border-radius: 4px;
    font-size: 14px;
    color: #742a2a;
    margin-top: 15px;
}

/* Stili migliorati per i pulsanti del modal */
.modal-footer {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

.modal-btn {
    flex: 1;
    padding: 14px 24px;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.modal-btn-secondary {
    background: #f3f4f6;
    color: #4b5563;
    border: 2px solid #e5e7eb;
}

.modal-btn-secondary:hover {
    background: #e5e7eb;
    border-color: #d1d5db;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.modal-btn-primary {
    background: linear-gradient(135deg, #e53e3e 0%, #c53030 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(229, 62, 62, 0.3);
}

.modal-btn-primary:hover {
    background: linear-gradient(135deg, #c53030 0%, #9b2c2c 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(229, 62, 62, 0.4);
}

.modal-btn-primary:disabled {
    background: #cbd5e0;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

@media (max-width: 768px) {
    .blood-pressure-modal-content {
        max-width: 95%;
        margin: 20px;
    }
    
    .modal-footer {
        flex-direction: column;
    }
    
    .modal-btn {
        width: 100%;
    }
}

/* Stili migliorati per il pulsante di chiusura del modal */
.modal-close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 36px;
    height: 36px;
    border: none;
    background: #f3f4f6;
    color: #6b7280;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: var(--z-dropdown);
}

.modal-close-btn:hover {
    background: #e5e7eb;
    color: #374151;
    transform: rotate(90deg) scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.modal-close-btn:active {
    transform: rotate(90deg) scale(0.95);
}

/* Assicura che l'header del modal abbia posizione relativa */
.modal-header {
    position: relative;
    padding: 24px;
    border-bottom: 1px solid #e5e7eb;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: #1f2937;
    padding-right: 40px; /* Spazio per la X */
}
