/* Modal Styles */
.modal {
  display: flex;
  align-items: center;
  justify-content: center;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 1000;
}

.modal.hidden {
  display: none;
}

.modal-content {
  background: white;
  border-radius: var(--radius);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
  max-width: 600px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  animation: slideUp 0.3s ease;
}

.modal-content.modal-full {
  max-width: 98vw;
  max-height: 98vh;
  width: 98vw;
  height: 98vh;
}

.modal-full .modal-body {
  position: relative;
  height: calc(98vh - 70px);
  overflow: hidden;
}

#resource-iframe {
  width: 100%;
  height: 100%;
  border: none;
}

.modal-full .modal-body::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='100'%3E%3Ctext x='50%25' y='50%25' dominant-baseline='middle' text-anchor='middle' font-family='Comfortaa%2C cursive' font-size='18' font-weight='700' fill='%231a1f3a' fill-opacity='0.18' transform='rotate(-30 100 50)'%3EBLC Preview Only%3C/text%3E%3C/svg%3E");
  background-repeat: repeat;
  pointer-events: none;
  z-index: 10;
}

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

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--spacing-lg);
  border-bottom: 1px solid #e0e0e0;
}

.modal-header h2 {
  margin: 0;
  font-size: 1.5rem;
}

.modal-close {
  background: none;
  border: none;
  font-size: 28px;
  cursor: pointer;
  color: #666;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: background-color 0.2s;
}

.modal-close:hover {
  background-color: #f0f0f0;
  color: #000;
}

.modal-body {
  padding: var(--spacing-lg);
}

.modal-full .modal-body {
  padding: var(--spacing-md);
}

/* Form Styles */
.form-group {
  margin-bottom: var(--spacing-lg);
}

.form-group label {
  display: block;
  margin-bottom: var(--spacing-sm);
  font-weight: 500;
  color: #333;
}

.form-group input {
  width: 100%;
  padding: var(--spacing-sm) var(--spacing-md);
  border: 1px solid #ddd;
  border-radius: var(--radius);
  font-size: 1rem;
  font-family: inherit;
  transition: border-color 0.2s;
}

.form-group input:focus {
  outline: none;
  border-color: #d946a6;
  box-shadow: 0 0 0 3px rgba(217, 70, 166, 0.1);
}

.image-preview {
  width: 100%;
  height: 200px;
  background-color: #f5f5f5;
  border: 2px dashed #ddd;
  border-radius: var(--radius);
  background-size: cover;
  background-position: center;
  margin-top: var(--spacing-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #999;
  font-size: 0.9rem;
}

.image-preview[style*="background-image"] {
  color: transparent;
}

.form-actions {
  display: flex;
  gap: var(--spacing-md);
  margin-top: var(--spacing-lg);
}

.form-actions button {
  flex: 1;
}

.modal-actions {
  display: flex;
  gap: var(--spacing-md);
  margin-top: var(--spacing-lg);
  padding-top: var(--spacing-lg);
  border-top: 1px solid #e0e0e0;
}

.modal-actions button {
  flex: 1;
}

/* Resource Card Styles */
.resource-card {
  background: white;
  border: 1px solid #e0e0e0;
  border-radius: var(--radius);
  overflow: hidden;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  cursor: pointer;
}

.resource-card:hover {
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
  transform: translateY(-4px);
}

.resource-card-image {
  width: 100%;
  height: 200px;
  background-size: cover;
  background-position: center;
  background-color: #f5f5f5;
  cursor: pointer;
  position: relative;
}

.resource-card-image::after {
  content: '▶';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: white;
  background: rgba(0,0,0,0);
  transition: background 0.2s;
}

.resource-card-image:hover::after {
  background: rgba(0,0,0,0.4);
}

.resource-tag {
  position: absolute;
  top: var(--spacing-sm);
  left: var(--spacing-sm);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 3px 8px;
  border-radius: 4px;
  z-index: 1;
}

.resource-tag-rise       { background: #e61077; color: #ffffff; }
.resource-tag-storyline  { background: #f3931d; color: #ffffff; }
.resource-tag-micro { background: #55edf9; color: #333333; }

.resource-card-content {
  padding: var(--spacing-lg);
  flex: 1;
  display: flex;
  flex-direction: column;
}

.resource-card-content h3 {
  margin: 0 0 var(--spacing-md) 0;
  font-size: 1.1rem;
  line-height: 1.3;
  color: #333;
}

.resource-card-actions {
  display: flex;
  gap: var(--spacing-sm);
  margin-top: auto;
}

.resource-card-actions .btn {
  flex: 1;
}

/* Resource Controls */
.resource-controls {
  display: flex;
  gap: var(--spacing-md);
  margin: var(--spacing-lg) 0;
  flex-wrap: wrap;
  justify-content: center;
}

.resource-controls .btn {
  min-width: 200px;
}

/* Utility Buttons */
.btn-danger {
  background-color: #dc2626;
  color: white;
}

.btn-danger:hover {
  background-color: #b91c1c;
}

/* Allow section context to override button styles for secondary and primary */
.showcase .btn-secondary,
.showcase .btn-primary {
  background-color: var(--section-button-bg, var(--section-text));
  color: var(--section-button-text, var(--section-bg));
  border-color: var(--section-button-bg, var(--section-text));
}

.showcase .btn-secondary:hover,
.showcase .btn-primary:hover {
  background-color: transparent;
  color: var(--section-button-bg, var(--section-text));
}

.resource-count {
  padding: var(--spacing-md);
  background-color: #f9fafb;
  border-radius: var(--radius);
  text-align: center;
  margin-bottom: var(--spacing-md);
  color: #666;
}

/* Responsive */
@media (max-width: 768px) {
  .modal-content {
    width: 95%;
    max-height: 80vh;
  }

  .resource-controls {
    flex-direction: column;
  }

  .resource-controls .btn {
    width: 100%;
  }

  .form-actions {
    flex-direction: column;
  }

  .modal-actions {
    flex-direction: column;
  }
}
