/* ==========================================================================
   PORTFOLIO GALLERY - LIGHT THEME (MINIMALIST & CLEAN)
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700&display=swap');

:root {
  --bg-main: #f8fafc;
  --bg-card: #ffffff;
  --bg-card-hover: #ffffff;
  --border-color: #e2e8f0;
  --border-hover: #cbd5e1;
  
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;

  --accent-primary: #0f172a;
  --accent-blue: #2563eb;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-full: 9999px;

  --shadow-card: 0 2px 8px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.02);
  --shadow-hover: 0 12px 24px -4px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.03);
  --shadow-modal: 0 20px 40px -10px rgba(0, 0, 0, 0.2);

  --transition-fast: 0.2s ease;
  --transition-smooth: 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Global Reset */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--bg-main);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
  padding-top: 2rem;
}

/* App Container */
.app-container {
  max-width: 1360px;
  margin: 0 auto;
  padding: 0 1.5rem 3rem 1.5rem;
}

/* Controls Bar (Filters & Search) */
.controls-wrapper {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 2rem;
}

@media (min-width: 640px) {
  .controls-wrapper {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

.filter-pills {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 0.25rem;
}

.filter-pill {
  padding: 0.5rem 1.1rem;
  border-radius: var(--radius-full);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition-fast);
}

.filter-pill:hover {
  border-color: var(--border-hover);
  color: var(--text-primary);
}

.filter-pill.active {
  background: var(--text-primary);
  color: #ffffff;
  border-color: var(--text-primary);
}

.search-box {
  position: relative;
  min-width: 240px;
}

.search-input {
  width: 100%;
  padding: 0.55rem 2.2rem 0.55rem 1.1rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  color: var(--text-primary);
  font-size: 0.875rem;
  outline: none;
  transition: var(--transition-fast);
}

.search-input:focus {
  border-color: var(--text-primary);
  box-shadow: 0 0 0 3px rgba(15, 23, 42, 0.08);
}

.clear-search-btn {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  display: none;
  font-size: 1.1rem;
}

.clear-search-btn.visible {
  display: block;
}

/* Masonry Gallery Layout */
.gallery-masonry {
  columns: 3 300px;
  column-gap: 1.25rem;
  width: 100%;
}

@media (max-width: 600px) {
  .gallery-masonry {
    columns: 1 100%;
  }
}

/* Media Card */
.gallery-card {
  break-inside: avoid;
  margin-bottom: 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  position: relative;
  cursor: pointer;
  transition: var(--transition-smooth);
  box-shadow: var(--shadow-card);
}

.gallery-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
  border-color: var(--border-hover);
}

.card-media-wrapper {
  position: relative;
  width: 100%;
  overflow: hidden;
  background: #f1f5f9;
}

.card-media-wrapper img,
.card-media-wrapper video {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.gallery-card:hover .card-media-wrapper img {
  transform: scale(1.02);
}

/* Video Badge & Overlay */
.video-play-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 52px;
  height: 52px;
  border-radius: var(--radius-full);
  background: rgba(15, 23, 42, 0.85);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  transition: var(--transition-fast);
}

.gallery-card:hover .video-play-overlay {
  transform: translate(-50%, -50%) scale(1.1);
  background: #000000;
}

.media-type-badge {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-full);
  background: rgba(15, 23, 42, 0.8);
  color: #ffffff;
  font-size: 0.7rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  text-transform: uppercase;
}

.no-results {
  text-align: center;
  padding: 4rem 1rem;
  color: var(--text-muted);
  display: none;
}

.no-results.visible {
  display: block;
}

/* ==========================================================================
   SIMPLIFIED LIGHTBOX MODAL (MEDIA LEFT, PLAIN TEXT RIGHT)
   ========================================================================== */

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-container {
  width: 100%;
  max-width: 1200px;
  height: 82vh;
  max-height: 780px;
  background: #ffffff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-modal);
  display: flex;
  overflow: hidden;
  position: relative;
  transform: scale(0.98);
  transition: transform 0.25s ease;
}

.modal-overlay.active .modal-container {
  transform: scale(1);
}

.modal-close-btn {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: #f1f5f9;
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  cursor: pointer;
  z-index: 20;
  transition: var(--transition-fast);
}

.modal-close-btn:hover {
  background: #e2e8f0;
}

/* Left Pane: Media Display */
.modal-media-pane {
  flex: 1.4;
  background: #000000;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  padding: 1rem;
}

.modal-media-wrapper {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-media-wrapper img,
.modal-media-wrapper video {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.modal-nav-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.85);
  border: none;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  cursor: pointer;
  z-index: 10;
  transition: var(--transition-fast);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
}

.modal-nav-arrow.prev { left: 1rem; }
.modal-nav-arrow.next { right: 1rem; }

.modal-nav-arrow:hover {
  background: #ffffff;
  transform: translateY(-50%) scale(1.08);
}

/* Right Pane: Plain Text Description Pane */
.modal-info-pane {
  flex: 1;
  background: #ffffff;
  border-left: 1px solid var(--border-color);
  padding: 2.5rem 2rem 2rem 2rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow-y: auto;
}

.info-content {
  margin-bottom: 2rem;
}

.info-description {
  font-size: 1rem;
  color: var(--text-primary);
  line-height: 1.75;
  white-space: pre-line;
}

.modal-footer-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 1rem;
  border-top: 1px solid var(--border-color);
  margin-top: auto;
}

.modal-counter {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 600;
}

.modal-nav-btns {
  display: flex;
  gap: 0.5rem;
}

.modal-btn {
  padding: 0.45rem 0.9rem;
  border-radius: var(--radius-sm);
  background: #f1f5f9;
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  font-size: 0.825rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-fast);
}

.modal-btn:hover {
  background: #e2e8f0;
}

/* Mobile Responsive */
@media (max-width: 800px) {
  .modal-container {
    flex-direction: column;
    height: 90vh;
    max-height: none;
    overflow-y: auto;
  }

  .modal-media-pane {
    flex: none;
    height: 45vh;
  }

  .modal-info-pane {
    flex: 1;
    border-left: none;
    border-top: 1px solid var(--border-color);
    padding: 1.5rem;
  }
}
