/* =========================================================================
   AugmentBI — Scoped Google Drive DAM Layer Styles
   ========================================================================= */

.dam-app {
  background-color: #0b1321;
  color: #e2e8f0;
  min-height: calc(100vh - 80px);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  padding-bottom: 3rem;
}

/* App Header & Scope Bar */
.dam-topbar {
  background: #0f192c;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding: 1.25rem 0;
  position: sticky;
  top: 72px;
  z-index: 30;
  backdrop-filter: blur(12px);
}

.dam-topbar__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.dam-scope-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: 9999px;
  padding: 0.45rem 1rem;
  font-size: 0.85rem;
}

.dam-scope-pill .pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #10b981;
  box-shadow: 0 0 8px #10b981;
}

.dam-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Layout Grid */
.dam-workspace {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 1.5rem;
  margin-top: 1.5rem;
}

@media (max-width: 960px) {
  .dam-workspace {
    grid-template-columns: 1fr;
  }
}

/* Left Sidebar: Folder Tree & Scope Guard */
.dam-sidebar {
  background: #111e36;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 1.25rem;
  height: fit-content;
}

.dam-sidebar__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 0.85rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.dam-sidebar__title {
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
  color: #94a3b8;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.dam-scope-card {
  background: #0d1627;
  border: 1px solid rgba(24ca, 162, 70, 0.2);
  border-left: 3px solid #fca246;
  border-radius: 8px;
  padding: 0.85rem;
  margin-bottom: 1.25rem;
}

.dam-scope-card__name {
  font-weight: 600;
  color: #f8fafc;
  font-size: 0.925rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  word-break: break-all;
}

.dam-scope-card__meta {
  font-size: 0.75rem;
  color: #94a3b8;
  margin-top: 0.4rem;
  font-family: 'IBM Plex Mono', monospace;
}

.dam-scope-card__badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.7rem;
  color: #10b981;
  background: rgba(16, 185, 129, 0.12);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  margin-top: 0.5rem;
}

/* Tree Navigation */
.folder-tree {
  list-style: none;
  padding-left: 0;
  margin: 0;
}

.folder-tree-item {
  margin-bottom: 0.25rem;
}

.folder-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.45rem 0.65rem;
  border-radius: 6px;
  color: #cbd5e1;
  text-decoration: none;
  font-size: 0.85rem;
  transition: all 0.15s ease;
  cursor: pointer;
  border: 1px solid transparent;
}

.folder-link:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #f8fafc;
}

.folder-link.is-active {
  background: rgba(252, 162, 70, 0.15);
  color: #fca246;
  border-color: rgba(252, 162, 70, 0.3);
  font-weight: 600;
}

.folder-link__content {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.folder-link__badge {
  font-size: 0.7rem;
  background: rgba(255, 255, 255, 0.08);
  padding: 0.1rem 0.4rem;
  border-radius: 10px;
  color: #94a3b8;
}

.folder-nested-tree {
  list-style: none;
  padding-left: 1.1rem;
  margin-top: 0.2rem;
  border-left: 1px dashed rgba(255, 255, 255, 0.15);
}

/* Main Content Area */
.dam-main {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

/* Breadcrumbs & Scope Indicator */
.dam-breadcrumbs {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: #94a3b8;
  padding: 0.6rem 1rem;
  background: #111e36;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
}

.dam-breadcrumbs a {
  color: #cbd5e1;
  text-decoration: none;
}

.dam-breadcrumbs a:hover {
  color: #fca246;
}

.dam-breadcrumbs .current {
  color: #f8fafc;
  font-weight: 600;
}

/* Filter & Search Bar */
.dam-filterbar {
  background: #111e36;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 1rem 1.25rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
}

.dam-search-box {
  position: relative;
  flex: 1;
  min-width: 260px;
}

.dam-search-box i {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: #64748b;
}

.dam-search-input {
  width: 100%;
  background: #09101d;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  padding: 0.65rem 1rem 0.65rem 2.6rem;
  color: #fff;
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s;
}

.dam-search-input:focus {
  border-color: #fca246;
  box-shadow: 0 0 0 2px rgba(252, 162, 70, 0.2);
}

.dam-filter-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
}

.dam-select {
  background: #09101d;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  padding: 0.65rem 1rem;
  color: #e2e8f0;
  font-size: 0.85rem;
  cursor: pointer;
  outline: none;
}

.dam-view-toggle {
  display: flex;
  background: #09101d;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  padding: 2px;
}

.dam-view-btn {
  background: transparent;
  border: none;
  color: #94a3b8;
  padding: 0.45rem 0.75rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.85rem;
  transition: all 0.15s ease;
}

.dam-view-btn.is-active {
  background: #1e293b;
  color: #fca246;
}

/* Asset Grid */
.dam-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
}

.asset-card {
  background: #111e36;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  overflow: hidden;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  display: flex;
  flex-direction: column;
}

.asset-card:hover {
  transform: translateY(-2px);
  border-color: rgba(252, 162, 70, 0.4);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
}

.asset-card__thumb {
  position: relative;
  height: 160px;
  background: #09101d;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  cursor: pointer;
}

.asset-card__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.asset-card:hover .asset-card__thumb img {
  transform: scale(1.04);
}

.asset-card__thumb-fallback {
  font-size: 3rem;
  color: #475569;
}

.asset-status-tag {
  position: absolute;
  top: 0.65rem;
  right: 0.65rem;
  padding: 0.2rem 0.55rem;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  backdrop-filter: blur(8px);
}

.asset-status-tag--approved {
  background: rgba(16, 185, 129, 0.85);
  color: #fff;
}

.asset-status-tag--in-review {
  background: rgba(245, 158, 11, 0.85);
  color: #fff;
}

.asset-status-tag--draft {
  background: rgba(100, 116, 139, 0.85);
  color: #fff;
}

.asset-type-badge {
  position: absolute;
  bottom: 0.65rem;
  left: 0.65rem;
  font-size: 0.72rem;
  background: rgba(15, 23, 42, 0.85);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  color: #cbd5e1;
  font-family: 'IBM Plex Mono', monospace;
}

.asset-card__body {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.asset-card__title {
  font-size: 0.95rem;
  font-weight: 600;
  color: #f8fafc;
  line-height: 1.35;
  margin-bottom: 0.4rem;
  cursor: pointer;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.asset-card__title:hover {
  color: #fca246;
}

.asset-card__path {
  font-size: 0.75rem;
  color: #64748b;
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.asset-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 1rem;
}

.asset-tag {
  font-size: 0.7rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  color: #94a3b8;
}

.asset-card__footer {
  margin-top: auto;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.78rem;
  color: #94a3b8;
}

.asset-card__drive-btn {
  color: #38bdf8;
  text-decoration: none;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.78rem;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  transition: background 0.15s;
}

.asset-card__drive-btn:hover {
  background: rgba(56, 189, 248, 0.12);
}

/* Detail Drawer / Modal */
.dam-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 480px;
  max-width: 100vw;
  background: #0f172a;
  box-shadow: -10px 0 30px rgba(0, 0, 0, 0.6);
  border-left: 1px solid rgba(255, 255, 255, 0.1);
  z-index: 100;
  transform: translateX(100%);
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
}

.dam-drawer.is-open {
  transform: translateX(0);
}

.dam-drawer__header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.dam-drawer__body {
  padding: 1.5rem;
  overflow-y: auto;
  flex: 1;
}

.dam-drawer__backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(2px);
  z-index: 99;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.dam-drawer__backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}

.dam-drawer-meta-table {
  width: 100%;
  margin-top: 1.25rem;
  border-collapse: collapse;
}

.dam-drawer-meta-table td {
  padding: 0.6rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 0.85rem;
}

.dam-drawer-meta-table td:first-child {
  color: #94a3b8;
  width: 35%;
  font-weight: 500;
}

/* Modal styles for scope change and indexing */
.dam-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  z-index: 120;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.dam-modal__card {
  background: #111e36;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  width: 100%;
  max-width: 560px;
  overflow: hidden;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
}

.dam-modal__head {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.dam-modal__body {
  padding: 1.5rem;
}

.dam-modal__footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  background: #0c1626;
}

.dam-form-group {
  margin-bottom: 1.25rem;
}

.dam-form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
  color: #e2e8f0;
}

.dam-form-hint {
  font-size: 0.75rem;
  color: #94a3b8;
  margin-top: 0.3rem;
}

.dam-form-input, .dam-form-select, .dam-form-textarea {
  width: 100%;
  background: #09101d;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  padding: 0.65rem 0.85rem;
  color: #fff;
  font-size: 0.9rem;
  outline: none;
}

.dam-form-input:focus, .dam-form-select:focus, .dam-form-textarea:focus {
  border-color: #fca246;
}
