/* ======= CSS PROFILO PETFOUND - VERSIONE MODERNA COMPLETA ======= */

/* Variabili CSS PetFound */
:root {
  --primary-color: #0ea5e9;
  --primary-dark: #0284c7;
  --success-color: #10b981;
  --danger-color: #ef4444;
  --warning-color: #f59e0b;
  --background: #f0f9ff;
  --surface: #ffffff;
  --surface-dark: #e0f2fe;
  --surface-light: #f8fafc;
  --text-primary: #0c4a6e;
  --text-secondary: #0369a1;
  --text-muted: #64748b;
  --border: #bae6fd;
  --border-light: #e0f2fe;
  --shadow: 0 1px 3px 0 rgba(14, 165, 233, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(14, 165, 233, 0.15);
  --gradient: linear-gradient(135deg, #0ea5e9 0%, #06b6d4 50%, #38bdf8 100%);
}

/* ======= PROFILO HEADER ======= */
.profile-header {
  text-align: center;
  padding: 30px 0;
  margin-bottom: 30px;
}

.profile-header h2 {
  font-size: 2rem;
  color: var(--text-primary);
  margin-bottom: 10px;
  font-weight: 700;
}

#profileInfo p {
  font-size: 1.1rem;
  color: var(--text-secondary);
  margin: 0;
}

/* ======= TABS PROFILO ======= */
.profile-tabs {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-bottom: 30px;
  flex-wrap: wrap;
}

.profile-tabs a {
  padding: 12px 24px;
  background: var(--surface);
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: 16px;
  border: 2px solid var(--border);
  transition: all 0.3s ease;
  font-weight: 500;
  font-size: 1rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.profile-tabs a:hover {
  background: var(--surface-dark);
  border-color: var(--primary-color);
  transform: translateY(-2px);
}

.profile-tabs a.active {
  background: var(--gradient);
  color: white;
  border-color: var(--primary-color);
  box-shadow: var(--shadow);
}

/* ======= SEZIONI CONTENUTO ======= */
.user-posts {
  margin-bottom: 40px;
}

/* ======= BASE .btn STYLES ======= */
.btn {
  padding: 14px 24px;
  font-size: 1rem;
  border-radius: 12px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.3s ease;
  background: var(--surface);
  color: var(--text-secondary);
  border: 2px solid var(--border);
  font-weight: 500;
  cursor: pointer;
}

.btn:hover {
  background: var(--surface-dark);
  border-color: var(--primary-color);
  transform: translateY(-2px);
}

.btn.active {
  background: var(--gradient);
  color: white;
  border-color: var(--primary-color);
  box-shadow: var(--shadow);
}

/* ======= ACTIONS STYLES ======= */
#petActions, #postActions {
  display: flex;
  gap: 16px;
  margin-bottom: 30px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ======= GRIDS POSTS E PETS ======= */
.posts-grid, #petsContent {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
  margin-bottom: 30px;
}

/* ======= CARD UNIFICATE ======= */
.post-card, .pet-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: all 0.3s ease;
  cursor: pointer;
  position: relative;
}

.post-card:hover, .pet-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

/* ======= ADOPTION CARD STYLES - TEMA ARANCIONE COMPLETO ======= */
.adoption-card {
  border-color: #f97316 !important;
  box-shadow: 0 1px 3px 0 rgba(249, 115, 22, 0.1) !important;
}

.adoption-card:hover {
  box-shadow: 0 10px 15px -3px rgba(249, 115, 22, 0.15) !important;
  border-color: #ea580c !important;
}

.adoption-card .post-header {
  background: #fff7ed !important;
  border-bottom-color: #fed7aa !important;
}

.adoption-card .post-info h4 {
  color: #ea580c !important;
}

.adoption-card .post-info p {
  color: #f97316 !important;
}

.adoption-card .adoption-fee {
  color: #ea580c !important;
  font-weight: 600;
}

/* ======= HEADER CARD ======= */
.post-card .post-header, .pet-card .post-header {
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  background: var(--surface-dark);
  border-bottom: 1px solid var(--border-light);
}

/* ======= STATUS BADGES ======= */
.animal-status, .pet-type, .pet-status, .status-badge {
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Colori status segnalazioni */
.lost-animal, .lost-status, .status-badge.smarrito {
  background: rgba(239, 68, 68, 0.1);
  color: var(--danger-color);
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.found-animal, .found-status, .status-badge.trovato {
  background: rgba(245, 158, 11, 0.1);
  color: var(--warning-color);
  border: 1px solid rgba(245, 158, 11, 0.2);
}

.normal-animal, .pet-type {
  background: rgba(14, 165, 233, 0.1);
  color: var(--primary-color);
  border: 1px solid rgba(14, 165, 233, 0.2);
}

/* ======= STATUS BADGES PER ADOZIONI - TEMA ARANCIONE ======= */
.seeking-adoption {
  background: rgba(234, 88, 12, 0.1) !important;
  color: #ea580c !important;
  border: 1px solid rgba(234, 88, 12, 0.2) !important;
}

.offering-adoption {
  background: rgba(249, 115, 22, 0.1) !important;
  color: #f97316 !important;
  border: 1px solid rgba(249, 115, 22, 0.2) !important;
}

.normal-adoption {
  background: rgba(251, 146, 60, 0.1) !important;
  color: #fb923c !important;
  border: 1px solid rgba(251, 146, 60, 0.2) !important;
}

/* ======= DATA ======= */
.post-date {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 400;
}

/* ======= IMMAGINI CARD ======= */
.post-card .post-image, .pet-card .post-image {
  position: relative;
  overflow: hidden;
  margin: 0;
  padding: 0;
}

.post-card .post-image img, .pet-card .post-image img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}

.post-card:hover .post-image img, .pet-card:hover .post-image img {
  transform: scale(1.05);
}

/* ======= INFO CARD ======= */
.post-card .post-info, .pet-card .post-info {
  padding: 20px;
}

.post-card .post-info h4, .pet-card .post-info h4 {
  font-size: 1.2rem;
  margin-bottom: 8px;
  color: var(--text-primary);
  font-weight: 600;
}

.post-card .post-info p, .pet-card .post-info p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-bottom: 4px;
}

/* ======= ADOPTION FEE STYLING ======= */
.adoption-fee {
  font-weight: 600;
  color: #ea580c;
  margin-top: 8px;
}

/* ======= NO CONTENT MESSAGES ======= */
.no-pets-message {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
  background: var(--surface);
  border-radius: 20px;
  border: 1px solid var(--border);
  margin: 40px 0;
}

.no-pets-message h3 {
  font-size: 1.5rem;
  margin-bottom: 15px;
  color: var(--text-primary);
}

.no-pets-message p {
  margin-bottom: 20px;
  font-size: 1.1rem;
}

/* ======= MODALS ======= */
.modal {
  display: none;
  position: fixed;
  z-index: 2000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
}

.modal-content {
  background-color: var(--surface);
  margin: 5% auto;
  padding: 0;
  border-radius: 20px;
  width: 90%;
  max-width: 600px;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  position: relative;
}

.close, .pet-close, .select-pet-close {
  position: absolute;
  top: 15px;
  right: 20px;
  color: var(--text-muted);
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
  z-index: 1;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  transition: all 0.2s ease;
}

.close:hover, .pet-close:hover, .select-pet-close:hover {
  background: var(--danger-color);
  color: white;
  transform: scale(1.1);
}

/* ======= MODAL HEADER ======= */
.modal-header {
  padding: 30px 20px 20px;
  text-align: center;
  border-bottom: 1px solid var(--border-light);
}

.modal-header h3 {
  margin: 0;
  font-size: 1.5rem;
  color: var(--text-primary);
}

/* ======= MODAL IMPROVEMENTS - TEMA ARANCIONE PER ADOZIONI ======= */
.modal-header.seeking-adoption {
  background: linear-gradient(135deg, #ea580c 0%, #f97316 100%) !important;
  color: white !important;
}

.modal-header.offering-adoption {
  background: linear-gradient(135deg, #f97316 0%, #fb923c 100%) !important;
  color: white !important;
}

.modal-header.normal-adoption {
  background: linear-gradient(135deg, #f97316 0%, #fb923c 100%) !important;
  color: white !important;
}

/* ======= MODAL IMAGE ======= */
.modal-image {
  position: relative;
  overflow: hidden;
}

.modal-image img {
  width: 100%;
  height: 300px;
  object-fit: cover;
  display: block;
}

/* ======= MODAL DETAILS ======= */
.modal-details {
  padding: 30px;
}

.modal-details p {
  margin-bottom: 15px;
  font-size: 1rem;
  line-height: 1.6;
}

.modal-details strong {
  color: var(--text-primary);
  font-weight: 600;
}

/* ======= BUTTON GROUP ======= */
.button-group {
  display: flex;
  gap: 12px;
  margin-top: 30px;
  flex-wrap: wrap;
  justify-content: center;
}

.found-btn {
  background: var(--success-color);
  color: white;
  border: none;
  padding: 12px 20px;
  border-radius: 12px;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 500;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 8px;
}

.found-btn:hover {
  background: #0d9f71;
  transform: translateY(-1px);
}

.delete-btn {
  background: var(--danger-color);
  color: white;
  border: none;
  padding: 12px 20px;
  border-radius: 12px;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 500;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 8px;
}

.delete-btn:hover {
  background: #dc2626;
  transform: translateY(-1px);
}

/* ======= MODAL MAP ======= */
#modalMap {
  height: 250px;
  width: 100%;
  border-radius: 0 0 20px 20px;
}

/* ======= PET SELECTION ======= */
.pets-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 20px;
  padding: 20px;
}

.pet-selection-card {
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
}

.pet-selection-card:hover {
  border-color: var(--primary-color);
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.pet-selection-card .pet-image img {
  width: 100%;
  height: 150px;
  object-fit: cover;
}

.pet-selection-card .pet-info {
  padding: 15px;
  text-align: center;
}

.pet-selection-card .pet-info h4 {
  margin: 0 0 8px 0;
  font-size: 1.1rem;
  color: var(--text-primary);
}

.pet-selection-card .pet-info p {
  margin: 4px 0;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.selection-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(14, 165, 233, 0.9);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 1.1rem;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.pet-selection-card:hover .selection-overlay {
  opacity: 1;
}

/* ======= RESPONSIVE DESIGN ======= */
/* Mobile Small (fino a 480px) */
@media (max-width: 480px) {
  .container, .main-content {
    padding: 15px 12px 120px;
    margin-top: 10px;
  }
  
  .profile-header {
    padding: 20px 0;
  }
  
  .profile-header h2 {
    font-size: 1.5rem;
    margin-bottom: 8px;
  }
  
  .profile-tabs {
    flex-direction: column;
    gap: 12px;
    margin-bottom: 25px;
  }
  
  .profile-tabs a {
    padding: 12px 16px;
    text-align: center;
    font-size: 0.95rem;
  }
  
  .posts-grid, #petsContent {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  
  .post-card, .pet-card {
    margin: 0;
    border-radius: 16px;
  }
  
  .post-card .post-header, .pet-card .post-header {
    padding: 12px 16px;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  
  .post-card .post-info, .pet-card .post-info {
    padding: 16px;
  }
  
  #petActions, #postActions {
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
  }
  
  #petActions .btn, #postActions .btn {
    width: 100%;
    text-align: center;
    justify-content: center;
  }
  
  .modal-content {
    margin: 10px;
    max-height: 95vh;
    width: calc(100% - 20px);
  }
  
  .modal-details {
    padding: 20px;
  }
  
  .button-group {
    flex-direction: column;
  }
  
  .no-pets-message {
    padding: 40px 16px;
  }
  
  .no-pets-message h3 {
    font-size: 1.3rem;
  }
  
  .pets-grid {
    grid-template-columns: 1fr;
    padding: 15px;
  }
}

/* Mobile Medium (481px - 768px) */
@media (min-width: 481px) and (max-width: 768px) {
  .container, .main-content {
    padding: 20px 16px 120px;
  }
  
  .posts-grid, #petsContent {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }
  
  .profile-tabs {
    justify-content: center;
    gap: 12px;
  }
  
  #petActions, #postActions {
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
  }
  
  .pets-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ======= ANIMAZIONI ======= */
@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.post-card, .pet-card {
  animation: slideUp 0.3s ease;
}

/* ======= MESSAGGI ERRORE ======= */
.error-message {
  text-align: center;
  padding: 40px 20px;
  color: var(--danger-color);
  background: rgba(239, 68, 68, 0.05);
  border: 1px solid rgba(239, 68, 68, 0.2);
  border-radius: 20px;
  margin: 20px 0;
}

.error-message h3 {
  margin-bottom: 15px;
  color: var(--danger-color);
}

.error-message ul {
  text-align: left;
  display: inline-block;
  margin: 15px 0;
}

/* ======= LOADING SHIMMER ======= */
.loading-card {
  pointer-events: none;
  opacity: 0.7;
}

.loading-shimmer {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

/* ======= ACCESSIBILITY IMPROVEMENTS ======= */
.btn:focus {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

.btn:focus:not(:focus-visible) {
  outline: none;
}

/* ======= ENHANCED HOVER EFFECTS ======= */
.btn:hover {
  box-shadow: 0 4px 12px rgba(14, 165, 233, 0.15);
}

.btn.active:hover {
  box-shadow: 0 6px 20px rgba(14, 165, 233, 0.25);
}
