/* ═══════════════════════════════════════════════════════════════════════════
   Cloud 9 Cruise — Admin Image Manager Stylesheet
   ═══════════════════════════════════════════════════════════════════════════ */

:root {
  --navy:       #0d1b2a;
  --navy-mid:   #162436;
  --gold:       #c9a84c;
  --gold-light: #e2c278;
  --white:      #ffffff;
  --off-white:  #f8f6f1;
  --bg:         #f2f4f7;
  --text-dark:  #1a1a1a;
  --text-mid:   #4a4a4a;
  --text-light: #888888;
  --border:     #e0e4ea;
  --success:    #22c55e;
  --danger:     #ef4444;
  --font-sans:  'Montserrat', sans-serif;
  --radius:     12px;
  --shadow:     0 4px 16px rgba(0,0,0,0.08);
  --shadow-lg:  0 8px 32px rgba(0,0,0,0.12);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; }

body.admin-body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text-dark);
  min-height: 100vh;
}

/* ── Layout ─────────────────────────────────────────────────────────────── */
.admin-wrap { min-height: 100vh; display: flex; flex-direction: column; }
.admin-main { flex: 1; max-width: 1300px; margin: 0 auto; width: 100%; padding: 32px 24px 60px; }

/* ── Header ─────────────────────────────────────────────────────────────── */
.admin-header {
  background: var(--navy);
  border-bottom: 2px solid rgba(201,168,76,0.3);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 12px rgba(0,0,0,0.2);
}

.admin-header-inner {
  max-width: 1300px;
  margin: 0 auto;
  padding: 0 24px;
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.admin-logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.admin-logo i {
  width: 40px; height: 40px;
  background: var(--gold);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--navy);
  font-size: 0.95rem;
}

.admin-logo span {
  font-size: 1rem;
  font-weight: 700;
  color: white;
  display: block;
  line-height: 1.2;
}

.admin-logo small {
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  color: var(--gold);
}

.admin-nav { display: flex; align-items: center; gap: 12px; }

.admin-btn-outline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  font-weight: 600;
  color: rgba(255,255,255,0.8);
  border: 1.5px solid rgba(255,255,255,0.25);
  padding: 8px 16px;
  border-radius: 8px;
  text-decoration: none;
  transition: all 0.2s;
}

.admin-btn-outline:hover { color: white; border-color: white; background: rgba(255,255,255,0.08); }

.admin-btn-danger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  font-weight: 600;
  color: rgba(239,68,68,0.9);
  border: 1.5px solid rgba(239,68,68,0.4);
  padding: 8px 16px;
  border-radius: 8px;
  text-decoration: none;
  transition: all 0.2s;
}

.admin-btn-danger:hover { background: rgba(239,68,68,0.1); border-color: var(--danger); }

/* ── Intro ──────────────────────────────────────────────────────────────── */
.admin-intro {
  margin-bottom: 2rem;
}

.admin-intro h1 {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 0.4rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.admin-intro h1 i { color: var(--gold); }

.admin-intro > p {
  font-size: 0.92rem;
  color: var(--text-mid);
  margin-bottom: 1rem;
}

.admin-tip {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  background: rgba(201,168,76,0.08);
  border: 1px solid rgba(201,168,76,0.3);
  border-radius: 10px;
  padding: 12px 16px;
  font-size: 0.85rem;
  color: var(--text-mid);
  line-height: 1.5;
}

.admin-tip i { color: var(--gold); flex-shrink: 0; margin-top: 2px; }

.admin-tip a { color: var(--gold); text-decoration: underline; }

/* ── Save Banner ─────────────────────────────────────────────────────────── */
.save-banner {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: #dcfce7;
  border: 1px solid #86efac;
  color: #166534;
  border-radius: 10px;
  padding: 12px 18px;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
  transition: opacity 0.4s;
}

.save-banner.hidden { display: none; }
.save-banner i { font-size: 1.1rem; }

/* ── Image Cards Grid ────────────────────────────────────────────────────── */
.image-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
  gap: 1.5rem;
}

.image-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  border: 1px solid var(--border);
  transition: box-shadow 0.2s, transform 0.2s;
}

.image-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }

/* ── Image Preview ───────────────────────────────────────────────────────── */
.ic-preview-wrap {
  position: relative;
  aspect-ratio: 16/9;
  overflow: hidden;
  background: #e8ecf0;
}

.ic-preview {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}

.image-card:hover .ic-preview { transform: scale(1.03); }

.ic-preview-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.image-card:hover .ic-preview-overlay { background: rgba(0,0,0,0.3); }

.ic-preview-overlay span {
  color: white;
  font-size: 0.82rem;
  font-weight: 600;
  opacity: 0;
  transition: opacity 0.2s;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.image-card:hover .ic-preview-overlay span { opacity: 1; }

/* ── Card Body ───────────────────────────────────────────────────────────── */
.ic-body { padding: 1.25rem; }

.ic-body h3 {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 4px;
}

.ic-desc {
  font-size: 0.78rem;
  color: var(--text-light);
  margin-bottom: 0.875rem;
  line-height: 1.4;
}

/* ── Tabs ────────────────────────────────────────────────────────────────── */
.ic-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 0.875rem;
  background: var(--bg);
  padding: 4px;
  border-radius: 8px;
}

.ic-tab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-light);
  background: none;
  border: none;
  padding: 7px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
}

.ic-tab.active {
  background: var(--white);
  color: var(--navy);
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}

.ic-tab i { font-size: 0.75rem; }

/* ── Tab Content ─────────────────────────────────────────────────────────── */
.ic-tab-content { display: block; }
.ic-tab-content.hidden { display: none; }

/* ── URL Input ───────────────────────────────────────────────────────────── */
.ic-input {
  width: 100%;
  font-family: var(--font-sans);
  font-size: 0.82rem;
  color: var(--text-dark);
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: 8px;
  padding: 9px 12px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  margin-bottom: 0.625rem;
}

.ic-input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(201,168,76,0.12);
}

/* ── Action Buttons ──────────────────────────────────────────────────────── */
.ic-actions { display: flex; gap: 8px; }

.ic-btn-preview,
.ic-btn-save {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 600;
  border: none;
  border-radius: 7px;
  padding: 8px 12px;
  cursor: pointer;
  transition: all 0.2s;
}

.ic-btn-preview {
  background: var(--bg);
  color: var(--text-mid);
  border: 1.5px solid var(--border);
}

.ic-btn-preview:hover { background: var(--border); }

.ic-btn-save {
  background: var(--gold);
  color: var(--navy);
  box-shadow: 0 2px 8px rgba(201,168,76,0.25);
}

.ic-btn-save:hover { background: var(--gold-light); transform: translateY(-1px); }

.ic-btn-save.saving { opacity: 0.7; cursor: not-allowed; }
.ic-btn-save.saved  { background: var(--success); color: white; }

/* ── Upload Zone ─────────────────────────────────────────────────────────── */
.upload-zone {
  border: 2px dashed var(--border);
  border-radius: 10px;
  padding: 24px 16px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  background: var(--bg);
}

.upload-zone:hover,
.upload-zone.drag-over {
  border-color: var(--gold);
  background: rgba(201,168,76,0.05);
}

.upload-zone i {
  font-size: 2rem;
  color: var(--gold);
  display: block;
  margin-bottom: 8px;
}

.upload-zone p {
  font-size: 0.85rem;
  color: var(--text-mid);
  margin-bottom: 4px;
}

.upload-zone p span { color: var(--gold); font-weight: 600; }

.upload-zone small { font-size: 0.75rem; color: var(--text-light); }

.upload-progress {
  margin-top: 10px;
  display: none;
}

.upload-progress-bar {
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}

.upload-progress-fill {
  height: 100%;
  background: var(--gold);
  border-radius: 2px;
  width: 0%;
  transition: width 0.3s;
}

/* ── Utility ─────────────────────────────────────────────────────────────── */
.hidden { display: none !important; }

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 860px) {
  .image-cards { grid-template-columns: 1fr; }
  .admin-header-inner { padding: 0 16px; }
  .admin-main { padding: 20px 16px 40px; }
  .admin-nav { gap: 8px; }
  .admin-btn-outline span,
  .admin-btn-danger span { display: none; }
}

@media (max-width: 480px) {
  .admin-logo span { font-size: 0.9rem; }
  .admin-intro h1 { font-size: 1.3rem; }
}
