/* Modal Overlay */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  z-index: 1000;
  backdrop-filter: blur(5px);
}

.modal.active {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

/* Modal Content */
.modal-content {
  background: white;
  border-radius: 16px;
  max-width: 800px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: scale(0.9) translateY(-20px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* Modal Header */
.modal-header {
  padding: 2rem 2rem 1rem;
  border-bottom: 1px solid #e9ecef;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  position: sticky;
  top: 0;
  background: white;
  z-index: 10;
}

.modal-header h2 {
  margin: 0;
  color: #2c3e50;
  flex: 1;
  padding-right: 1rem;
}

.modal-close {
  background: none;
  border: none;
  font-size: 2rem;
  color: #6c757d;
  cursor: pointer;
  transition: color 0.3s ease;
  padding: 0;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

.modal-close:hover {
  color: #dc3545;
  background: #f8f9fa;
}

/* Modal Body */
.modal-body {
  padding: 1rem 2rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  align-items: start;
}

.modal-image {
  width: 100%;
}

.modal-image img {
  width: 100%;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.modal-info {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.modal-info p {
  color: #495057;
  line-height: 1.6;
  margin: 0;
}

.modal-date {
  color: #6c757d;
  font-size: 0.9rem;
  font-weight: 500;
}

.modal-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.modal-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.modal-actions .btn-primary,
.modal-actions .btn-secondary {
  flex: 1;
  text-align: center;
  min-width: 120px;
}

/* Modal Navigation */
.modal-navigation {
  padding: 1rem 2rem 2rem;
  display: flex;
  justify-content: space-between;
  border-top: 1px solid #e9ecef;
  background: #f8f9fa;
  border-radius: 0 0 16px 16px;
}

.nav-btn {
  padding: 0.75rem 1.5rem;
  background: #667eea;
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.3s ease;
}

.nav-btn:hover {
  background: #5a67d8;
  transform: translateY(-1px);
}

.nav-btn:disabled {
  background: #6c757d;
  cursor: not-allowed;
  transform: none;
  opacity: 0.6;
}

/* Responsive Modal */
@media (max-width: 768px) {
  .modal-content {
    margin: 0.5rem;
    max-height: 95vh;
  }
  
  .modal-header {
    padding: 1.5rem 1.5rem 1rem;
  }
  
  .modal-body {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    padding: 1rem 1.5rem;
  }
  
  .modal-navigation {
    padding: 1rem 1.5rem 1.5rem;
    flex-direction: column;
    gap: 1rem;
  }
  
  .nav-btn {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .modal.active {
    padding: 0.5rem;
  }
  
  .modal-content {
    margin: 0;
    border-radius: 12px;
  }
  
  .modal-header {
    padding: 1rem;
  }
  
  .modal-header h2 {
    font-size: 1.3rem;
  }
  
  .modal-close {
    width: 32px;
    height: 32px;
    font-size: 1.5rem;
  }
  
  .modal-body {
    padding: 1rem;
    gap: 1rem;
  }
  
  .modal-actions {
    flex-direction: column;
  }
  
  .modal-actions .btn-primary,
  .modal-actions .btn-secondary {
    flex: none;
    min-width: auto;
  }
}

/* Modal Animation States */
.modal.closing .modal-content {
  animation: modalSlideOut 0.3s ease-in;
}

@keyframes modalSlideOut {
  from {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
  to {
    opacity: 0;
    transform: scale(0.9) translateY(-20px);
  }
}

/* Accessibility */
.modal:focus {
  outline: none;
}

.modal-content:focus {
  outline: 2px solid #667eea;
  outline-offset: 2px;
}

/* Dark mode support (optional) */
@media (prefers-color-scheme: dark) {
  .modal {
    background: rgba(0, 0, 0, 0.9);
  }
  
  .modal-content {
    background: #2c3e50;
    color: white;
  }
  
  .modal-header {
    background: #2c3e50;
    border-bottom-color: #495057;
  }
  
  .modal-header h2 {
    color: white;
  }
  
  .modal-close:hover {
    background: #495057;
  }
  
  .modal-navigation {
    background: #34495e;
    border-top-color: #495057;
  }
  
  .modal-info p {
    color: #e9ecef;
  }
  
  .modal-date {
    color: #adb5bd;
  }
} 