/* Mobile UX Improvements - Calendar Cards & Email Overflow Fixes */

/* Email overflow solutions */
.email-responsive {
  word-break: break-all;
  overflow-wrap: break-word;
  hyphens: auto;
  font-size: 0.9rem;
  max-width: 100%;
}

@media (max-width: 768px) {
  .email-responsive {
    font-size: 0.85rem;
    line-height: 1.4;
    display: block;
    padding: 0.5rem 0;
  }
  
  /* For email links in alerts */
  .alert .email-responsive {
    background: rgba(255,255,255,0.2);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    margin: 0.25rem 0;
    display: inline-block;
    word-break: break-all;
  }
}

/* Email in contact information */
.contact-email {
  word-break: break-all;
  overflow-wrap: break-word;
  max-width: 100%;
}

@media (max-width: 480px) {
  .contact-email {
    font-size: 0.8rem;
    letter-spacing: -0.2px;
  }
}

/* Fix any existing email addresses */
a[href^="mailto:"],
.email,
[class*="email"] {
  word-break: break-all;
  overflow-wrap: break-word;
  max-width: 100%;
}

/* Calendar Card Layout for Mobile */
@media (max-width: 768px) {
  /* Hide table on mobile, show cards instead */
  .table-responsive {
    display: none !important;
  }
  
  /* Mobile exam cards container */
  .exam-cards-mobile {
    display: block !important;
    padding: 0;
  }
  
  .exam-card {
    border: 1px solid #dee2e6;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    overflow: hidden;
    background: white;
  }
  
  .exam-card-header {
    background: linear-gradient(135deg, #CEDB00 0%, #b8c400 100%);
    color: #333;
    padding: 1.25rem;
    border-radius: 12px 12px 0 0;
    position: relative;
  }
  
  .exam-card-header.gazdalKODO {
    background: linear-gradient(135deg, #E22B2B 0%, #c41e1e 100%);
    color: white;
  }
  
  .exam-date {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
  }
  
  .exam-date .fas {
    font-size: 1.2rem;
  }
  
  .exam-type {
    font-size: 1rem;
    opacity: 0.9;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
  }
  
  .exam-card-body {
    padding: 1.25rem;
  }
  
  .exam-info-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 0.75rem 0;
    border-bottom: 1px solid #f0f0f0;
    gap: 1rem;
  }
  
  .exam-info-row:last-child {
    border-bottom: none;
  }
  
  .exam-info-label {
    font-weight: 600;
    color: #6c757d;
    font-size: 0.9rem;
    flex-shrink: 0;
    min-width: 80px;
  }
  
  .exam-info-value {
    font-size: 1rem;
    text-align: right;
    flex: 1;
    word-break: break-word;
    overflow-wrap: break-word;
  }
  
  .exam-info-value .badge {
    font-size: 0.8rem;
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    display: inline-block;
    margin: 0.2rem 0;
  }
  
  .exam-info-value .btn {
    font-size: 0.85rem;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    margin-top: 0.5rem;
    min-height: 44px;
    width: 100%;
  }
  
  /* Status indicators */
  .exam-card.current-exam {
    border: 2px solid #fd7e14;
    box-shadow: 0 6px 20px rgba(253, 126, 20, 0.3);
  }
  
  .exam-card.current-exam .exam-card-header {
    background: linear-gradient(135deg, #fd7e14 0%, #e8681a 100%);
    color: white;
  }
  
  .exam-card.next-exam {
    border: 2px solid #0dcaf0;
    box-shadow: 0 6px 20px rgba(13, 202, 240, 0.3);
    animation: pulse-border 2s infinite;
  }
  
  .exam-card.next-exam .exam-card-header {
    background: linear-gradient(135deg, #0dcaf0 0%, #0aa2c0 100%);
    color: white;
    position: relative;
  }
  
  .exam-card.next-exam .exam-card-header::after {
    content: '🔥 Következő vizsga';
    position: absolute;
    top: 0;
    right: 10px;
    background: #fd7e14;
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
  }
  
  @keyframes pulse-border {
    0%, 100% {
      box-shadow: 0 6px 20px rgba(13, 202, 240, 0.3);
    }
    50% {
      box-shadow: 0 8px 25px rgba(13, 202, 240, 0.5);
    }
  }
  
  .exam-card.past-exam {
    opacity: 0.7;
    background: #f8f9fa;
  }
  
  .exam-card.past-exam .exam-card-header {
    background: linear-gradient(135deg, #6c757d 0%, #5a6268 100%);
    color: white;
  }
  
  /* Compact layout for smaller phones */
  @media (max-width: 430px) {
    .exam-card {
      margin-bottom: 1rem;
      border-radius: 8px;
    }
    
    .exam-card-header {
      padding: 1rem;
    }
    
    .exam-date {
      font-size: 1.2rem;
    }
    
    .exam-type {
      font-size: 0.9rem;
    }
    
    .exam-card-body {
      padding: 1rem;
    }
    
    .exam-info-row {
      padding: 0.5rem 0;
      flex-direction: column;
      align-items: flex-start;
      gap: 0.5rem;
    }
    
    .exam-info-label {
      font-size: 0.85rem;
      margin-bottom: 0.25rem;
    }
    
    .exam-info-value {
      text-align: left;
      width: 100%;
      font-size: 0.9rem;
    }
  }
}

/* Desktop - show table, hide cards */
@media (min-width: 769px) {
  .exam-cards-mobile {
    display: none !important;
  }
  
  .table-responsive {
    display: block !important;
  }
}

/* Loading state for cards */
.exam-card.loading {
  pointer-events: none;
  opacity: 0.6;
}

.exam-card.loading::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
  animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* Enhanced touch interactions */
.exam-card {
  transition: all 0.3s ease;
  cursor: pointer;
}

.exam-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.exam-card:active {
  transform: translateY(0);
  transition: all 0.1s ease;
}

/* Accessibility improvements */
.exam-card:focus {
  outline: 3px solid #0d6efd;
  outline-offset: 2px;
}

.exam-card[tabindex="0"] {
  cursor: pointer;
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  .exam-card,
  .exam-card::after,
  .exam-card.next-exam {
    animation: none;
    transition: none;
  }
  
  .exam-card:hover {
    transform: none;
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .exam-card {
    border: 2px solid;
  }
  
  .exam-card-header {
    border-bottom: 2px solid;
  }
}