/* === 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: var(--color-primary-600);
  border-color: var(--color-primary-600);
  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,
    var(--color-error) 0%,
    var(--color-error-dark) 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: var(--color-error);
  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,
    var(--color-success),
    var(--color-success-dark)
  );
  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: var(--color-error);
  margin: 10px 0;
  padding: 8px 12px;
  background: var(--color-error-light);
  border-radius: 6px;
  border-left: 3px solid var(--color-error);
}

/* Risultato analisi pressione */
.blood-pressure-result {
  margin-top: 20px;
}

.blood-pressure-result-card {
  background: linear-gradient(135deg, var(--color-error-light), #feb2b2);
  border-radius: 12px;
  padding: 20px;
  text-align: center;
  border-left: 5px solid var(--color-error);
}

.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: var(--color-gray-900);
}

.blood-pressure-separator {
  font-size: 2rem;
  font-weight: bold;
  color: var(--color-gray-700);
}

.blood-pressure-result-unit {
  font-size: 1.2rem;
  color: var(--color-gray-700);
  margin-left: 5px;
}

.blood-pressure-result-category {
  font-size: 1.3rem;
  font-weight: bold;
  color: var(--color-gray-900);
  margin-bottom: 10px;
}

.blood-pressure-result-description {
  font-size: 1rem;
  color: var(--color-gray-700);
  margin-bottom: 10px;
  line-height: 1.4;
}

.blood-pressure-result-advice {
  font-size: 0.9rem;
  color: var(--color-gray-900);
  font-weight: 500;
  font-style: italic;
}

/* Colori per diverse categorie */
.blood-pressure-result-card.optimal {
  background: linear-gradient(135deg, var(--color-success-light), var(--color-success-light));
  border-left-color: var(--color-success-dark);
}

.blood-pressure-result-card.normal {
  background: linear-gradient(135deg, var(--color-info-light), #90cdf4);
  border-left-color: var(--color-primary-400);
}

.blood-pressure-result-card.normal-high {
  background: linear-gradient(135deg, #feebc8, #fbd38d);
  border-left-color: var(--color-accent-500);
}

.blood-pressure-result-card.hypertension {
  background: linear-gradient(135deg, var(--color-error-light), #feb2b2);
  border-left-color: var(--color-error);
}

.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,
    var(--color-error) 0%,
    var(--color-error-dark) 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,
    var(--color-error) 0%,
    var(--color-error-dark) 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,
    var(--color-error) 0%,
    var(--color-error-dark) 100%
  );
  border-radius: 10px;
}

.blood-pressure-history-list::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(135deg, var(--color-error-dark) 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 var(--color-gray-200);
  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: var(--color-gray-900);
}

.blood-pressure-history-values {
  display: flex;
  align-items: center;
  gap: 5px;
  font-weight: bold;
  color: var(--color-gray-700);
}

.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, var(--color-info-light) 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: var(--color-error-dark);
}

.delete-blood-pressure-btn:hover {
  background: linear-gradient(
    135deg,
    var(--color-error-light) 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: var(--color-gray-900);
  font-size: 14px;
}

.blood-pressure-edit-form .form-input {
  padding: 12px;
  border: 2px solid var(--color-gray-200);
  border-radius: 8px;
  font-size: 16px;
  transition: border-color 0.3s;
}

.blood-pressure-edit-form .form-input:focus {
  outline: none;
  border-color: var(--color-error);
  box-shadow: 0 0 0 3px rgba(229, 62, 62, 0.1);
}

.modal-info-box {
  background: var(--color-gray-100);
  padding: 12px;
  border-radius: 8px;
  margin-bottom: 15px;
}

.modal-info-box p {
  margin: 0;
  color: var(--color-gray-900);
}

.modal-note {
  background: var(--color-error-light);
  border-left: 3px solid var(--color-error);
  padding: 12px;
  border-radius: 4px;
  font-size: 14px;
  color: var(--color-error-dark);
  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,
    var(--color-error) 0%,
    var(--color-error-dark) 100%
  );
  color: white;
  box-shadow: 0 4px 12px rgba(229, 62, 62, 0.3);
}

.modal-btn-primary:hover {
  background: linear-gradient(135deg, var(--color-error-dark) 0%, #9b2c2c 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(229, 62, 62, 0.4);
}

.modal-btn-primary:disabled {
  background: var(--color-gray-300);
  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 */
}
