/* Utility Classes */
.hidden {
  display: none !important;
}

/* Modal System Styles */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  animation: modalFadeIn 0.3s ease;
}

/* Standard Modal (500px) */
.modal:not(.modal-fullscreen) {
  border: none;
  border-radius: 12px;
  padding: 0;
  max-width: 600px;
  width: 90vw;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 1000;
  background: var(--bg-primary);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Coming-soon modals use .modal as the backdrop */
.coming-soon .modal:not(.modal-fullscreen) {
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  max-width: none;
  transform: none;
  margin: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(5px);
}

.modal:not(.modal-fullscreen)[open] {
  display: block;
}

.modal:not(.modal-fullscreen):not([open]) {
  display: none;
}

.modal:not(.modal-fullscreen) .modal-content {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  clip-path: polygon(0% 8px, 8px 0%, calc(100% - 8px) 0%, 100% 8px, 100% calc(100% - 8px), calc(100% - 8px) 100%, 8px 100%, 0% calc(100% - 8px));
  max-width: 500px;
  width: 90%;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  animation: modalSlideIn 0.3s ease;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  padding: 0;
  border-radius: 12px;
  overflow: hidden;
}

/* Fullscreen Modal */
.modal-fullscreen {
  border: none;
  border-radius: 0;
  padding: 0;
  width: 100vw !important;
  height: 100vh !important;
  max-width: none !important;
  max-height: none !important;
  position: fixed;
  top: 0;
  left: 0;
  transform: none;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.8);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal-fullscreen[open] {
  display: flex !important;
}

.modal-fullscreen:not([open]) {
  display: none !important;
}

.modal-fullscreen .modal-content {
  padding: 0;
  border-radius: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: calc(100vh - 2rem);
  width: calc(100vw - 2rem);
  max-width: none !important;
  background: var(--bg-primary);
  border: none;
  clip-path: none;
  animation: none;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  margin: 0 !important;
}

.modal::backdrop,
.modal-fullscreen::backdrop {
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(4px);
}

.modal-header {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-secondary);
  flex-shrink: 0;
}

.modal-fullscreen .modal-header {
  padding: 2rem;
}

.modal-title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
}

.modal-fullscreen .modal-title {
  font-size: 1.5rem;
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s ease;
  border-radius: 50%;
}

.modal-fullscreen .modal-close {
  width: 2.5rem;
  height: 2.5rem;
  padding: 0.5rem;
}

.modal-close:hover {
  color: var(--text-primary);
  background: var(--bg-tertiary);
}

.modal-body {
  padding: 1.5rem;
  color: var(--text-primary);
  line-height: 1.6;
  flex: 1;
  overflow-y: auto;
  min-height: 0;
}

.modal-fullscreen .modal-body {
  padding: 2rem;
}

.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  background: var(--bg-secondary);
  flex-shrink: 0;
}

.modal-fullscreen .modal-footer {
  padding: 2rem;
  padding-top: 1.5rem;
}

/* Modal Types */
.modal-success .modal-header {
  background: rgba(16, 185, 129, 0.1);
  border-bottom-color: rgba(16, 185, 129, 0.3);
}

.modal-success .modal-title::before {
  content: "✓ ";
  color: #10b981;
}

.modal-error .modal-header {
  background: rgba(239, 68, 68, 0.1);
  border-bottom-color: rgba(239, 68, 68, 0.3);
}

.modal-error .modal-title::before {
  content: "⚠ ";
  color: #ef4444;
}

.modal-info .modal-header {
  background: rgba(59, 130, 246, 0.1);
  border-bottom-color: rgba(59, 130, 246, 0.3);
}

.modal-info .modal-title::before {
  content: "ℹ ";
  color: #3b82f6;
}

/* Animations */
@keyframes modalFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

/* Button Styles */
.btn-danger {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: white;
}

.btn-danger:hover {
  background: linear-gradient(135deg, #dc2626, #b91c1c);
}

/* Responsive */
@media (max-width: 768px) {
  .modal:not(.modal-fullscreen) .modal-content {
    width: 95%;
    margin: 1rem;
  }
  
  .modal-header,
  .modal-body,
  .modal-footer {
    padding: 1rem;
  }
}
/* Prevent body scroll when modal is open */
body.modal-open {
  overflow: hidden !important;
  position: fixed !important;
  width: 100% !important;
  height: 100% !important;
}
