/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --bg: #0a0a0f;
  --bg2: #111118;
  --surface: #16161f;
  --surface2: #1e1e2a;
  --border: rgba(255,255,255,0.08);
  --purple: #a78bfa;
  --blue: #38bdf8;
  --green: #34d399;
  --red: #f87171;
  --text: #f1f5f9;
  --text2: #94a3b8;
  --text3: #475569;
  --radius: 14px;
  --shadow: 0 20px 60px rgba(0,0,0,0.5);
  --transition: 0.25s cubic-bezier(.4,0,.2,1);
  font-family: 'Inter', sans-serif;
}
body { background: var(--bg); color: var(--text); min-height: 100vh; overflow-x: hidden; }
.hidden { display: none !important; }

/* ===== LOGIN PAGE ===== */
.login-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; position: relative; }
.bg-particles { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.bg-particles span {
  position: absolute; border-radius: 50%;
  background: linear-gradient(135deg, var(--purple), var(--blue));
  opacity: 0.07; animation: float 12s infinite;
}
.bg-particles span:nth-child(1){width:300px;height:300px;top:-100px;left:-100px;animation-duration:14s;}
.bg-particles span:nth-child(2){width:200px;height:200px;top:10%;right:5%;animation-duration:10s;animation-delay:-3s;}
.bg-particles span:nth-child(3){width:150px;height:150px;bottom:20%;left:10%;animation-duration:16s;animation-delay:-6s;}
.bg-particles span:nth-child(4){width:400px;height:400px;bottom:-150px;right:-100px;animation-duration:18s;animation-delay:-2s;}
.bg-particles span:nth-child(5){width:100px;height:100px;top:40%;left:40%;animation-duration:9s;animation-delay:-8s;}
.bg-particles span:nth-child(6){width:250px;height:250px;top:60%;right:20%;animation-duration:12s;animation-delay:-5s;}
.bg-particles span:nth-child(7){width:80px;height:80px;top:80%;left:30%;animation-duration:8s;animation-delay:-1s;}
.bg-particles span:nth-child(8){width:180px;height:180px;top:25%;left:60%;animation-duration:11s;animation-delay:-4s;}
@keyframes float {
  0%,100%{transform:translateY(0) rotate(0deg);}
  33%{transform:translateY(-30px) rotate(120deg);}
  66%{transform:translateY(20px) rotate(240deg);}
}
.login-wrapper { position: relative; z-index: 1; width: 100%; max-width: 440px; padding: 24px; }
.login-card {
  background: rgba(22,22,31,0.85);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 48px 40px 36px;
  box-shadow: var(--shadow), 0 0 0 1px rgba(167,139,250,0.05);
}
.login-logo { text-align: center; margin-bottom: 36px; }
.logo-icon {
  width: 72px; height: 72px; margin: 0 auto 16px;
  background: linear-gradient(135deg, rgba(167,139,250,0.15), rgba(56,189,248,0.15));
  border: 1px solid rgba(167,139,250,0.2);
  border-radius: 20px; display: flex; align-items: center; justify-content: center; padding: 14px;
}
.logo-icon.small { width: 40px; height: 40px; border-radius: 10px; padding: 7px; margin: 0; }
.logo-title { font-size: 1.5rem; font-weight: 700; background: linear-gradient(135deg, var(--purple), var(--blue)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.logo-sub { font-size: 0.85rem; color: var(--text2); margin-top: 4px; }
.form-group { margin-bottom: 20px; }
.form-group label { display: block; font-size: 0.8rem; font-weight: 600; color: var(--text2); margin-bottom: 8px; letter-spacing: 0.05em; text-transform: uppercase; }
.input-wrapper { position: relative; display: flex; align-items: center; }
.input-icon { position: absolute; left: 14px; width: 18px; height: 18px; color: var(--text3); pointer-events: none; }
.input-wrapper input {
  width: 100%; padding: 13px 16px 13px 44px;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 10px; color: var(--text); font-size: 0.95rem; font-family: inherit;
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}
.input-wrapper input:focus { border-color: var(--purple); box-shadow: 0 0 0 3px rgba(167,139,250,0.15); }
.input-wrapper input::placeholder { color: var(--text3); }
.toggle-pwd { position: absolute; right: 12px; background: none; border: none; cursor: pointer; color: var(--text3); padding: 4px; display: flex; transition: color var(--transition); }
.toggle-pwd:hover { color: var(--text2); }
.toggle-pwd svg { width: 18px; height: 18px; }
.login-error {
  display: flex; align-items: center; gap: 8px; padding: 12px 14px;
  background: rgba(248,113,113,0.1); border: 1px solid rgba(248,113,113,0.25);
  border-radius: 10px; color: var(--red); font-size: 0.875rem; margin-bottom: 16px;
  animation: shake 0.4s ease;
}
.login-error svg { width: 16px; height: 16px; flex-shrink: 0; }
@keyframes shake { 0%,100%{transform:translateX(0);} 25%{transform:translateX(-6px);} 75%{transform:translateX(6px);} }
.btn-login {
  width: 100%; padding: 14px; border: none; border-radius: 10px; cursor: pointer;
  background: linear-gradient(135deg, var(--purple), var(--blue));
  color: #fff; font-size: 1rem; font-weight: 600; font-family: inherit;
  position: relative; overflow: hidden; transition: opacity var(--transition), transform var(--transition);
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.btn-login:hover { opacity: 0.9; transform: translateY(-1px); }
.btn-login:active { transform: translateY(0); }
.btn-loader { width: 18px; height: 18px; border: 2px solid rgba(255,255,255,0.3); border-top-color: #fff; border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.login-footer { text-align: center; font-size: 0.78rem; color: var(--text3); margin-top: 24px; }

/* ===== ADMIN LAYOUT ===== */
.admin-body { display: flex; min-height: 100vh; background: var(--bg); }
.sidebar {
  width: 220px; min-height: 100vh; background: var(--bg2);
  border-right: 1px solid var(--border); display: flex; flex-direction: column;
  position: fixed; top: 0; left: 0; z-index: 100;
}
.sidebar-logo { display: flex; align-items: center; gap: 10px; padding: 24px 20px; border-bottom: 1px solid var(--border); font-weight: 700; font-size: 0.95rem; }
.sidebar-nav { flex: 1; padding: 16px 12px; display: flex; flex-direction: column; gap: 4px; }
.nav-item {
  display: flex; align-items: center; gap: 10px; padding: 10px 14px;
  border-radius: 10px; color: var(--text2); text-decoration: none; font-size: 0.875rem; font-weight: 500;
  transition: background var(--transition), color var(--transition);
}
.nav-item svg { width: 18px; height: 18px; }
.nav-item:hover { background: var(--surface2); color: var(--text); }
.nav-item.active { background: rgba(167,139,250,0.15); color: var(--purple); }
.sidebar-footer { padding: 16px 12px; border-top: 1px solid var(--border); display: flex; align-items: center; gap: 8px; }
.user-badge { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; }
.user-avatar { width: 32px; height: 32px; border-radius: 50%; background: linear-gradient(135deg, var(--purple), var(--blue)); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 0.8rem; flex-shrink: 0; }
.user-info { display: flex; flex-direction: column; min-width: 0; }
.user-name { font-size: 0.8rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { font-size: 0.7rem; color: var(--text3); }
.btn-logout { background: none; border: none; cursor: pointer; color: var(--text3); padding: 6px; border-radius: 8px; display: flex; transition: background var(--transition), color var(--transition); }
.btn-logout:hover { background: var(--surface2); color: var(--red); }
.btn-logout svg { width: 18px; height: 18px; }
.admin-main { margin-left: 220px; flex: 1; padding: 32px; min-height: 100vh; padding-bottom: 100px; }
.admin-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 28px; flex-wrap: wrap; gap: 16px; }
.admin-header h1 { font-size: 1.6rem; font-weight: 700; }
.admin-header p { color: var(--text2); font-size: 0.875rem; margin-top: 4px; }
.header-right { display: flex; align-items: center; gap: 12px; }
.status-badge { display: flex; align-items: center; gap: 8px; padding: 8px 14px; background: var(--surface); border: 1px solid var(--border); border-radius: 20px; font-size: 0.8rem; color: var(--text2); }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text3); transition: background 0.3s; }
.status-dot.active { background: var(--green); box-shadow: 0 0 8px var(--green); animation: pulse-dot 2s infinite; }
@keyframes pulse-dot { 0%,100%{opacity:1;} 50%{opacity:0.5;} }
.btn-open-show {
  display: flex; align-items: center; gap: 8px; padding: 10px 18px;
  background: linear-gradient(135deg, var(--purple), var(--blue));
  border: none; border-radius: 10px; color: #fff; font-size: 0.875rem; font-weight: 600; cursor: pointer;
  transition: opacity var(--transition), transform var(--transition);
}
.btn-open-show svg { width: 16px; height: 16px; }
.btn-open-show:hover { opacity: 0.85; transform: translateY(-1px); }
.btn-reload {
  display: flex; align-items: center; gap: 8px; padding: 10px 16px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  color: var(--text2); font-size: 0.875rem; font-weight: 600; cursor: pointer;
  transition: background var(--transition), color var(--transition), transform var(--transition);
}
.btn-reload svg { width: 15px; height: 15px; }
.btn-reload:hover { background: var(--surface2); color: var(--text); transform: translateY(-1px); }
.btn-reload.spinning svg { animation: spin 0.8s linear infinite; }
.gallery-controls { display: flex; align-items: center; gap: 12px; margin-bottom: 24px; flex-wrap: wrap; }
.search-box { display: flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 10px 14px; flex: 1; min-width: 200px; }
.search-box svg { width: 16px; height: 16px; color: var(--text3); flex-shrink: 0; }
.search-box input { background: none; border: none; outline: none; color: var(--text); font-family: inherit; font-size: 0.875rem; width: 100%; }
.search-box input::placeholder { color: var(--text3); }
.view-toggle { display: flex; gap: 4px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 4px; }
.view-btn { background: none; border: none; cursor: pointer; color: var(--text3); padding: 6px 8px; border-radius: 6px; display: flex; transition: background var(--transition), color var(--transition); }
.view-btn svg { width: 16px; height: 16px; }
.view-btn.active { background: var(--surface2); color: var(--purple); }
.image-count { font-size: 0.8rem; color: var(--text2); white-space: nowrap; }
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }
.gallery-grid.list-view { grid-template-columns: 1fr; gap: 8px; }

/* ===== GALLERY CARD ===== */
.gallery-card {
  background: var(--surface); border: 2px solid var(--border); border-radius: var(--radius);
  overflow: hidden; cursor: pointer; transition: border-color var(--transition), transform var(--transition), box-shadow var(--transition);
  position: relative; group: true;
}
.gallery-card:hover { border-color: rgba(167,139,250,0.4); transform: translateY(-3px); box-shadow: 0 12px 30px rgba(0,0,0,0.4); }
.gallery-card.selected { border-color: var(--purple); box-shadow: 0 0 0 3px rgba(167,139,250,0.2); }
.card-img-wrap { width: 100%; aspect-ratio: 16/9; overflow: hidden; background: var(--surface2); position: relative; }
.card-img-wrap img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s ease; }
.gallery-card:hover .card-img-wrap img { transform: scale(1.05); }
.card-overlay { position: absolute; inset: 0; background: linear-gradient(to top, rgba(0,0,0,0.7) 0%, transparent 60%); opacity: 0; transition: opacity var(--transition); display: flex; align-items: center; justify-content: center; }
.gallery-card:hover .card-overlay { opacity: 1; }
.card-overlay-btn { background: rgba(167,139,250,0.9); border: none; border-radius: 8px; color: #fff; font-size: 0.8rem; font-weight: 600; padding: 8px 16px; cursor: pointer; display: flex; align-items: center; gap: 6px; }
.card-overlay-btn svg { width: 14px; height: 14px; }
.card-selected-badge { position: absolute; top: 8px; right: 8px; background: var(--purple); color: #fff; border-radius: 6px; padding: 3px 8px; font-size: 0.7rem; font-weight: 700; display: none; }
.gallery-card.selected .card-selected-badge { display: block; }
.card-info { padding: 12px; }
.card-name { font-size: 0.85rem; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-meta { font-size: 0.75rem; color: var(--text3); margin-top: 2px; }
/* List view card */
.gallery-grid.list-view .gallery-card { display: flex; align-items: center; }
.gallery-grid.list-view .card-img-wrap { width: 120px; aspect-ratio: 16/9; flex-shrink: 0; }
.gallery-grid.list-view .card-info { flex: 1; }

/* ===== EMPTY STATE ===== */
.empty-state { text-align: center; padding: 80px 24px; color: var(--text3); }
.empty-state svg { width: 64px; height: 64px; margin: 0 auto 20px; display: block; }
.empty-state h3 { font-size: 1.1rem; font-weight: 600; color: var(--text2); margin-bottom: 8px; }
.empty-state p { font-size: 0.875rem; }
.empty-state code { background: var(--surface); padding: 2px 8px; border-radius: 6px; font-size: 0.8rem; }

/* ===== ACTIVE BAR ===== */
.active-bar { position: fixed; bottom: 0; left: 220px; right: 0; background: rgba(22,22,31,0.95); backdrop-filter: blur(12px); border-top: 1px solid var(--border); z-index: 200; padding: 12px 32px; }
.active-bar-inner { display: flex; align-items: center; gap: 16px; }
.active-bar img { width: 72px; height: 40px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); }
.active-info { flex: 1; min-width: 0; }
.active-label { display: block; font-size: 0.65rem; font-weight: 700; letter-spacing: 0.1em; color: var(--purple); text-transform: uppercase; }
.active-name { display: block; font-size: 0.9rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.btn-project { display: flex; align-items: center; gap: 8px; padding: 10px 20px; background: linear-gradient(135deg, var(--purple), var(--blue)); border: none; border-radius: 10px; color: #fff; font-size: 0.875rem; font-weight: 600; cursor: pointer; transition: opacity var(--transition); }
.btn-project svg { width: 16px; height: 16px; }
.btn-project:hover { opacity: 0.85; }
.btn-clear { background: none; border: 1px solid var(--border); border-radius: 8px; color: var(--text3); padding: 8px; cursor: pointer; display: flex; transition: background var(--transition), color var(--transition); }
.btn-clear:hover { background: var(--surface2); color: var(--red); }
.btn-clear svg { width: 18px; height: 18px; }

/* ===== SHOW PAGE ===== */
.show-body { background: #000; overflow: hidden; }
.show-container { width: 100vw; height: 100vh; position: relative; display: flex; align-items: center; justify-content: center; cursor: none; }
.show-container:hover { cursor: default; }
.show-waiting { text-align: center; color: var(--text2); user-select: none; }
.waiting-animation { position: relative; width: 120px; height: 120px; margin: 0 auto 32px; display: flex; align-items: center; justify-content: center; }
.pulse-ring { position: absolute; width: 100%; height: 100%; border-radius: 50%; border: 2px solid rgba(167,139,250,0.3); animation: pulse-ring 2.5s ease-out infinite; }
.pulse-ring.delay-1 { animation-delay: -0.8s; }
.pulse-ring.delay-2 { animation-delay: -1.6s; }
@keyframes pulse-ring { 0%{transform:scale(0.5);opacity:1;} 100%{transform:scale(1.5);opacity:0;} }
.waiting-icon { width: 60px; height: 60px; position: relative; z-index: 1; }
.show-waiting h2 { font-size: 1.5rem; font-weight: 700; margin-bottom: 8px; }
.show-waiting p { font-size: 0.9rem; }
.show-image-wrap { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: #000; }
.show-image-wrap img { max-width: 100%; max-height: 100%; object-fit: contain; transition: opacity 0.6s ease; animation: fadeInImage 0.6s ease; }
@keyframes fadeInImage { from{opacity:0;transform:scale(0.97);} to{opacity:1;transform:scale(1);} }
.show-overlay { position: absolute; bottom: 0; left: 0; right: 0; padding: 20px 32px; background: linear-gradient(to top, rgba(0,0,0,0.7) 0%, transparent 100%); font-size: 0.85rem; color: rgba(255,255,255,0.5); opacity: 0; transition: opacity 0.3s; }
.show-container:hover .show-overlay { opacity: 1; }
.show-controls { position: absolute; top: 20px; right: 20px; display: flex; gap: 8px; opacity: 0; transition: opacity 0.3s; z-index: 10; }
.show-container:hover .show-controls { opacity: 1; }
.show-btn { background: rgba(0,0,0,0.6); backdrop-filter: blur(8px); border: 1px solid rgba(255,255,255,0.15); border-radius: 10px; color: rgba(255,255,255,0.8); padding: 10px; cursor: pointer; display: flex; transition: background var(--transition), color var(--transition); }
.show-btn svg { width: 20px; height: 20px; }
.show-btn:hover { background: rgba(167,139,250,0.3); color: #fff; }
.show-watermark { position: absolute; bottom: 20px; right: 24px; font-size: 0.75rem; color: rgba(255,255,255,0.15); letter-spacing: 0.1em; user-select: none; }
.show-watermark { position: absolute; bottom: 20px; right: 24px; font-size: 0.75rem; color: rgba(255,255,255,0.15); letter-spacing: 0.1em; user-select: none; }

/* ===== UPLOAD BUTTON ===== */
.btn-upload {
  display: flex; align-items: center; gap: 8px; padding: 10px 18px;
  background: linear-gradient(135deg, rgba(167,139,250,0.2), rgba(56,189,248,0.2));
  border: 1px solid rgba(167,139,250,0.4); border-radius: 10px;
  color: var(--purple); font-size: 0.875rem; font-weight: 600; cursor: pointer;
  transition: background var(--transition), transform var(--transition);
}
.btn-upload svg { width: 16px; height: 16px; }
.btn-upload:hover { background: linear-gradient(135deg, rgba(167,139,250,0.3), rgba(56,189,248,0.3)); transform: translateY(-1px); }

/* ===== MODAL ===== */
.modal-overlay {
  position: fixed; inset: 0; z-index: 500;
  background: rgba(0,0,0,0.7); backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center; padding: 24px;
  animation: fadeIn 0.2s ease;
}
@keyframes fadeIn { from{opacity:0;} to{opacity:1;} }
.modal {
  background: var(--bg2); border: 1px solid var(--border); border-radius: 20px;
  width: 100%; max-width: 600px; max-height: 90vh;
  display: flex; flex-direction: column; overflow: hidden;
  box-shadow: 0 40px 80px rgba(0,0,0,0.6);
  animation: slideUp 0.25s ease;
}
@keyframes slideUp { from{transform:translateY(20px);opacity:0;} to{transform:translateY(0);opacity:1;} }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px; border-bottom: 1px solid var(--border); }
.modal-title { display: flex; align-items: center; gap: 10px; }
.modal-title svg { width: 20px; height: 20px; color: var(--purple); }
.modal-title h2 { font-size: 1.1rem; font-weight: 700; }
.modal-close { background: none; border: none; cursor: pointer; color: var(--text3); padding: 6px; border-radius: 8px; display: flex; transition: background var(--transition), color var(--transition); }
.modal-close:hover { background: var(--surface2); color: var(--red); }
.modal-close svg { width: 18px; height: 18px; }

/* ===== DROP ZONE ===== */
.drop-zone {
  margin: 24px; border: 2px dashed rgba(167,139,250,0.3); border-radius: 14px;
  padding: 36px 24px; text-align: center; cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
}
.drop-zone.drag-over { border-color: var(--purple); background: rgba(167,139,250,0.06); }
.drop-zone-icon { width: 72px; height: 72px; margin: 0 auto 16px; }
.drop-zone-text { font-size: 1rem; font-weight: 600; color: var(--text); margin-bottom: 4px; }
.drop-zone-sub { font-size: 0.85rem; color: var(--text3); margin-bottom: 12px; }
.btn-browse {
  display: inline-flex; align-items: center; padding: 10px 20px;
  background: linear-gradient(135deg, var(--purple), var(--blue));
  border: none; border-radius: 8px; color: #fff; font-size: 0.875rem; font-weight: 600;
  cursor: pointer; transition: opacity var(--transition);
}
.btn-browse:hover { opacity: 0.85; }
.drop-zone-hint { font-size: 0.78rem; color: var(--text3); margin-top: 12px; }

/* ===== UPLOAD LIST ===== */
.upload-list { flex: 1; overflow-y: auto; padding: 0 24px 8px; max-height: 280px; }
.upload-item { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.upload-item:last-child { border-bottom: none; }
.upload-thumb { width: 52px; height: 36px; object-fit: cover; border-radius: 6px; border: 1px solid var(--border); flex-shrink: 0; background: var(--surface2); }
.upload-info { flex: 1; min-width: 0; }
.upload-name { font-size: 0.85rem; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.upload-size { font-size: 0.75rem; color: var(--text3); }
.upload-progress { height: 3px; background: var(--surface2); border-radius: 2px; margin-top: 6px; overflow: hidden; }
.upload-progress-bar { height: 100%; background: linear-gradient(90deg, var(--purple), var(--blue)); border-radius: 2px; transition: width 0.3s ease; width: 0%; }
.upload-status { font-size: 0.75rem; font-weight: 600; white-space: nowrap; flex-shrink: 0; }
.upload-status.ok { color: var(--green); }
.upload-status.error { color: var(--red); }
.upload-status.pending { color: var(--text3); }
.upload-item-remove { background: none; border: none; cursor: pointer; color: var(--text3); padding: 4px; border-radius: 6px; display: flex; flex-shrink: 0; transition: color var(--transition), background var(--transition); }
.upload-item-remove:hover { color: var(--red); background: var(--surface2); }
.upload-item-remove svg { width: 14px; height: 14px; }

/* ===== MODAL FOOTER ===== */
.modal-footer { display: flex; align-items: center; gap: 10px; padding: 16px 24px; border-top: 1px solid var(--border); }
.upload-summary { flex: 1; font-size: 0.8rem; color: var(--text2); }
.btn-clear-queue { background: none; border: 1px solid var(--border); border-radius: 8px; color: var(--text2); font-size: 0.8rem; padding: 8px 14px; cursor: pointer; transition: background var(--transition), color var(--transition); font-family: inherit; }
.btn-clear-queue:hover { background: var(--surface2); color: var(--red); }
.btn-do-upload {
  display: flex; align-items: center; gap: 8px; padding: 10px 20px;
  background: linear-gradient(135deg, var(--purple), var(--blue));
  border: none; border-radius: 10px; color: #fff;
  font-size: 0.875rem; font-weight: 600; cursor: pointer;
  transition: opacity var(--transition); font-family: inherit;
}
.btn-do-upload svg { width: 15px; height: 15px; }
.btn-do-upload:hover:not(:disabled) { opacity: 0.85; }
.btn-do-upload:disabled { opacity: 0.4; cursor: not-allowed; }

/* ===== CARD DELETE BUTTON ===== */
.card-delete-btn {
  position: absolute; top: 8px; left: 8px;
  background: rgba(248,113,113,0.85); border: none; border-radius: 6px;
  color: #fff; padding: 4px 6px; cursor: pointer; display: none;
  transition: background var(--transition); z-index: 10;
}
.card-delete-btn svg { width: 12px; height: 12px; display: block; }
.gallery-card:hover .card-delete-btn { display: flex; }
.card-delete-btn:hover { background: var(--red); }

/* ===== CARD CAPTION BUTTON ===== */
.card-caption-btn {
  display: flex; align-items: center; gap: 6px;
  width: 100%; padding: 8px 12px;
  background: var(--surface2); border: 1px solid var(--border);
  border-top: 1px solid var(--border);
  border-radius: 0 0 var(--radius) var(--radius);
  color: var(--text3); font-size: 0.78rem; font-weight: 500;
  font-family: inherit; cursor: pointer;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
}
.card-caption-btn svg { width: 13px; height: 13px; flex-shrink: 0; }
.card-caption-btn:hover { background: rgba(56,189,248,0.1); color: var(--blue); border-color: rgba(56,189,248,0.3); }
.card-caption-btn.has-caption { color: var(--blue); border-color: rgba(56,189,248,0.25); background: rgba(56,189,248,0.06); }

/* ===== ACTIVE BAR CAPTION PREVIEW ===== */
.active-caption-preview {
  flex: 2; min-width: 0; display: flex; flex-direction: column; gap: 2px;
  border-left: 1px solid var(--border); padding-left: 16px;
}
.active-caption-label {
  font-size: 0.6rem; font-weight: 700; letter-spacing: 0.12em;
  color: var(--blue); text-transform: uppercase;
}
.active-caption-text {
  font-size: 0.82rem; color: var(--text3); font-style: italic;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.active-caption-text.has-text { color: var(--text); font-style: normal; font-weight: 500; }

/* ===== BUTTON EDIT CAPTION ===== */
.btn-edit-caption {
  display: flex; align-items: center; gap: 8px; padding: 10px 16px;
  background: rgba(56,189,248,0.12);
  border: 1px solid rgba(56,189,248,0.35); border-radius: 10px;
  color: var(--blue); font-size: 0.85rem; font-weight: 600;
  font-family: inherit; cursor: pointer; white-space: nowrap;
  transition: background var(--transition), transform var(--transition);
}
.btn-edit-caption svg { width: 15px; height: 15px; }
.btn-edit-caption:hover { background: rgba(56,189,248,0.22); transform: translateY(-1px); }

/* ===== BUTTON OPEN TEXTSHOW ===== */
.btn-open-textshow {
  display: flex; align-items: center; gap: 8px; padding: 10px 18px;
  background: linear-gradient(135deg, rgba(56,189,248,0.2), rgba(52,211,153,0.2));
  border: 1px solid rgba(56,189,248,0.4); border-radius: 10px;
  color: var(--blue); font-size: 0.875rem; font-weight: 600; cursor: pointer;
  font-family: inherit;
  transition: background var(--transition), transform var(--transition);
}
.btn-open-textshow svg { width: 16px; height: 16px; }
.btn-open-textshow:hover {
  background: linear-gradient(135deg, rgba(56,189,248,0.35), rgba(52,211,153,0.35));
  transform: translateY(-1px);
}

/* ===== CAPTION EDIT MODAL ===== */
.caption-modal { max-width: 520px; }
.caption-modal-body { padding: 20px 24px; display: flex; flex-direction: column; gap: 16px; }
.caption-modal-img-row {
  display: flex; align-items: center; gap: 12px;
  background: var(--surface2); border-radius: 10px; padding: 10px 14px;
  border: 1px solid var(--border);
}
.caption-modal-img-row img {
  width: 80px; height: 50px; object-fit: cover; border-radius: 6px;
  border: 1px solid var(--border); flex-shrink: 0;
}
.caption-modal-img-row span { font-size: 0.85rem; font-weight: 600; color: var(--text); }
.caption-modal-label {
  font-size: 0.82rem; color: var(--text2); line-height: 1.5;
}
.caption-modal-label strong { color: var(--blue); }
.caption-modal-textarea {
  width: 100%; padding: 14px 16px;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 12px; color: var(--text); font-size: 1rem; font-family: inherit;
  resize: vertical; outline: none; line-height: 1.6; min-height: 120px;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.caption-modal-textarea:focus {
  border-color: var(--blue); box-shadow: 0 0 0 3px rgba(56,189,248,0.15);
}
.caption-modal-textarea::placeholder { color: var(--text3); }
.caption-modal-hint {
  display: flex; align-items: center; gap: 6px;
  font-size: 0.75rem; color: var(--text3);
}
.caption-save-status { flex: 1; font-size: 0.8rem; font-weight: 600; }

