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

.modal-overlay.active {
  display: flex;
}

.modal-content {
  background: var(--card-bg);
  border: var(--card-border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  max-width: 90%;
  max-height: 80%;
  overflow-y: auto;
  position: relative;
  backdrop-filter: var(--backdrop);
  box-shadow: var(--shadow-lg);
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 2rem;
  cursor: pointer;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: var(--transition);
}

.modal-close:hover {
  background: rgba(255,255,255,0.1);
  color: var(--text-primary);
}

.modal-header {
  text-align: center;
  margin-bottom: 2rem;
}

.modal-icon {
  width: 80px;
  height: 80px;
  background: linear-gradient(135deg, var(--brand-gold), #ffd166);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #0a0a0a;
  font-size: 2rem;
  margin: 0 auto 1rem;
  box-shadow: var(--glow-gold);
}

.modal-header h2 {
  color: var(--text-primary);
  font-size: 1.8rem;
  font-weight: 700;
  margin: 0 0 0.5rem 0;
}

.modal-header p {
  color: var(--text-secondary);
  font-size: 1rem;
  margin: 0;
}

/* Video Modal Styles */
.modal {
  position: fixed !important; 
  inset: 0 !important; 
  z-index: 999999 !important; 
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.85);
  backdrop-filter: blur(10px);
  padding: 16px;
  overflow: hidden;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  align-items: center;
  justify-content: center;
}

.modal.show { 
  display: flex !important; 
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  align-items: center;
  justify-content: center;
}

.video-panel {
  width: min(90vw, 1000px);
  max-height: 90vh;
  border-radius: 18px;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(0,0,0,0.95), rgba(0,0,0,0.9));
  border: 1px solid rgba(255,178,0,0.4);
  box-shadow: var(--shadow-lg);
  transform: translateY(12px);
  animation: pop 320ms cubic-bezier(.2,.8,.2,1) forwards;
  position: relative;
  z-index: 1000000;
  display: flex;
  flex-direction: column;
  transform-origin: center center;
}

@keyframes pop { to { transform: translateY(0); } }

.video-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 24px 0;
  border-bottom: 1px solid rgba(255,178,0,0.2);
  margin-bottom: 20px;
}

.video-info h2 {
  margin: 0 0 8px;
  font-size: 20px;
  font-weight: 800;
  background: linear-gradient(135deg, #fff, #FFB200);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  display: flex;
  align-items: center;
  gap: 10px;
}

.video-info h2 i {
  color: var(--brand-gold);
  font-size: 18px;
}

.video-category {
  margin: 0;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.video-close {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  color: #ffffff;
  cursor: pointer;
  transition: var(--transition-fast);
  font-size: 18px;
}

.video-close:hover {
  background: rgba(255,255,255,0.2);
  border-color: rgba(255,255,255,0.3);
  transform: scale(1.1);
}

.video-panel-body {
  padding: 0 24px 24px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.video-container {
  position: relative;
  width: 100%;
  border-radius: 12px;
  overflow: hidden;
  background: #000;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}

.video-container video {
  width: 100%;
  height: auto;
  max-height: 60vh;
  display: block;
  border-radius: 12px;
}

.video-details {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.video-description {
  color: var(--text-secondary);
  font-size: 15px;
  line-height: 1.6;
  max-height: 120px;
  overflow-y: auto;
  padding-right: 8px;
}

.video-description::-webkit-scrollbar {
  width: 6px;
}

.video-description::-webkit-scrollbar-track {
  background: rgba(255,255,255,0.1);
  border-radius: 3px;
}

.video-description::-webkit-scrollbar-thumb {
  background: rgba(255,178,0,0.5);
  border-radius: 3px;
}

.video-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 16px;
  border-top: 1px solid rgba(255,178,0,0.2);
}

.video-date {
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
}

.video-featured {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255,178,0,0.2);
  border: 1px solid rgba(255,178,0,0.3);
  color: var(--brand-gold);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* Portfolio Modal Styles */
.portfolio-modal-content {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.portfolio-modal-image {
  width: 100%;
  height: auto;
  border-radius: 12px;
  box-shadow: var(--shadow-md);
}

.portfolio-modal-details {
  padding: 20px;
  background: rgba(15,23,42,0.3);
  border-radius: 12px;
  border: 1px solid rgba(99,102,241,0.2);
}

.portfolio-modal-description {
  color: var(--text-secondary);
  font-size: 16px;
  line-height: 1.6;
  margin-bottom: 16px;
}

.portfolio-modal-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.portfolio-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(99,102,241,0.18);
  border: 1px solid rgba(99,102,241,0.3);
  color: #c7d2fe;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.portfolio-modal-category {
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 600;
}

.portfolio-modal-category strong {
  color: var(--brand-gold);
}

/* Modal Footer */
.modal-footer {
  display: flex;
  gap: 16px;
  justify-content: flex-end;
  padding-top: 20px;
  border-top: 1px solid rgba(255,255,255,0.1);
  margin-top: 20px;
}

.modal-button {
  padding: 12px 24px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: var(--transition);
  border: none;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.modal-button.primary {
  background: linear-gradient(135deg, var(--brand-gold), #ffd166);
  color: #0a0a0a;
  box-shadow: var(--glow-gold);
}

.modal-button.primary:hover {
  transform: translateY(-2px);
  filter: brightness(1.05);
}

.modal-button.secondary {
  background: transparent;
  color: var(--text-secondary);
  border: 2px solid rgba(255,255,255,0.3);
}

.modal-button.secondary:hover {
  border-color: var(--brand-gold);
  color: var(--brand-gold);
  transform: translateY(-2px);
}

/* Responsive Design */
@media (max-width: 768px) {
  .modal-content {
    max-width: 95%;
    margin: 1rem;
    padding: 1.5rem;
  }
  
  .video-panel {
    width: 95vw;
    max-height: 95vh;
  }
  
  .video-panel-head {
    padding: 16px 16px 0;
  }
  
  .video-panel-body {
    padding: 0 16px 16px;
  }
  
  .modal-footer {
    flex-direction: column;
  }
  
  .modal-button {
    width: 100%;
    justify-content: center;
  }
}
