/* ==========================================================================
   Topic Media Gallery Admin Studio - Stylesheet
   Modern, responsive setup interface for mapping topics, definitions & media
   Mobile-compatible, touch-friendly, dark glassmorphism styling
   ========================================================================== */

.gas-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(8, 12, 22, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  z-index: 1000000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  box-sizing: border-box;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.28s ease, visibility 0.28s ease;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: #f8fafc;
}

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

.gas-studio-window {
  width: 100%;
  max-width: 1280px;
  height: 92vh;
  max-height: 900px;
  background: rgba(15, 23, 42, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.7), 0 0 35px rgba(14, 165, 233, 0.2);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: scale(0.97) translateY(10px);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.gas-modal-backdrop.gas-active .gas-studio-window {
  transform: scale(1) translateY(0);
}

/* Header */
.gas-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 22px;
  background: rgba(10, 15, 29, 0.85);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  gap: 12px;
  flex-wrap: wrap;
}

.gas-header-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.gas-header-icon {
  background: linear-gradient(135deg, #0ea5e9, #6366f1);
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  box-shadow: 0 0 14px rgba(14, 165, 233, 0.4);
}

.gas-header-text h3 {
  font-size: 17px;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
}

.gas-header-text p {
  font-size: 12px;
  color: #94a3b8;
}

.gas-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.gas-btn-close {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(239, 68, 68, 0.14);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #fca5a5;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.gas-btn-close:hover {
  background: #ef4444;
  color: white;
  transform: rotate(90deg) scale(1.08);
}

/* Studio Tabs */
.gas-tabs-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 22px;
  background: rgba(15, 23, 42, 0.7);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  overflow-x: auto;
}

.gas-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  color: #94a3b8;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.gas-tab-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
}

.gas-tab-btn.active {
  background: rgba(14, 165, 233, 0.18);
  border-color: rgba(56, 189, 248, 0.4);
  color: #38bdf8;
}

/* Studio Body Layout */
.gas-body {
  display: flex;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

/* Left Topic Sidebar */
.gas-topic-list-panel {
  width: 320px;
  background: rgba(10, 15, 29, 0.65);
  border-right: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.gas-panel-header {
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.gas-panel-title {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #94a3b8;
}

.gas-btn-add {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  background: rgba(16, 185, 129, 0.2);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #34d399;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.gas-btn-add:hover {
  background: #10b981;
  color: white;
}

.gas-topic-items-container {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.gas-topic-item-card {
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.gas-topic-item-card:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.18);
}

.gas-topic-item-card.active {
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.2), rgba(2, 132, 199, 0.3));
  border-color: #0ea5e9;
  box-shadow: 0 0 12px rgba(14, 165, 233, 0.25);
}

.gas-topic-item-info {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.gas-topic-item-icon {
  font-size: 16px;
  flex-shrink: 0;
}

.gas-topic-item-texts {
  min-width: 0;
}

.gas-topic-item-title {
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gas-topic-item-meta {
  font-size: 11px;
  color: #94a3b8;
}

.gas-topic-item-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  opacity: 0.6;
  transition: opacity 0.2s ease;
}

.gas-topic-item-card:hover .gas-topic-item-actions {
  opacity: 1;
}

.gas-icon-mini-btn {
  width: 22px;
  height: 22px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
  border: none;
  color: #cbd5e1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.gas-icon-mini-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
}

.gas-icon-mini-btn.delete:hover {
  background: #ef4444;
  color: #fff;
}

/* Right Detail Editor Panel */
.gas-editor-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  padding: 22px;
  box-sizing: border-box;
  background: rgba(15, 23, 42, 0.5);
}

.gas-form-section {
  background: rgba(24, 33, 58, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 18px;
  margin-bottom: 20px;
}

.gas-section-heading {
  font-size: 14px;
  font-weight: 700;
  color: #38bdf8;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.gas-form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin-bottom: 14px;
}

.gas-form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.gas-label {
  font-size: 12px;
  font-weight: 600;
  color: #cbd5e1;
  display: flex;
  align-items: center;
  gap: 6px;
}

.gas-input,
.gas-select,
.gas-textarea {
  background: rgba(10, 15, 29, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  color: #fff;
  padding: 9px 12px;
  font-size: 13px;
  font-family: inherit;
  outline: none;
  transition: all 0.2s ease;
  box-sizing: border-box;
  width: 100%;
}

.gas-input:focus,
.gas-select:focus,
.gas-textarea:focus {
  border-color: #0ea5e9;
  box-shadow: 0 0 10px rgba(14, 165, 233, 0.3);
}

.gas-textarea {
  resize: vertical;
  min-height: 75px;
  line-height: 1.5;
}

/* Media Sequence Steps List */
.gas-media-step-card {
  background: rgba(10, 15, 29, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 14px;
  margin-bottom: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
}

.gas-step-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.gas-step-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(14, 165, 233, 0.2);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.gas-step-card-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Footer Action Bar */
.gas-footer {
  padding: 14px 22px;
  background: rgba(10, 15, 29, 0.95);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.gas-footer-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.gas-footer-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.gas-btn-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid transparent;
}

.gas-btn-primary {
  background: linear-gradient(135deg, #0ea5e9, #0284c7);
  color: white;
  box-shadow: 0 0 14px rgba(14, 165, 233, 0.35);
}

.gas-btn-primary:hover {
  background: linear-gradient(135deg, #38bdf8, #0ea5e9);
  transform: translateY(-1px);
}

.gas-btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.15);
  color: #cbd5e1;
}

.gas-btn-secondary:hover {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
}

.gas-btn-danger {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.35);
  color: #fca5a5;
}

.gas-btn-danger:hover {
  background: #ef4444;
  color: #fff;
}

/* ==========================================================================
   Mobile Compatibility & Responsive Breakpoints
   ========================================================================== */
@media (max-width: 900px) {
  .gas-body {
    flex-direction: column;
  }
  .gas-topic-list-panel {
    width: 100%;
    max-height: 220px;
    border-right: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }
  .gas-topic-items-container {
    flex-direction: row;
    overflow-x: auto;
    overflow-y: hidden;
  }
  .gas-topic-item-card {
    min-width: 190px;
  }
}

@media (max-width: 600px) {
  .gas-modal-backdrop {
    padding: 0;
  }
  .gas-studio-window {
    height: 100vh;
    max-height: 100vh;
    border-radius: 0;
    border: none;
  }
  .gas-header {
    padding: 10px 14px;
  }
  .gas-editor-panel {
    padding: 14px;
  }
  .gas-footer {
    padding: 10px 14px;
  }
  .gas-footer-left, .gas-footer-right {
    width: 100%;
    justify-content: stretch;
  }
  .gas-btn-action {
    flex: 1;
    justify-content: center;
    font-size: 12px;
    padding: 8px 10px;
  }
}
