/* ==========================================================================
   JAKUB RATAJ — CONTENT EDITOR & CMS STYLESHEET
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Space+Grotesk:wght@400;500;700&family=Oswald:wght@400;500&display=swap');

:root {
  --admin-bg: #09090b;
  --admin-sidebar: #0f0f13;
  --admin-card: #141419;
  --admin-card-hover: #1a1a22;
  --admin-border: rgba(255, 255, 255, 0.08);
  --admin-border-focus: rgba(255, 255, 255, 0.25);
  --admin-text: #f4f4f6;
  --admin-muted: #93939f;
  --admin-dim: #5c5c68;
  --admin-accent: #ffffff;
  --admin-success: #10b981;
  --admin-danger: #ef4444;
  --admin-warning: #f59e0b;
  --admin-blue: #3b82f6;
  
  --font-sans: 'Inter', -apple-system, sans-serif;
  --font-heading: 'Space Grotesk', sans-serif;
  --font-nav: 'Oswald', sans-serif;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  background-color: var(--admin-bg);
  color: var(--admin-text);
  line-height: 1.5;
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* ==========================================================================
   SIDEBAR
   ========================================================================== */
.admin-sidebar {
  width: 280px;
  background-color: var(--admin-sidebar);
  border-right: 1px solid var(--admin-border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  user-select: none;
}

.sidebar-header {
  padding: 1.5rem 1.4rem;
  border-bottom: 1px solid var(--admin-border);
}

.sidebar-logo {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--admin-text);
}

.sidebar-badge {
  display: inline-block;
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--admin-muted);
  margin-top: 0.4rem;
}

.sidebar-nav {
  flex-grow: 1;
  overflow-y: auto;
  padding: 1rem 0.8rem;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.nav-item-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: 6px;
  background: transparent;
  border: none;
  color: var(--admin-muted);
  font-family: var(--font-sans);
  font-size: 0.88rem;
  text-align: left;
  cursor: pointer;
  transition: all 0.2s ease;
}

.nav-item-btn:hover {
  background: rgba(255, 255, 255, 0.04);
  color: var(--admin-text);
}

.nav-item-btn.active {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-weight: 500;
}

.nav-item-btn svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
}

.sidebar-footer {
  padding: 1rem 1.4rem;
  border-top: 1px solid var(--admin-border);
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.sidebar-footer a {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--admin-border);
  color: var(--admin-text);
  font-size: 0.82rem;
  text-decoration: none;
  transition: all 0.2s ease;
}

.sidebar-footer a:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

/* ==========================================================================
   MAIN CONTENT AREA
   ========================================================================== */
.admin-main {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--admin-bg);
}

.admin-topbar {
  height: 64px;
  background: var(--admin-sidebar);
  border-bottom: 1px solid var(--admin-border);
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.topbar-title {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 500;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.save-status {
  font-size: 0.78rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--admin-muted);
}

.save-status.unsaved {
  color: var(--admin-warning);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--admin-success);
}

.save-status.unsaved .status-dot {
  background: var(--admin-warning);
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 1.2rem;
  border-radius: 6px;
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.2s ease;
}

.btn-primary {
  background: #ffffff;
  color: #000000;
}

.btn-primary:hover {
  background: #e2e2e8;
  transform: translateY(-1px);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--admin-border);
  color: var(--admin-text);
}

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

.btn-danger {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.3);
  color: #ef4444;
}

.btn-danger:hover {
  background: rgba(239, 68, 68, 0.3);
}

.btn-sm {
  padding: 0.35rem 0.75rem;
  font-size: 0.78rem;
}

/* ==========================================================================
   TAB PANELS & FORMS
   ========================================================================== */
.admin-content-scroll {
  flex-grow: 1;
  overflow-y: auto;
  padding: 2.5rem;
}

.tab-panel {
  display: none;
  max-width: 1040px;
  margin: 0 auto;
}

.tab-panel.active {
  display: block;
}

.panel-header {
  margin-bottom: 2rem;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.panel-title {
  font-family: var(--font-heading);
  font-size: 1.6rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
}

.panel-desc {
  font-size: 0.88rem;
  color: var(--admin-muted);
}

/* Cards & Form Controls */
.admin-card {
  background: var(--admin-card);
  border: 1px solid var(--admin-border);
  border-radius: 8px;
  padding: 1.8rem;
  margin-bottom: 1.8rem;
}

.card-title {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.2rem;
}

.form-grid-1 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.2rem;
}

.form-grid-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 1.2rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.form-group.full-width {
  grid-column: 1 / -1;
}

.form-label {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--admin-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.form-input,
.form-select,
.form-textarea {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--admin-border);
  border-radius: 6px;
  padding: 0.65rem 0.85rem;
  color: var(--admin-text);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s ease;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--admin-border-focus);
  background: rgba(0, 0, 0, 0.6);
}

.form-textarea {
  min-height: 100px;
  resize: vertical;
  line-height: 1.6;
}

/* ==========================================================================
   ITEM LISTS (Works, Events, Gallery, CDs)
   ========================================================================== */
.items-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.item-row {
  background: var(--admin-card);
  border: 1px solid var(--admin-border);
  border-radius: 8px;
  padding: 1.4rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  transition: all 0.2s ease;
}

.item-row:hover {
  border-color: rgba(255, 255, 255, 0.18);
}

.item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 0.8rem;
  border-bottom: 1px solid var(--admin-border);
}

.item-badge {
  font-size: 0.72rem;
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--admin-muted);
}

.item-controls {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.icon-btn {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--admin-border);
  color: var(--admin-muted);
  cursor: pointer;
  transition: all 0.15s ease;
}

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

.icon-btn.danger:hover {
  background: rgba(239, 68, 68, 0.3);
  color: #ef4444;
  border-color: rgba(239, 68, 68, 0.5);
}

/* Image preview box in gallery / CD items */
.img-preview-box {
  width: 100px;
  height: 100px;
  border-radius: 6px;
  border: 1px solid var(--admin-border);
  overflow: hidden;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.img-preview-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.upload-dropzone {
  border: 2px dashed var(--admin-border);
  border-radius: 8px;
  padding: 2rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s ease;
  background: rgba(255, 255, 255, 0.02);
}

.upload-dropzone:hover {
  border-color: rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.04);
}

/* Toast Notifications */
.admin-toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: #18181f;
  border: 1px solid var(--admin-border);
  border-radius: 8px;
  padding: 1rem 1.5rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  gap: 0.8rem;
  font-size: 0.88rem;
  z-index: 9999;
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.admin-toast.show {
  transform: translateY(0);
  opacity: 1;
}

.toast-success {
  border-left: 4px solid var(--admin-success);
}

.toast-error {
  border-left: 4px solid var(--admin-danger);
}

/* --- ASSETS & FILES MANAGER --- */
.assets-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

.asset-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.85rem;
  display: flex;
  gap: 0.85rem;
  align-items: center;
  transition: border-color 0.2s ease;
}

.asset-card:hover {
  border-color: rgba(255, 255, 255, 0.2);
}

.asset-thumb-box {
  width: 58px;
  height: 58px;
  border-radius: 4px;
  background: #111;
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}

.asset-thumb-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.asset-thumb-box .pdf-icon {
  font-size: 0.72rem;
  font-weight: 700;
  color: #ff5555;
  border: 1px solid rgba(255,85,85,0.4);
  padding: 2px 4px;
  border-radius: 3px;
}

.asset-info {
  flex-grow: 1;
  min-width: 0;
}

.asset-name {
  font-size: 0.82rem;
  font-weight: 500;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 0.15rem;
}

.asset-meta {
  font-size: 0.72rem;
  color: var(--text-dim);
  margin-bottom: 0.4rem;
}

.asset-actions {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.asset-btn-action {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  font-size: 0.72rem;
  padding: 0.2rem 0.45rem;
  border-radius: 3px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  transition: all 0.15s ease;
}

.asset-btn-action:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}
