/* Global Design Tokens & Variables - Bright & Modern Premium Theme */
:root {
  --bg-main: #f8fafc;        /* Slate 50 - Very clean, soft blue-gray bg */
  --bg-sidebar: #ffffff;     /* Pure white sidebar */
  --bg-header: rgba(255, 255, 255, 0.75); /* Translucent white for glassmorphism */
  --bg-card: #ffffff;        /* Pure white cards */
  --bg-card-hover: #ffffff;
  --bg-modal: #ffffff;       /* Pure white modals */
  --bg-input: #f1f5f9;       /* Slate 100 - soft inputs */
  
  --border-color: rgba(0, 0, 0, 0.06);       /* Extremely soft light border */
  --border-color-hover: rgba(0, 0, 0, 0.12); /* Slightly darker border for hover states */
  --border-accent: rgba(99, 102, 241, 0.2);  /* Translucent Indigo border */
  
  --text-main: #0f172a;      /* Slate 900 - Dark charcoal text, highly readable */
  --text-muted: #64748b;     /* Slate 500 - Medium gray for descriptions and labels */
  --text-light: #475569;     /* Slate 600 - Secondary text */
  
  --accent-primary: #4f46e5;   /* Indigo 600 - Rich blue/violet accent */
  --accent-secondary: #0ea5e9; /* Sky 500 - Vibrant sky blue */
  --accent-success: #10b981;   /* Emerald 500 - Success green */
  --accent-danger: #f43f5e;    /* Rose 500 - Danger red */
  --accent-warning: #d97706;   /* Amber 600 - Warning orange/yellow */
  --accent-pink: #d946ef;      /* Fuchsia 500 */
  
  --gradient-accent: linear-gradient(135deg, #4f46e5 0%, #8b5cf6 50%, #0ea5e9 100%);
  --gradient-card: linear-gradient(135deg, rgba(99, 102, 241, 0.02) 0%, rgba(14, 165, 233, 0.02) 100%);
  --shadow-lg: 0 10px 30px -10px rgba(0, 0, 0, 0.04), 0 1px 3px rgba(0, 0, 0, 0.02);
  --shadow-glow: 0 0 25px rgba(99, 102, 241, 0.08);
  
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-heading: 'Outfit', sans-serif;
  --font-mono: 'D2Coding', 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
  
  --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-bounce: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  --transition-fast: all 0.15s ease;
  --backdrop-blur: blur(16px);
  
  --sidebar-width: 280px;
  --header-height: 80px;
  --drawer-width: 480px;
}

/* Base resets & layouts */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-font-smoothing: antialiased;
}

body {
  background-color: var(--bg-main);
  color: var(--text-main);
  font-family: var(--font-sans);
  height: 100vh;
  overflow: hidden;
}

/* Custom Scrollbar - Bright Theme */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.01);
}
::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.1);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.2);
}

.app-layout {
  display: flex;
  height: 100vh;
  width: 100vw;
  position: relative;
}

/* ==========================================================================
   Sidebar Styles - Clean & Elegant
   ========================================================================== */
.app-sidebar {
  width: var(--sidebar-width);
  background-color: var(--bg-sidebar);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  height: 100%;
  flex-shrink: 0;
  z-index: 10;
  box-shadow: 2px 0 10px rgba(0, 0, 0, 0.01);
}

.sidebar-header {
  padding: 24px;
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--border-color);
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-icon {
  width: 28px;
  height: 28px;
  color: var(--accent-primary);
  filter: drop-shadow(0 2px 8px rgba(79, 70, 229, 0.2));
}

.logo h1 {
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: var(--text-main);
}

.logo h1 span {
  background: var(--gradient-accent);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.sidebar-action {
  padding: 20px 24px 12px;
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 12px 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.nav-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.nav-section-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 1px;
  padding-left: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-section-title i {
  width: 14px;
  height: 14px;
}

.nav-menu {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-item {
  border-radius: 10px;
  overflow: hidden;
  transition: var(--transition-fast);
}

.nav-link {
  display: flex;
  align-items: center;
  padding: 10px 12px;
  color: var(--text-light);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  gap: 12px;
  transition: var(--transition-fast);
}

.nav-link i {
  width: 18px;
  height: 18px;
  color: var(--text-muted);
  transition: var(--transition-fast);
}

.nav-link:hover {
  background-color: rgba(79, 70, 229, 0.04);
  color: var(--accent-primary);
}

.nav-link:hover i {
  color: var(--accent-primary);
}

.nav-item.active {
  background-color: rgba(79, 70, 229, 0.08);
  border-left: 3px solid var(--accent-primary);
}

.nav-item.active .nav-link {
  color: var(--accent-primary);
  font-weight: 600;
  padding-left: 9px; /* Compensate for border */
}

.nav-item.active .nav-link i {
  color: var(--accent-primary);
}



.badge {
  background-color: rgba(0, 0, 0, 0.04);
  color: var(--text-light);
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 12px;
  margin-left: auto;
  font-family: var(--font-heading);
}

.nav-item.active .badge {
  background-color: var(--accent-primary);
  color: #ffffff;
}

.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 12px;
}

.tag-chip {
  font-size: 11px;
  font-weight: 500;
  background-color: rgba(0, 0, 0, 0.03);
  color: var(--text-light);
  padding: 4px 10px;
  border-radius: 8px;
  cursor: pointer;
  border: 1px solid var(--border-color);
  transition: var(--transition-fast);
  display: flex;
  align-items: center;
  gap: 4px;
}

.tag-chip:hover {
  background-color: rgba(79, 70, 229, 0.06);
  border-color: rgba(79, 70, 229, 0.2);
  color: var(--accent-primary);
}

.tag-chip.active {
  background: var(--gradient-accent);
  border-color: transparent;
  color: #ffffff;
  font-weight: 600;
}

.tag-count {
  font-size: 9px;
  opacity: 0.8;
}

.sidebar-footer {
  padding: 20px 24px;
  border-top: 1px solid var(--border-color);
  display: flex;
  gap: 8px;
  justify-content: space-between;
}

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  padding: 10px 16px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: var(--transition-smooth);
}

.btn-block {
  display: flex;
  width: 100%;
}

.btn-primary {
  background: var(--gradient-accent);
  color: #ffffff;
  border: none;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.15);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(79, 70, 229, 0.25), var(--shadow-glow);
}

.btn-secondary {
  background-color: #ffffff;
  border-color: rgba(0, 0, 0, 0.08);
  color: var(--text-main);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
}

.btn-secondary:hover {
  background-color: #f8fafc;
  border-color: rgba(0, 0, 0, 0.15);
}

.btn-ghost {
  background-color: transparent;
  border-color: transparent;
  color: var(--text-light);
}

.btn-ghost:hover {
  background-color: rgba(0, 0, 0, 0.03);
  color: var(--text-main);
}

.btn-ghost-danger {
  background-color: transparent;
  border-color: transparent;
  color: var(--text-muted);
}

.btn-ghost-danger:hover {
  background-color: rgba(244, 63, 94, 0.08);
  color: var(--accent-danger);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
  border-radius: 8px;
}

.btn-xs {
  padding: 4px 8px;
  font-size: 11px;
  border-radius: 6px;
}

.btn-icon {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-fast);
}

.btn-icon:hover {
  background-color: rgba(0, 0, 0, 0.04);
  color: var(--text-main);
}

/* ==========================================================================
   Main Content Area
   ========================================================================== */
.app-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  position: relative;
}

/* Header - Frosted Glass Effects */
.app-header {
  height: var(--header-height);
  padding: 0 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-color);
  background-color: var(--bg-header);
  backdrop-filter: var(--backdrop-blur);
  -webkit-backdrop-filter: var(--backdrop-blur);
  z-index: 5;
  flex-shrink: 0;
}

.header-search {
  flex: 1;
  max-width: 500px;
}

.search-box {
  position: relative;
  width: 100%;
}

.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--text-muted);
  pointer-events: none;
}

.search-box input {
  width: 100%;
  background-color: rgba(0, 0, 0, 0.03);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 12px 40px 12px 44px;
  color: var(--text-main);
  font-size: 14px;
  transition: var(--transition-smooth);
}

.search-box input:focus {
  background-color: #ffffff;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
  outline: none;
}

.search-clear-btn {
  position: absolute;
  right: 40px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 2px;
}

.search-clear-btn:hover {
  color: var(--text-main);
}

.search-shortcut {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  border: 1px solid rgba(0, 0, 0, 0.08);
  background-color: rgba(0, 0, 0, 0.01);
  padding: 2px 6px;
  border-radius: 4px;
  pointer-events: none;
  font-family: var(--font-heading);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* Filter indicator */
.filter-indicator {
  display: flex;
  align-items: center;
  background-color: rgba(79, 70, 229, 0.06);
  border: 1px solid rgba(79, 70, 229, 0.12);
  padding: 6px 12px;
  border-radius: 8px;
  gap: 8px;
  animation: fadeIn 0.2s ease-out;
}

.filter-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent-primary);
  text-transform: uppercase;
}

.filter-clear-btn {
  background: transparent;
  border: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  color: var(--text-main);
  font-size: 12px;
  font-weight: 600;
}

.filter-clear-btn i {
  width: 14px;
  height: 14px;
  color: var(--text-muted);
  transition: var(--transition-fast);
}

.filter-clear-btn:hover i {
  color: var(--accent-danger);
}

/* Sorting */
.sorting-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
  background-color: #ffffff;
  border: 1px solid var(--border-color);
  padding: 8px 12px;
  border-radius: 10px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.01);
}

.sort-icon {
  width: 16px;
  height: 16px;
  color: var(--text-muted);
}

.sort-select {
  background: transparent;
  border: none;
  color: var(--text-light);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  outline: none;
}

.sort-select option {
  background-color: var(--bg-modal);
  color: var(--text-main);
}

/* Content Area - Elegant Mesh/Radial Gradients for Bright Style */
.content-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 40px;
  background: radial-gradient(circle at 10% 20%, rgba(79, 70, 229, 0.02) 0%, transparent 40%),
              radial-gradient(circle at 90% 80%, rgba(14, 165, 233, 0.02) 0%, transparent 40%),
              var(--bg-main);
}

.prompt-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
  align-content: start;
}

/* Empty State */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  text-align: center;
}

.empty-icon {
  width: 64px;
  height: 64px;
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  color: var(--text-muted);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.02);
}

.empty-icon i {
  width: 32px;
  height: 32px;
}

.empty-state h2 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 8px;
}

.empty-state p {
  color: var(--text-muted);
  font-size: 14px;
  margin-bottom: 24px;
  max-width: 360px;
}

/* ==========================================================================
   Prompt Cards Styling (Elegant Shadows & Top Line Hover)
   ========================================================================== */
.prompt-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: var(--transition-bounce);
  box-shadow: 0 4px 20px -2px rgba(50, 50, 93, 0.03), 0 2px 8px -1px rgba(0, 0, 0, 0.01);
}

.prompt-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--gradient-accent);
  opacity: 0;
  transition: var(--transition-smooth);
}

.prompt-card:hover {
  background-color: var(--bg-card-hover);
  border-color: rgba(79, 70, 229, 0.12);
  transform: translateY(-4px);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.05), var(--shadow-glow);
}

.prompt-card:hover::before {
  opacity: 1;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.card-meta-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-category {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--accent-primary);
  letter-spacing: 0.5px;
}

.card-model-badge {
  font-size: 10px;
  font-weight: 600;
  color: var(--accent-secondary);
  background-color: rgba(14, 165, 233, 0.08);
  border: 1px solid rgba(14, 165, 233, 0.15);
  padding: 2px 6px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.card-model-badge i {
  width: 10px;
  height: 10px;
}



.card-title {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--text-main);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-top: 4px;
}

.card-body {
  flex: 1;
}

.card-prompt-preview {
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-light);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  background-color: #f8fafc;
  padding: 10px 12px;
  border-radius: 8px;
  border-left: 2px solid rgba(79, 70, 229, 0.15);
  font-family: var(--font-sans);
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
}

.card-tags {
  display: flex;
  gap: 6px;
  overflow: hidden;
  max-width: 70%;
}

.card-tag-badge {
  font-size: 10px;
  font-weight: 500;
  background-color: #f1f5f9;
  color: var(--text-muted);
  padding: 2px 6px;
  border-radius: 4px;
  white-space: nowrap;
}

.card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-stats {
  font-size: 11px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
}

.card-stats i {
  width: 12px;
  height: 12px;
}

.card-copy-btn {
  background: rgba(79, 70, 229, 0.08);
  color: var(--accent-primary);
  border: 1px solid rgba(79, 70, 229, 0.12);
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition-fast);
}

.card-copy-btn:hover {
  background: var(--gradient-accent);
  border-color: transparent;
  color: #ffffff;
  transform: scale(1.05);
}

.card-copy-btn i {
  width: 14px;
  height: 14px;
}

/* ==========================================================================
   Details Drawer (Right side slide-in panel) - Sleek Light Theme
   ========================================================================== */
.drawer-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(15, 23, 42, 0.2);
  backdrop-filter: blur(4px);
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: var(--transition-smooth);
}

.drawer-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

.detail-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: 100%;
  max-width: var(--drawer-width);
  height: 100%;
  background-color: #ffffff;
  border-left: 1px solid var(--border-color);
  box-shadow: -10px 0 40px rgba(0, 0, 0, 0.03);
  z-index: 101;
  transform: translateX(100%);
  transition: var(--transition-bounce);
  display: flex;
  flex-direction: column;
}

.detail-drawer.active {
  transform: translateX(0);
}

.drawer-header {
  padding: 24px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.drawer-category {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--accent-secondary);
  letter-spacing: 0.5px;
  background-color: rgba(14, 165, 233, 0.08);
  padding: 4px 10px;
  border-radius: 6px;
}

.drawer-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 32px 24px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.drawer-title {
  font-family: var(--font-heading);
  font-size: 22px;
  font-weight: 700;
  line-height: 1.3;
}

.drawer-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.drawer-tag {
  font-size: 11px;
  font-weight: 500;
  background-color: #f1f5f9;
  color: var(--text-light);
  padding: 3px 8px;
  border-radius: 6px;
}

.detail-model-badge {
  font-size: 13px;
  font-weight: 600;
  color: var(--accent-primary);
  background-color: rgba(79, 70, 229, 0.08);
  border: 1px solid rgba(79, 70, 229, 0.15);
  padding: 6px 12px;
  border-radius: 8px;
  width: max-content;
  display: flex;
  align-items: center;
  gap: 6px;
}

.detail-model-badge i {
  width: 14px;
  height: 14px;
}

.drawer-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.section-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
}

.flex-between {
  justify-content: space-between;
  width: 100%;
}

.badge-accent {
  background-color: rgba(79, 70, 229, 0.08);
  color: var(--accent-primary);
  border: 1px solid rgba(79, 70, 229, 0.15);
  font-family: var(--font-sans);
}

.drawer-desc {
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-light);
}

/* Dynamic Variable Fields styling - Layered white fields on gray container */
.variables-form {
  background-color: #f8fafc;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.var-input-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.var-input-group label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-light);
}

.var-input-group input {
  background-color: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 8px 12px;
  color: var(--text-main);
  font-size: 13px;
  transition: var(--transition-fast);
}

.var-input-group input:focus {
  border-color: var(--accent-secondary);
  outline: none;
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.1);
}

/* Tabbed Preview */
.tab-header {
  display: flex;
  border-bottom: 1px solid var(--border-color);
  gap: 16px;
}

.tab-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  padding: 8px 4px;
  cursor: pointer;
  position: relative;
  transition: var(--transition-fast);
}

.tab-btn::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 2px;
  background-color: var(--accent-primary);
  opacity: 0;
  transition: var(--transition-fast);
}

.tab-btn.active {
  color: var(--text-main);
}

.tab-btn.active::after {
  opacity: 1;
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* Code Container for displaying prompt texts in Light Theme */
.code-container {
  position: relative;
  background-color: #f8fafc;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  overflow: hidden;
}

.code-block {
  padding: 16px;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.6;
  color: #1e293b; /* Dark slate code text */
  white-space: pre-wrap;
  word-break: break-all;
  max-height: 250px;
  overflow-y: auto;
}

.copy-overlay-btn {
  position: absolute;
  bottom: 12px;
  right: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

/* output green-theme containers */
.output-container {
  background-color: #f0fdf4;
  border-color: rgba(16, 185, 129, 0.25);
}

.output-block {
  color: #065f46; /* High-contrast dark green code text */
  max-height: 200px;
}

.drawer-meta {
  border-top: 1px solid var(--border-color);
  padding-top: 16px;
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-muted);
}

.drawer-meta div {
  display: flex;
  align-items: center;
  gap: 6px;
}

.drawer-meta i {
  width: 14px;
  height: 14px;
}

/* ==========================================================================
   Modals (Frosted Glass Modal Overlay)
   ========================================================================== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(15, 23, 42, 0.3);
  backdrop-filter: blur(8px);
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: var(--transition-smooth);
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-container {
  background-color: var(--bg-modal);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 20px;
  width: 100%;
  max-width: 640px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.08);
  transform: translateY(20px);
  transition: var(--transition-bounce);
  display: flex;
  flex-direction: column;
  max-height: 90vh;
  overflow: hidden;
}

.modal-overlay.active .modal-container {
  transform: translateY(0);
}

.modal-header {
  padding: 24px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h2 {
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 700;
}

.modal-form {
  padding: 24px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-group label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-light);
}

.form-group label span.required {
  color: var(--accent-danger);
}

.form-group label span.muted {
  font-size: 11px;
  font-weight: 400;
  color: var(--text-muted);
}

.form-group input[type="text"],
.form-group select,
.form-group textarea {
  background-color: #f8fafc;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 10px 14px;
  color: var(--text-main);
  font-size: 14px;
  transition: var(--transition-smooth);
}

.form-group input[type="text"]:focus,
.form-group select:focus,
.form-group textarea:focus {
  background-color: #ffffff;
  border-color: var(--accent-primary);
  outline: none;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.10);
}

.form-row {
  display: flex;
  gap: 16px;
}

.flex-1 {
  flex: 1;
}

.select-new-combo {
  display: flex;
  gap: 8px;
}

.select-new-combo select {
  flex: 1;
}

.select-new-combo input {
  flex: 1;
}

.hidden {
  display: none !important;
}

.textarea-wrapper {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group textarea {
  line-height: 1.6;
  resize: vertical;
}

.textarea-hint {
  font-size: 11px;
  color: var(--text-muted);
}

.textarea-hint code {
  font-family: var(--font-mono);
  background-color: rgba(0, 0, 0, 0.03);
  padding: 2px 4px;
  border-radius: 4px;
  color: var(--accent-primary);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 10px;
  border-top: 1px solid var(--border-color);
  padding-top: 20px;
}

/* ==========================================================================
   Toast Notifications
   ========================================================================== */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 1000;
}

.toast {
  background-color: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-left: 4px solid var(--accent-primary);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
  border-radius: 8px;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-main);
  font-size: 13px;
  font-weight: 500;
  min-width: 280px;
  transform: translateX(120%);
  animation: slideIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.toast.toast-success {
  border-left-color: var(--accent-success);
}

.toast.toast-error {
  border-left-color: var(--accent-danger);
}

.toast.toast-warning {
  border-left-color: var(--accent-warning);
}

.toast.toast-info {
  border-left-color: var(--accent-secondary);
}

.toast i {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.toast.toast-success i { color: var(--accent-success); }
.toast.toast-error i { color: var(--accent-danger); }
.toast.toast-warning i { color: var(--accent-warning); }
.toast.toast-info i { color: var(--accent-secondary); }

/* Keyframes */
@keyframes slideIn {
  to {
    transform: translateX(0);
  }
}

@keyframes fadeOut {
  to {
    opacity: 0;
    transform: translateY(10px);
  }
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-5px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Responsive adjustments */
@media (max-width: 900px) {
  .app-sidebar {
    position: fixed;
    left: -100%;
    transition: var(--transition-smooth);
    box-shadow: 10px 0 30px rgba(0, 0, 0, 0.05);
  }
  .app-sidebar.active {
    left: 0;
  }
  .app-header {
    padding: 0 20px;
  }
  .content-scroll {
    padding: 20px;
  }
}

@media (max-width: 600px) {
  .form-row {
    flex-direction: column;
  }
  .detail-drawer {
    max-width: 100%;
  }
}

/* ==========================================================================
   Image Upload & Lightbox Styles
   ========================================================================== */
.image-upload-zone {
  border: 2px dashed rgba(0, 0, 0, 0.1);
  border-radius: 12px;
  padding: 20px;
  background-color: rgba(0, 0, 0, 0.005);
  cursor: pointer;
  position: relative;
  min-height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-smooth);
}

.image-upload-zone:hover {
  border-color: var(--accent-secondary);
  background-color: rgba(14, 165, 233, 0.02);
}

.image-upload-zone.dragover {
  border-color: var(--accent-primary);
  background-color: rgba(79, 70, 229, 0.03);
}

.upload-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
}

.upload-icon {
  width: 32px;
  height: 32px;
  color: var(--text-muted);
  transition: var(--transition-smooth);
}

.image-upload-zone:hover .upload-icon {
  color: var(--accent-secondary);
  transform: translateY(-2px);
}

.upload-text {
  font-size: 12px;
  color: var(--text-muted);
  max-width: 280px;
  line-height: 1.5;
}

.image-preview-container {
  position: relative;
  width: 100%;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border-color-hover);
  display: flex;
  justify-content: center;
  align-items: center;
  background: rgba(0, 0, 0, 0.02);
  padding: 8px;
}

#modal-image-preview {
  max-width: 100%;
  max-height: 180px;
  object-fit: contain;
  border-radius: 6px;
}

.btn-remove-image {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background-color: rgba(244, 63, 94, 0.9);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition-bounce);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.btn-remove-image:hover {
  transform: scale(1.1);
  background-color: var(--accent-danger);
}

.btn-remove-image i {
  width: 14px;
  height: 14px;
}

/* Detail Drawer Image styles */
.detail-image-container {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border-color);
  cursor: zoom-in;
  max-height: 260px;
  background-color: #f8fafc;
  display: flex;
  justify-content: center;
  align-items: center;
}

#detail-output-image {
  width: 100%;
  height: auto;
  max-height: 260px;
  object-fit: cover;
  transition: var(--transition-smooth);
}

.detail-image-container:hover #detail-output-image {
  filter: brightness(0.95) scale(1.02);
}

.image-overlay-info {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 10px;
  text-align: center;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.6));
  font-size: 11px;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  opacity: 0;
  transform: translateY(5px);
  transition: var(--transition-smooth);
  pointer-events: none;
}

.detail-image-container:hover .image-overlay-info {
  opacity: 1;
  transform: translateY(0);
}

.image-overlay-info i {
  width: 14px;
  height: 14px;
  color: var(--accent-secondary);
}

/* Lightbox overlay modal - Remains dark for high contrast image focus */
.lightbox-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: var(--transition-smooth);
}

.lightbox-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.lightbox-content {
  max-width: 90%;
  max-height: 85vh;
  display: flex;
  justify-content: center;
  align-items: center;
  transform: scale(0.95);
  transition: var(--transition-bounce);
}

.lightbox-overlay.active .lightbox-content {
  transform: scale(1);
}

#lightbox-image {
  max-width: 100%;
  max-height: 85vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3), 0 0 1px rgba(255, 255, 255, 0.1);
}

.lightbox-close {
  position: absolute;
  top: 24px;
  right: 24px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.1);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-fast);
  z-index: 1001;
}

.lightbox-close:hover {
  background-color: rgba(255, 255, 255, 0.2);
  transform: rotate(90deg);
}

.lightbox-close i {
  width: 20px;
  height: 20px;
}

/* ==========================================================================
   Admin Mode & Email Auth Styles
   ========================================================================== */
.admin-status-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 8px 12px;
  margin-bottom: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
}

.status-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--text-muted);
  transition: var(--transition-smooth);
}

.admin-status-bar.admin-active .status-dot {
  background-color: var(--accent-success);
  box-shadow: 0 0 8px var(--accent-success);
}

.status-text {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  transition: var(--transition-smooth);
}

.admin-status-bar.admin-active .status-text {
  color: var(--accent-success);
}

.btn-admin-action {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
  border-radius: 8px;
  transition: var(--transition-fast);
}

.btn-admin-action:hover {
  background-color: rgba(0, 0, 0, 0.04);
  color: var(--text-main);
}

.admin-status-bar.admin-active .btn-admin-action {
  color: var(--accent-success);
}

.admin-status-bar.admin-active .btn-admin-action:hover {
  background-color: rgba(16, 185, 129, 0.08);
}

.btn-admin-action i {
  width: 16px;
  height: 16px;
}

/* Modal Small sizing */
.modal-container.modal-sm {
  max-width: 420px;
}

.modal-desc {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
}

/* Code Input Wrapper & Timer */
.code-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.code-input-wrapper input {
  width: 100%;
}

.timer-badge {
  position: absolute;
  right: 14px;
  font-size: 12px;
  font-weight: 700;
  color: var(--accent-danger);
  background-color: rgba(244, 63, 94, 0.08);
  padding: 4px 8px;
  border-radius: 6px;
  pointer-events: none;
}

/* Mock Email Notification Box */
.mock-notification {
  background-color: #f0fdfa;
  border: 1px solid rgba(13, 148, 136, 0.2);
  border-radius: 12px;
  padding: 14px;
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  animation: fadeIn 0.3s ease-out;
}

.mock-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 700;
  color: #0f766e;
}

.mock-title i {
  width: 14px;
  height: 14px;
}

.mock-body {
  font-size: 12px;
  color: #115e59;
  line-height: 1.5;
}

.mock-code {
  font-weight: 800;
  color: var(--accent-primary);
  background-color: rgba(79, 70, 229, 0.08);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 13px;
}

/* Control overlays or disable indicators on cards when non-admin */
.admin-only-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 700;
  color: var(--accent-primary);
  background-color: rgba(79, 70, 229, 0.08);
  padding: 2px 6px;
  border-radius: 6px;
}

/* Warehouse Card Thumbnail Hover effect */
.card-thumbnail-container:hover img {
  transform: scale(1.04);
  filter: brightness(0.9);
}

.card-thumbnail-container:hover .image-overlay-info {
  opacity: 1;
  transform: translateY(0);
}

/* Warehouse Card Copy Button Hover Effect */
.btn-copy-wh-prompt:hover {
  background-color: rgba(79, 70, 229, 0.15) !important;
  color: var(--accent-primary) !important;
}

/* Favorites Share Card Custom Styling - Compact & Clean */
.fav-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 14px 18px;
  display: flex;
  flex-direction: column;
  height: 125px; /* Fixed height for uniform layouts */
  justify-content: space-between; /* Anchor footer to bottom */
  cursor: pointer;
  position: relative;
  overflow: hidden; /* Prevent top line overflowing border radius */
  transition: var(--transition-smooth);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.01);
}

.fav-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--gradient-accent);
  opacity: 0;
  transition: var(--transition-smooth);
}

.fav-card:hover {
  background-color: var(--bg-card-hover);
  border-color: rgba(79, 70, 229, 0.12);
  transform: translateY(-4px);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.05), var(--shadow-glow);
}

.fav-card:hover::before {
  opacity: 1;
}

/* Pagination Styling */
.pagination-container {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  margin-top: 32px;
  margin-bottom: 16px;
}

.pagination-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background-color: var(--bg-card);
  color: var(--text-main);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.pagination-btn:hover:not(:disabled) {
  border-color: var(--accent-primary);
  color: var(--accent-primary);
  background-color: rgba(79, 70, 229, 0.04);
}

.pagination-btn.active {
  background-color: var(--accent-primary);
  border-color: var(--accent-primary);
  color: #ffffff;
  font-weight: 600;
}

.pagination-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.pagination-arrow {
  padding: 0 10px;
  width: auto;
  min-width: 36px;
  gap: 4px;
}

/* Warehouse Compact View Optimization */
#warehouse-main-view, #video-warehouse-main-view, #lm-warehouse-main-view {
  margin-top: 0;
}

#warehouse-grid, #video-warehouse-grid, #lm-warehouse-grid {
  gap: 20px !important;
}

#warehouse-grid .prompt-card, 
#video-warehouse-grid .prompt-card, 
#lm-warehouse-grid .prompt-card {
  padding: 0 !important;
  gap: 0 !important;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
}

#warehouse-grid .prompt-card .card-body, 
#video-warehouse-grid .prompt-card .card-body, 
#lm-warehouse-grid .prompt-card .card-body {
  padding: 16px 18px !important;
  gap: 10px !important;
}

#warehouse-grid .prompt-card .card-thumbnail-container, 
#video-warehouse-grid .prompt-card .card-thumbnail-container, 
#lm-warehouse-grid .prompt-card .card-thumbnail-container {
  height: 130px !important;
}

#warehouse-grid .prompt-card .card-title, 
#video-warehouse-grid .prompt-card .card-title, 
#lm-warehouse-grid .prompt-card .card-title {
  font-size: 14px !important;
  margin-top: 0 !important;
  margin-bottom: 2px !important;
}

#warehouse-grid .prompt-card .card-prompt-section, 
#video-warehouse-grid .prompt-card .card-prompt-section, 
#lm-warehouse-grid .prompt-card .card-prompt-section {
  margin-top: 4px !important;
  padding: 8px 12px !important;
  gap: 6px !important;
}

#warehouse-grid .prompt-card .card-prompt-section pre, 
#video-warehouse-grid .prompt-card .card-prompt-section pre, 
#lm-warehouse-grid .prompt-card .card-prompt-section pre {
  max-height: 60px !important;
  font-size: 11px !important;
  line-height: 1.4 !important;
}

#warehouse-grid .prompt-card .card-footer, 
#video-warehouse-grid .prompt-card .card-footer, 
#lm-warehouse-grid .prompt-card .card-footer {
  padding: 10px 18px !important;
}

/* AI Model Brand-Specific Color Badges */
.card-model-badge.model-gpt {
  color: #10a37f !important;
  background-color: rgba(16, 163, 127, 0.08) !important;
  border-color: rgba(16, 163, 127, 0.2) !important;
}
.detail-model-badge.model-gpt {
  color: #10a37f !important;
  background-color: rgba(16, 163, 127, 0.08) !important;
  border-color: rgba(16, 163, 127, 0.2) !important;
}

.card-model-badge.model-gemini {
  color: #6366f1 !important;
  background-color: rgba(99, 102, 241, 0.08) !important;
  border-color: rgba(99, 102, 241, 0.2) !important;
}
.detail-model-badge.model-gemini {
  color: #6366f1 !important;
  background-color: rgba(99, 102, 241, 0.08) !important;
  border-color: rgba(99, 102, 241, 0.2) !important;
}

.card-model-badge.model-claude {
  color: #d25f38 !important;
  background-color: rgba(215, 118, 85, 0.08) !important;
  border-color: rgba(215, 118, 85, 0.2) !important;
}
.detail-model-badge.model-claude {
  color: #d25f38 !important;
  background-color: rgba(215, 118, 85, 0.08) !important;
  border-color: rgba(215, 118, 85, 0.2) !important;
}
