/* ==========================================================================
   Design Token / Variables (Harmonious Dark Theme Palette)
   ========================================================================== */
:root {
  --bg-dark: #09090e;
  --bg-sidebar: rgba(13, 13, 23, 0.7);
  --bg-card: rgba(22, 22, 38, 0.6);
  --bg-card-hover: rgba(28, 28, 48, 0.7);
  --border-light: rgba(255, 255, 255, 0.08);
  --border-focus: rgba(147, 51, 234, 0.5); /* Purple glow */

  --text-main: #f3f4f6;
  --text-muted: #9ca3af;
  --text-dark: #6b7280;

  --color-primary: #9333ea; /* Purple */
  --color-primary-light: #a855f7;
  --color-primary-glow: rgba(147, 51, 234, 0.35);

  --color-success: #10b981; /* Emerald Green */
  --color-success-glow: rgba(16, 185, 129, 0.3);
  
  --color-info: #3b82f6; /* Blue */
  --color-info-glow: rgba(59, 130, 246, 0.3);

  --color-warning: #f59e0b; /* Amber */
  
  --color-error: #ef4444; /* Red */
  --color-error-glow: rgba(239, 68, 68, 0.3);

  --gradient-rainbow: linear-gradient(135deg, #a855f7 0%, #3b82f6 50%, #10b981 100%);
  --gradient-purple: linear-gradient(135deg, #a855f7 0%, #7c3aed 100%);
  --gradient-blue: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
  --gradient-green: linear-gradient(135deg, #10b981 0%, #047857 100%);
  --gradient-red: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%);
  --gradient-glass: linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.01) 100%);

  --font-family-body: 'Inter', sans-serif;
  --font-family-title: 'Outfit', sans-serif;
  
  --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-glow: 0 0 20px rgba(147, 51, 234, 0.15);
  
  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==========================================================================
   Base Elements & Reset
   ========================================================================== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-family-body);
  background-color: var(--bg-dark);
  color: var(--text-main);
  overflow-x: hidden;
  min-height: 100vh;
  position: relative;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--color-primary-light);
  text-decoration: none;
  transition: var(--transition-fast);
}
a:hover {
  color: #fff;
  text-shadow: 0 0 8px var(--color-primary-glow);
}

/* ==========================================================================
   Background Orbs (Animations & Blurs)
   ========================================================================== */
.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  z-index: 0;
  pointer-events: none;
  opacity: 0.45;
  animation: float 20s infinite alternate;
}

.orb-1 {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, var(--color-primary) 0%, rgba(147, 51, 234, 0) 70%);
  top: -100px;
  right: -50px;
  animation-duration: 25s;
}

.orb-2 {
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, var(--color-info) 0%, rgba(59, 130, 246, 0) 70%);
  bottom: 50px;
  left: -100px;
  animation-duration: 18s;
  animation-delay: 2s;
}

.orb-3 {
  width: 350px;
  height: 350px;
  background: radial-gradient(circle, var(--color-success) 0%, rgba(16, 185, 129, 0) 70%);
  top: 40%;
  right: 25%;
  animation-duration: 22s;
  animation-delay: 4s;
}

@keyframes float {
  0% {
    transform: translate(0, 0) scale(1);
  }
  100% {
    transform: translate(40px, 30px) scale(1.1);
  }
}

/* ==========================================================================
   Main Grid Layout
   ========================================================================== */
.app-container {
  display: grid;
  grid-template-columns: 280px 1fr;
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

/* Sidebar navigation */
.sidebar {
  background-color: var(--bg-sidebar);
  border-right: 1px solid var(--border-light);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  padding: 30px 24px;
  display: flex;
  flex-direction: column;
  height: 100vh;
  position: sticky;
  top: 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 40px;
}

.logo-icon {
  width: 42px;
  height: 42px;
  background: var(--gradient-rainbow);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.25rem;
  box-shadow: 0 4px 15px rgba(147, 51, 234, 0.3);
  animation: pulse-glow 3s infinite alternate;
}

@keyframes pulse-glow {
  0% {
    box-shadow: 0 4px 15px rgba(147, 51, 234, 0.3);
  }
  100% {
    box-shadow: 0 4px 25px rgba(59, 130, 246, 0.5);
  }
}

.brand-name {
  font-family: var(--font-family-title);
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.ai-badge {
  background: var(--gradient-purple);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 6px;
  vertical-align: middle;
  margin-left: 2px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: 0 2px 8px var(--color-primary-glow);
}

.nav-menu {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  border-radius: 12px;
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.95rem;
  transition: var(--transition-normal);
  border: 1px solid transparent;
}

.nav-item i {
  font-size: 1.1rem;
  width: 20px;
  text-align: center;
}

.nav-item:hover {
  color: var(--text-main);
  background-color: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.04);
  transform: translateX(3px);
}

.nav-item.active {
  color: #fff;
  background: rgba(147, 51, 234, 0.15);
  border-color: rgba(147, 51, 234, 0.25);
  box-shadow: inset 0 0 12px rgba(147, 51, 234, 0.1);
  font-weight: 600;
}

.nav-item.active i {
  color: var(--color-primary-light);
  text-shadow: 0 0 10px var(--color-primary-glow);
}

.sidebar-footer {
  margin-top: auto;
  border-top: 1px solid var(--border-light);
  padding-top: 20px;
}

.status-indicator {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background-color: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-light);
  border-radius: 10px;
  font-size: 0.8rem;
  font-weight: 500;
}

.indicator-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  position: relative;
}

.indicator-dot.dot-active {
  background-color: var(--color-success);
  box-shadow: 0 0 8px var(--color-success);
  animation: blink 2s infinite;
}

.indicator-dot.dot-inactive {
  background-color: var(--color-warning);
  box-shadow: 0 0 8px var(--color-warning);
}

@keyframes blink {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

/* Main Content Area */
.main-content {
  padding: 40px;
  max-height: 100vh;
  overflow-y: auto;
}

.top-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 35px;
}

.top-header h1 {
  font-family: var(--font-family-title);
  font-size: 2.2rem;
  font-weight: 700;
  letter-spacing: -0.5px;
}

/* ==========================================================================
   Content Sections (Single Page App Behavior)
   ========================================================================== */
.content-section {
  display: none;
  animation: fadeIn 0.4s ease-out forwards;
}

.content-section.active {
  display: block;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ==========================================================================
   Reusable UI Cards (Glassmorphism)
   ========================================================================== */
.content-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 18px;
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  transition: border-color var(--transition-normal), box-shadow var(--transition-normal);
  overflow: hidden;
  height: 100%;
}

.content-card:hover {
  border-color: rgba(255, 255, 255, 0.12);
}

.card-header {
  padding: 24px 28px 16px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.card-header h2 {
  font-family: var(--font-family-title);
  font-size: 1.25rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
}

.card-header h2 i {
  color: var(--color-primary-light);
}

.card-body {
  padding: 28px;
}

.view-all-link {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--color-primary-light);
}

/* ==========================================================================
   Buttons & Form Controls
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-family-body);
  font-weight: 600;
  font-size: 0.9rem;
  padding: 12px 24px;
  border-radius: 10px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: var(--transition-normal);
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background: var(--gradient-purple);
  color: #fff;
  box-shadow: 0 4px 15px var(--color-primary-glow);
}
.btn-primary:hover {
  background: var(--gradient-purple);
  opacity: 0.95;
  box-shadow: 0 4px 20px rgba(147, 51, 234, 0.5);
  transform: translateY(-1px);
}

.btn-success {
  background: var(--gradient-green);
  color: #fff;
  box-shadow: 0 4px 15px var(--color-success-glow);
}
.btn-success:hover {
  opacity: 0.95;
  box-shadow: 0 4px 20px rgba(16, 185, 129, 0.4);
  transform: translateY(-1px);
}

.btn-secondary {
  background-color: rgba(255, 255, 255, 0.05);
  border-color: var(--border-light);
  color: var(--text-main);
}
.btn-secondary:hover {
  background-color: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.15);
}

.btn-forge {
  background: transparent;
  border: 1.5px solid #FF6B00;
  color: #FF6B00;
}
.btn-forge:hover {
  background: #FF6B00;
  color: #fff;
  box-shadow: 0 4px 15px rgba(255, 107, 0, 0.4);
  transform: translateY(-1px);
}

.btn-danger {
  background-color: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: var(--color-error);
}
.btn-danger:hover {
  background-color: var(--color-error);
  color: #fff;
  box-shadow: 0 4px 15px var(--color-error-glow);
}

.btn-sm {
  padding: 8px 16px;
  font-size: 0.8rem;
  border-radius: 8px;
}

.btn-block {
  display: flex;
  width: 100%;
}

/* Inputs & Form layout */
.form-group {
  margin-bottom: 20px;
}

.form-row {
  display: flex;
  gap: 16px;
}

.col-6 {
  flex: 1;
}

label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

input[type="text"],
input[type="password"],
input[type="datetime-local"],
select,
textarea {
  width: 100%;
  background-color: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border-light);
  border-radius: 10px;
  padding: 12px 16px;
  color: #fff;
  font-family: var(--font-family-body);
  font-size: 0.95rem;
  transition: var(--transition-normal);
  outline: none;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--border-focus);
  background-color: rgba(0, 0, 0, 0.4);
  box-shadow: 0 0 12px rgba(147, 51, 234, 0.2);
}

textarea {
  resize: vertical;
}

.form-help {
  display: block;
  font-size: 0.75rem;
  color: var(--text-dark);
  margin-top: 6px;
  line-height: 1.4;
}

.password-input-wrapper {
  position: relative;
  display: flex;
}

.password-input-wrapper input {
  padding-right: 48px;
}

.btn-toggle-password {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-dark);
  cursor: pointer;
  padding: 4px;
  font-size: 1rem;
  transition: var(--transition-fast);
}

.btn-toggle-password:hover {
  color: var(--text-main);
}

/* ==========================================================================
   Dashboard Metrics
   ========================================================================== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.stats-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 18px;
  padding: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  backdrop-filter: blur(16px);
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-normal), border-color var(--transition-normal);
}

.stats-card:hover {
  transform: translateY(-3px);
  border-color: rgba(255, 255, 255, 0.15);
}

.stats-info {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.stats-label {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
}

.stats-value {
  font-family: var(--font-family-title);
  font-size: 2.2rem;
  font-weight: 700;
}

.stats-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  background-color: rgba(255, 255, 255, 0.03);
}

/* Glowing Border Effect for stats cards */
.card-glow-purple:hover {
  box-shadow: 0 10px 25px rgba(147, 51, 234, 0.12), 0 0 1px var(--color-primary);
}
.card-glow-purple .stats-icon {
  background-color: rgba(147, 51, 234, 0.1);
  color: var(--color-primary-light);
}

.card-glow-blue:hover {
  box-shadow: 0 10px 25px rgba(59, 130, 246, 0.12), 0 0 1px var(--color-info);
}
.card-glow-blue .stats-icon {
  background-color: rgba(59, 130, 246, 0.1);
  color: var(--color-info);
}

.card-glow-green:hover {
  box-shadow: 0 10px 25px rgba(16, 185, 129, 0.12), 0 0 1px var(--color-success);
}
.card-glow-green .stats-icon {
  background-color: rgba(16, 185, 129, 0.1);
  color: var(--color-success);
}

.card-glow-red:hover {
  box-shadow: 0 10px 25px rgba(239, 68, 68, 0.12), 0 0 1px var(--color-error);
}
.card-glow-red .stats-icon {
  background-color: rgba(239, 68, 68, 0.1);
  color: var(--color-error);
}

/* Dashboard Columns */
.dashboard-columns {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 30px;
}

.dashboard-column-left,
.dashboard-column-right {
  display: flex;
  flex-direction: column;
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px 20px;
  color: var(--text-dark);
}

.empty-state i {
  font-size: 3rem;
  margin-bottom: 16px;
  opacity: 0.5;
}

.empty-state p {
  font-size: 0.95rem;
  font-weight: 500;
  max-width: 250px;
  line-height: 1.4;
}

/* ==========================================================================
   Create Post & Generator View
   ========================================================================== */
.create-layout {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 35px;
}

.collapsible-api-keys {
  margin-top: 15px;
  padding-top: 15px;
  border-top: 1px dashed var(--border-light);
}

/* Preview Card Area */
.preview-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}

/* Mock Instagram Post Card */
.instagram-card-wrapper {
  perspective: 1000px;
  width: 100%;
  max-width: 360px;
}

.instagram-card {
  background-color: #000;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  overflow: hidden;
  width: 100%;
  box-shadow: var(--shadow-lg);
  font-size: 0.85rem;
  color: #fff;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.ig-card-header {
  display: flex;
  align-items: center;
  padding: 12px;
  gap: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.ig-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--gradient-rainbow);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

.ig-username {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.ig-username strong {
  font-weight: 600;
  color: #fff;
}

.ig-username span {
  font-size: 0.7rem;
  color: #a8a8a8;
}

.ig-more {
  color: #a8a8a8;
  cursor: pointer;
}

.ig-card-image {
  position: relative;
  width: 100%;
  padding-top: 100%; /* 1:1 Aspect Ratio Square */
  background-color: #121212;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.ig-image-placeholder {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #555;
  text-align: center;
  padding: 20px;
}

.ig-image-placeholder i {
  font-size: 2.5rem;
  margin-bottom: 10px;
}

.ig-card-image img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.image-overlay-spinner {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 15px;
  z-index: 2;
  backdrop-filter: blur(4px);
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  border-top-color: var(--color-primary-light);
  animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.image-overlay-spinner p {
  font-size: 0.8rem;
  font-weight: 500;
  color: #e5e7eb;
}

.ig-card-actions {
  display: flex;
  justify-content: space-between;
  padding: 12px 14px 8px;
  font-size: 1.3rem;
}

.ig-actions-left {
  display: flex;
  gap: 16px;
}

.ig-card-actions i {
  cursor: pointer;
  transition: transform 0.1s;
}

.ig-card-actions i:hover {
  transform: scale(1.1);
}

.ig-card-likes {
  padding: 0 14px;
  font-weight: 600;
  margin-bottom: 6px;
}

.ig-card-caption {
  padding: 0 14px 14px;
  line-height: 1.4;
  word-wrap: break-word;
  white-space: pre-wrap;
}

.ig-card-caption strong {
  margin-right: 6px;
}

.ig-card-caption span {
  color: #f5f5f5;
}

/* Caption Editor & Configurations below preview */
.caption-editor-group {
  width: 100%;
}

.schedule-config-panel {
  width: 100%;
  border-top: 1px dashed var(--border-light);
  padding-top: 20px;
}

.schedule-config-panel h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 15px;
}

.post-now-toggle {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

/* Custom Switch Toggle */
.switch {
  position: relative;
  display: inline-block;
  width: 46px;
  height: 24px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--border-light);
  transition: .3s;
}

.slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .3s;
}

input:checked + .slider {
  background-color: var(--color-primary);
  border-color: var(--color-primary-light);
}

input:focus + .slider {
  box-shadow: 0 0 1px var(--color-primary);
}

input:checked + .slider:before {
  transform: translateX(22px);
}

.slider.round {
  border-radius: 34px;
}

.slider.round:before {
  border-radius: 50%;
}

.toggle-label {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-main);
}

/* ==========================================================================
   Post Queue Section & Grids
   ========================================================================== */
.queue-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}

.post-queue-card {
  background-color: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border-light);
  border-radius: 14px;
  overflow: hidden;
  transition: transform var(--transition-normal), border-color var(--transition-normal);
  display: flex;
  flex-direction: column;
}

.post-queue-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.12);
}

.queue-card-image {
  position: relative;
  width: 100%;
  padding-top: 75%; /* 4:3 Aspect Ratio */
  background-color: #121212;
}

.queue-card-image img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.queue-status-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: var(--shadow-sm);
}

.badge-pending {
  background-color: rgba(59, 130, 246, 0.2);
  border: 1px solid rgba(59, 130, 246, 0.5);
  color: #60a5fa;
}

.badge-failed {
  background-color: rgba(239, 68, 68, 0.2);
  border: 1px solid rgba(239, 68, 68, 0.5);
  color: #f87171;
}

.badge-published {
  background-color: rgba(16, 185, 129, 0.2);
  border: 1px solid rgba(16, 185, 129, 0.5);
  color: #34d399;
}

.queue-card-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
}

.queue-card-time {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-primary-light);
  display: flex;
  align-items: center;
  gap: 6px;
}

.queue-card-prompt {
  font-size: 0.85rem;
  line-height: 1.4;
  color: var(--text-main);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  height: 2.8em; /* fixed height for 2 lines */
}

.queue-card-caption {
  font-size: 0.8rem;
  color: var(--text-muted);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  height: 4.2em; /* fixed height for 3 lines */
  line-height: 1.4;
}

.queue-card-footer {
  border-top: 1px solid var(--border-light);
  padding: 12px 16px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* ==========================================================================
   Dashboard Columns Custom Elements
   ========================================================================== */
.next-scheduled-post-card {
  display: flex;
  gap: 20px;
  background-color: rgba(0, 0, 0, 0.15);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: 16px;
}

.next-post-thumb {
  width: 100px;
  height: 100px;
  border-radius: 8px;
  overflow: hidden;
  flex-shrink: 0;
}

.next-post-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.next-post-details {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.next-post-time {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--color-primary-light);
  display: flex;
  align-items: center;
  gap: 6px;
}

.next-post-prompt {
  font-weight: 600;
  font-size: 0.95rem;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 320px;
}

.next-post-caption {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.recent-feed-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-light);
}

.recent-feed-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.recent-feed-thumb {
  width: 50px;
  height: 50px;
  border-radius: 8px;
  overflow: hidden;
  flex-shrink: 0;
}

.recent-feed-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.recent-feed-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-width: 0; /* allows text truncation */
}

.recent-feed-time {
  font-size: 0.7rem;
  color: var(--text-dark);
}

.recent-feed-caption {
  font-size: 0.8rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.recent-feed-action {
  flex-shrink: 0;
}

.btn-icon-only {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-light);
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition-fast);
}

.btn-icon-only:hover {
  background-color: var(--color-primary);
  border-color: var(--color-primary-light);
  color: #fff;
}

.error-tag {
  color: var(--color-error);
  font-size: 0.75rem;
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ==========================================================================
   Settings Page Styles
   ========================================================================== */
.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 30px;
  margin-bottom: 30px;
}

.mode-selection-box {
  background-color: rgba(147, 51, 234, 0.04);
  border: 1px solid rgba(147, 51, 234, 0.15);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 20px;
}

.checkbox-container {
  display: flex;
  align-items: center;
  position: relative;
  padding-left: 30px;
  margin-bottom: 8px;
  cursor: pointer;
  font-size: 0.95rem;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  text-transform: none;
}

.checkbox-container input {
  position: absolute;
  opacity: 0;
  cursor: pointer;
  height: 0;
  width: 0;
}

.checkmark {
  position: absolute;
  top: 50%;
  left: 0;
  transform: translateY(-50%);
  height: 18px;
  width: 18px;
  background-color: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-light);
  border-radius: 4px;
  transition: var(--transition-fast);
}

.checkbox-container:hover input ~ .checkmark {
  background-color: rgba(255, 255, 255, 0.1);
}

.checkbox-container input:checked ~ .checkmark {
  background-color: var(--color-primary);
  border-color: var(--color-primary-light);
}

.checkmark:after {
  content: "";
  position: absolute;
  display: none;
}

.checkbox-container input:checked ~ .checkmark:after {
  display: block;
}

.checkbox-container .checkmark:after {
  left: 6px;
  top: 2px;
  width: 4px;
  height: 8px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.mode-highlight {
  color: var(--color-primary-light);
}

.mode-description {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.4;
  margin-left: 30px;
}

.instruction-card-full {
  grid-column: 1 / -1;
}

.instructions-steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 24px;
}

.step-item {
  display: flex;
  gap: 16px;
}

.step-num {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(147, 51, 234, 0.1);
  border: 1px solid rgba(147, 51, 234, 0.3);
  color: var(--color-primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.95rem;
  flex-shrink: 0;
}

.step-detail h3 {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: #fff;
}

.step-detail p {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ==========================================================================
   Toast Notification Banner System
   ========================================================================== */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 9999;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  min-width: 300px;
  max-width: 400px;
  padding: 16px 20px;
  border-radius: 12px;
  background-color: #161626;
  border-left: 4px solid var(--color-primary);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
  color: #fff;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  animation: slideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards, fadeOut 0.3s 4.7s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  backdrop-filter: blur(12px);
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes fadeOut {
  to {
    transform: translateY(10px);
    opacity: 0;
  }
}

.toast i {
  font-size: 1.15rem;
  margin-top: 1px;
}

.toast-content {
  flex: 1;
}

.toast-title {
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 3px;
}

.toast-message {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.3;
}

.toast-success {
  border-left-color: var(--color-success);
}
.toast-success i {
  color: var(--color-success);
}

.toast-error {
  border-left-color: var(--color-error);
}
.toast-error i {
  color: var(--color-error);
}

.toast-info {
  border-left-color: var(--color-info);
}
.toast-info i {
  color: var(--color-info);
}

/* ==========================================================================
   Responsive Adaptation
   ========================================================================== */
@media (max-width: 1024px) {
  .app-container {
    grid-template-columns: 80px 1fr;
  }
  
  .sidebar {
    padding: 30px 12px;
  }
  
  .brand-name,
  .nav-item span,
  .status-indicator span:last-child {
    display: none;
  }
  
  .brand {
    justify-content: center;
    margin-bottom: 30px;
  }
  
  .nav-item {
    justify-content: center;
    padding: 14px;
  }
  
  .status-indicator {
    justify-content: center;
    padding: 10px;
  }
  
  .create-layout {
    grid-template-columns: 1fr;
  }
  
  .dashboard-columns {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .app-container {
    grid-template-columns: 1fr;
  }
  
  .sidebar {
    display: none; /* simple fallback: hides sidebar on tiny mobile */
  }
  
  .main-content {
    padding: 20px;
  }
}
