/* Core layout and design tokens */
:root {
  --bg: #f0f2f5;
  --surface: #ffffff;
  --surface-alt: rgba(255, 255, 255, 0.92);
  --border: rgba(0, 0, 0, 0.08);
  --text-primary: #0f0f0f;
  --text-secondary: #65676b;
  --accent: #5c6bc0;
  --accent-2: #7c3aed;
  --accent-soft: rgba(92, 107, 192, 0.10);
  --success: #16a34a;
  --warning: #d97706;
  --danger: #dc2626;
  --shadow-soft: 0 1px 4px rgba(0, 0, 0, 0.10), 0 2px 12px rgba(0, 0, 0, 0.06);
  --shadow-card: 0 0 0 1px rgba(0,0,0,0.06), 0 2px 8px rgba(0,0,0,0.06);
  --shadow-ring: 0 0 0 1px rgba(92, 107, 192, 0.10);
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --transition: 160ms ease;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}

body.dark-theme {
  --bg: #18191a;
  --surface: #242526;
  --surface-alt: rgba(42, 43, 46, 0.95);
  --border: rgba(255, 255, 255, 0.10);
  --text-primary: #e4e6eb;
  --text-secondary: #b0b3b8;
  --accent-soft: rgba(92, 107, 192, 0.18);
  --shadow-soft: 0 1px 4px rgba(0, 0, 0, 0.4), 0 2px 12px rgba(0, 0, 0, 0.3);
  --shadow-card: 0 0 0 1px rgba(255,255,255,0.06), 0 2px 8px rgba(0,0,0,0.3);
  color-scheme: dark;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  margin: 0;
  padding: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text-primary);
  min-height: 100%;
  overflow-x: hidden;
  width: 100%;
  max-width: 100vw;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  display: flex;
  flex-direction: column;
  position: relative;
  overflow-x: hidden;
}

.app {
  min-height: 100vh;
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
  background: var(--bg);
  display: flex;
  flex-direction: column;
}

/* Top navigation */
.topbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  background: linear-gradient(135deg, rgba(92, 107, 192, 0.96) 0%, rgba(124, 58, 237, 0.92) 100%);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  box-shadow: 0 1px 0 rgba(0,0,0,0.12), 0 2px 12px rgba(92,107,192,0.2);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: 0.02em;
}

.brand-logo {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: linear-gradient(145deg, #ffffff, rgba(255, 255, 255, 0.7));
  color: var(--accent);
  font-size: 1.4rem;
  font-weight: 700;
  box-shadow: inset 0 3px 8px rgba(255, 255, 255, 0.2);
}

.search {
  flex: 1;
  max-width: 420px;
  margin: 0 4vw;
  position: relative;
}

.search input {
  width: 100%;
  padding: 12px 18px 12px 46px;
  border-radius: 24px;
  border: none;
  font-size: 0.95rem;
  background: rgba(255, 255, 255, 0.18);
  color: inherit;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.28);
  transition: box-shadow var(--transition), background var(--transition);
}

.search input::placeholder {
  color: rgba(255, 255, 255, 0.78);
}

.search input:focus {
  outline: none;
  background: rgba(255, 255, 255, 0.24);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.4);
}

.search-icon {
  position: absolute;
  top: 50%;
  left: 16px;
  transform: translateY(-50%);
  opacity: 0.78;
}

.search-results {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: var(--surface);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  max-height: 400px;
  overflow-y: auto;
  z-index: 100;
}

.search-results[hidden] {
  display: none;
}

.search-results-list {
  padding: 8px 0;
}

.search-result-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  cursor: pointer;
  transition: background 150ms ease;
  text-decoration: none;
  color: inherit;
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
}

.search-result-item:hover {
  background: var(--accent-soft);
}

.search-result-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, #4c6ef5, #748ffc);
  color: white;
  display: grid;
  place-items: center;
  font-weight: 600;
  font-size: 0.9rem;
  flex-shrink: 0;
}

.search-result-avatar.company {
  background: linear-gradient(135deg, #f43f5e, #ec4899);
}

.search-result-avatar.customer {
  background: linear-gradient(135deg, #20c997, #5eead4);
}

.search-result-info {
  flex: 1;
  min-width: 0;
}

.search-result-name {
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-result-subtitle {
  font-size: 0.85rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-result-type {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  padding: 4px 8px;
  border-radius: 4px;
  background: var(--accent-soft);
  color: var(--accent);
  flex-shrink: 0;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* User Menu Dropdown */
.user-menu-wrapper {
  position: relative;
}

.user-menu-button {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.2);
  color: inherit;
  border: none;
  cursor: pointer;
  transition: background var(--transition);
  font-size: 0.9rem;
  font-weight: 500;
}

.user-menu-button:hover {
  background: rgba(255, 255, 255, 0.3);
}

.user-name {
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.menu-toggle {
  font-size: 0.8rem;
  opacity: 0.8;
  transition: transform var(--transition);
}

.user-menu-button[aria-expanded="true"] .menu-toggle {
  transform: rotate(180deg);
}

.user-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 200px;
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
  border: 1px solid var(--border);
  z-index: 1100;
  overflow: hidden;
  animation: dropdown-appear 0.15s ease-out;
}

@keyframes dropdown-appear {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  color: var(--text-primary);
  text-decoration: none;
  transition: background var(--transition);
  font-weight: 500;
}

.dropdown-item:hover {
  background: var(--accent-soft);
  color: var(--accent);
}

.dropdown-item--danger:hover {
  background: rgba(244, 63, 94, 0.1);
  color: #dc2626;
}

.dropdown-icon {
  font-size: 1.1rem;
  width: 20px;
  text-align: center;
}

.dropdown-divider {
  height: 1px;
  background: var(--border);
  margin: 4px 0;
}

.icon-button {
  width: 40px;
  height: 40px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.2);
  color: inherit;
  display: grid;
  place-items: center;
  font-size: 1.1rem;
  border: none;
  cursor: pointer;
  transition: transform var(--transition), background var(--transition), box-shadow var(--transition);
  position: relative;
}

.icon-button:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.3);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.28);
}

.icon-button[aria-label]:hover::after {
  content: attr(aria-label);
  position: absolute;
  bottom: -32px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(15, 23, 42, 0.9);
  color: #ffffff;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
  pointer-events: none;
  z-index: 10;
  letter-spacing: 0.03em;
}

.user-pill {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 18px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.2);
}

.avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, #4c6ef5, #21d4fd);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-weight: 600;
  font-size: 0.95rem;
  flex-shrink: 0;
  overflow: hidden;
  position: relative;
}

.avatar-logo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  border-radius: 50%;
  display: block;
}

.avatar--small {
  width: 32px;
  height: 32px;
  font-size: 0.8rem;
}

.avatar--large {
  width: 56px;
  height: 56px;
  font-size: 1.1rem;
}

/* App layout */
.layout {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr) 320px;
  gap: 28px;
  padding: 28px 3.5vw 60px;
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
}

.layout main {
  display: grid;
  gap: 24px;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  border: 1px solid var(--border);
  padding: 16px;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
}

.section-title {
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: 14px;
}

.menu a {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  color: inherit;
  text-decoration: none;
  font-weight: 600;
  transition: background var(--transition), transform var(--transition);
}

.menu a span {
  font-size: 1rem;
}

.menu a:hover {
  background: var(--accent-soft);
  transform: translateX(4px);
}

.menu a.active {
  color: var(--accent);
  background: rgba(76, 110, 245, 0.18);
}

.shortcuts {
  display: grid;
  gap: 10px;
}

.shortcut {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: var(--radius-md);
  background: linear-gradient(120deg, rgba(76, 110, 245, 0.15), rgba(76, 110, 245, 0.02));
  border: 1px solid rgba(76, 110, 245, 0.12);
  font-weight: 600;
}

/* Stories */

.story-rail {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 14px;
  margin-bottom: 24px;
}

.stories {
  display: flex;
  gap: 16px;
  padding: 6px 4px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}

.stories::-webkit-scrollbar {
  height: 6px;
}

.stories::-webkit-scrollbar-thumb {
  background: rgba(76, 110, 245, 0.35);
  border-radius: 999px;
}

.story-card {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  min-height: 220px;
  min-width: 160px;
  background-size: cover;
  background-position: center;
  color: #ffffff;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 16px;
  box-shadow: var(--shadow-soft);
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition);
  scroll-snap-align: start;
}

.story-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(200deg, rgba(0, 0, 0, 0) 25%, rgba(0, 0, 0, 0.55) 100%);
}

.story-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 22px 45px rgba(15, 23, 42, 0.18);
}

.story-card > * {
  position: relative;
  z-index: 1;
}

.story-card__logo-container {
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 2;
}

.story-card__logo {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.3));
  border: 2px solid rgba(255, 255, 255, 0.2);
}

.story-card--add {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: visible;
}

.story-card--add:hover {
  transform: translateY(-6px);
  box-shadow: 0 24px 50px rgba(15, 23, 42, 0.15);
}

.story-card__add-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  z-index: 1;
}

.story-card__add-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  color: #ffffff;
  border: 2px solid rgba(255, 255, 255, 0.3);
  transition: all var(--transition);
}

.story-card--add:hover .story-card__add-icon {
  background: rgba(255, 255, 255, 0.3);
  border-color: rgba(255, 255, 255, 0.5);
  transform: scale(1.1);
}

.story-card__add-text {
  font-size: 0.9rem;
  font-weight: 600;
  color: #ffffff;
  text-align: center;
}

.story-card__logo-img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  object-position: center;
}

.story-card__logo-text {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  font-weight: bold;
  color: white;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 50%;
}

.story-card__name {
  font-weight: 600;
  font-size: 0.9rem;
  margin-top: auto;
  color: white;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
  padding: 8px 12px 12px 12px;
  word-break: break-word;
}

.story-card--login {
  background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: visible;
  border: 2px dashed #cbd5e1;
}

.story-card--login:hover {
  transform: translateY(-6px);
  box-shadow: 0 24px 50px rgba(15, 23, 42, 0.15);
  border-color: #667eea;
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
}

.story-card__login-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  z-index: 1;
}

.story-card__login-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(102, 126, 234, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  color: #667eea;
  border: 2px solid rgba(102, 126, 234, 0.2);
  transition: all var(--transition);
}

.story-card--login:hover .story-card__login-icon {
  background: rgba(102, 126, 234, 0.2);
  border-color: rgba(102, 126, 234, 0.4);
  transform: scale(1.1);
}

.story-card__login-text {
  font-size: 0.85rem;
  font-weight: 600;
  color: #475569;
  text-align: center;
  max-width: 120px;
  line-height: 1.3;
}

.story-user {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.88rem;
  font-weight: 600;
}

.story-action {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
}

.story-action .icon-button {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.25);
}

.story-card--seen {
  opacity: 0.78;
  filter: saturate(0.7);
}

.story-seen {
  position: absolute;
  bottom: 16px;
  left: 16px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.55);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 600;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity var(--transition), transform var(--transition);
  pointer-events: none;
}

.story-card--seen .story-seen {
  opacity: 1;
  transform: translateY(0);
}

.story-viewer {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 40px 16px;
  background: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(18px);
  z-index: 120;
}

.story-viewer[hidden] {
  display: none;
}

.story-viewer__backdrop {
  position: absolute;
  inset: 0;
}

.story-viewer__card {
  position: relative;
  width: min(420px, 100%);
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: 0 32px 50px rgba(15, 23, 42, 0.22);
  display: grid;
  gap: 18px;
  padding: 24px;
  z-index: 1;
}

.story-viewer__header {
  display: none;
  align-items: center;
  justify-content: space-between;
}

.story-viewer__close {
  background: rgba(76, 110, 245, 0.12);
  color: var(--text-primary);
}

.story-viewer__close:hover {
  background: rgba(76, 110, 245, 0.24);
}

.story-viewer__progress {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
  gap: 6px;
}

.story-progress__bar {
  height: 4px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.4);
  transition: background var(--transition);
}

.story-progress__bar--active {
  background: var(--accent);
}

.story-viewer__content {
  display: grid;
}

.story-viewer__slide {
  position: relative;
  border-radius: var(--radius-md);
  min-height: 340px;
  display: grid;
  align-items: end;
  overflow: hidden;
  color: #ffffff;
}

.story-viewer__slide::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(200deg, rgba(0, 0, 0, 0) 25%, rgba(0, 0, 0, 0.58) 100%);
}

.story-viewer__slide-inner {
  position: relative;
  z-index: 1;
  padding: 28px;
  display: grid;
  gap: 14px;
}

.story-viewer__slide-inner h2 {
  margin: 0;
  font-size: 1.6rem;
}

.story-viewer__slide-inner p {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.6;
}

.story-viewer__company-bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  background: rgba(0, 0, 0, 0.3);
  padding: 12px 20px;
  z-index: 2;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

.story-viewer__logo {
  height: 40px;
  max-width: 120px;
  object-fit: contain;
  object-position: left center;
}

.story-viewer__company-name {
  font-size: 0.75rem;
  font-weight: 600;
  color: #000000;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: -1px -1px 0 #fff, 1px -1px 0 #fff, -1px 1px 0 #fff, 1px 1px 0 #fff, 0 0 3px #fff, 0 0 5px #fff;
}

.story-viewer__text {
  margin: 0;
  font-size: 0.85rem;
  line-height: 1.4;
  word-break: break-word;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
}

.story-viewer__actions {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.story-viewer__actions button {
  flex: 1;
}

.story-viewer__label {
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 600;
  opacity: 0.82;
}

body.modal-open {
  overflow: hidden;
}

.story-nav {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: none;
  display: grid;
  place-items: center;
  background: rgba(76, 110, 245, 0.15);
  color: var(--accent);
  font-size: 1.6rem;
  cursor: pointer;
  transition: background var(--transition), transform var(--transition);
}

.story-nav:hover {
  background: rgba(76, 110, 245, 0.28);
  transform: translateY(-2px);
}

.story-nav:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

/* Composer */
.composer.card {
  padding: 18px 20px 16px;
}

.composer-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}

.composer textarea {
  width: 100%;
  min-height: 90px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  padding: 14px 16px;
  resize: vertical;
  font-size: 0.98rem;
  background: var(--surface-alt);
  color: inherit;
  transition: border var(--transition), box-shadow var(--transition);
}

.composer textarea:focus {
  outline: none;
  border: 1px solid rgba(76, 110, 245, 0.4);
  box-shadow: 0 0 0 3px rgba(76, 110, 245, 0.18);
}

.composer-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 14px;
}

.icon-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.pill-button {
  padding: 10px 20px;
  border-radius: 999px;
  border: none;
  background: var(--accent);
  color: #ffffff;
  font-weight: 600;
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition);
}

.pill-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 15px 22px rgba(76, 110, 245, 0.28);
}

.pill-button--ghost {
  background: transparent;
  color: var(--accent);
  box-shadow: inset 0 0 0 1px rgba(76, 110, 245, 0.28);
}

.pill-button--ghost:hover {
  background: rgba(76, 110, 245, 0.12);
}

/* Feed */
.feed-list {
  display: grid;
  gap: 22px;
}

.feed-card {
  padding: 22px;
  display: grid;
  gap: 16px;
  animation: feedSlideIn 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.feed-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.12);
}

.feed-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  animation: fadeInLeft 0.5s ease 0.1s both;
}

.feed-card > p {
  animation: fadeInUp 0.5s ease 0.15s both;
}

.feed-card-tools {
  display: flex;
  align-items: center;
  gap: 10px;
  animation: fadeInRight 0.5s ease 0.1s both;
}

.feed-card-tools .icon-button:nth-child(1) { animation-delay: 0.2s; }
.feed-card-tools .icon-button:nth-child(2) { animation-delay: 0.25s; }
.feed-card-tools .icon-button:nth-child(3) { animation-delay: 0.3s; }
.feed-card-tools .icon-button:nth-child(4) { animation-delay: 0.35s; }
.feed-card-tools .icon-button:nth-child(5) { animation-delay: 0.4s; }
.feed-card-tools .icon-button:nth-child(6) { animation-delay: 0.45s; }

.feed-card-tools .icon-button {
  animation: fadeInRight 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.feed-meta {
  display: flex;
  align-items: center;
  gap: 12px;
}

.feed-meta div {
  display: grid;
  gap: 2px;
}

.feed-meta span {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.feed-meta__title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.whatsapp-icon {
  color: #1a8917;
  font-size: 1rem;
}

.icon-button--whatsapp,
a.icon-button--whatsapp {
  color: #1a8917;
  background: rgba(26, 137, 23, 0.12);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.icon-button--whatsapp:hover,
a.icon-button--whatsapp:hover {
  background: rgba(26, 137, 23, 0.24);
}

a.icon-button--store,
.icon-button--store {
  color: #4c6ef5;
  background: rgba(76, 110, 245, 0.12);
  text-decoration: none;
}

.icon-button--store:hover {
  background: rgba(76, 110, 245, 0.24);
}

.icon-button--product,
a.icon-button--product {
  color: #a78bfa;
  background: rgba(167, 139, 250, 0.12);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.icon-button--product:hover,
a.icon-button--product:hover {
  background: rgba(167, 139, 250, 0.24);
}

.icon-button--design,
a.icon-button--design {
  color: #f43f5e;
  background: rgba(244, 63, 94, 0.12);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.icon-button--design:hover,
a.icon-button--design:hover {
  background: rgba(244, 63, 94, 0.24);
}

a.icon-button--school,
.icon-button--school {
  color: #2196f3;
  background: rgba(33, 150, 243, 0.12);
  text-decoration: none;
}

.icon-button--school:hover {
  background: rgba(33, 150, 243, 0.24);
}

.icon-button--tip {
  color: #f59f00;
  background: rgba(245, 159, 0, 0.12);
}

.icon-button--tip:hover {
  background: rgba(245, 159, 0, 0.24);
}

.post-media {
  border-radius: var(--radius-md);
  overflow: hidden;
  width: 100%;
  max-width: 100%;
  display: block;
  position: relative;
  background: #1a1a2e;
  animation: scaleIn 0.4s ease 0.1s both;
}

.post-media img {
  width: 100%;
  max-width: 100%;
  height: auto;
  max-height: 520px;
  object-fit: cover;
  display: block;
  border-radius: 0;
}

.post-media video {
  width: 100%;
  max-width: 100%;
  height: auto;
  max-height: 480px;
  display: block;
  background: #000;
}

.post-media figcaption {
  width: 100%;
  padding: 10px 14px;
  background: rgba(0, 0, 0, 0.6);
  color: #ffffff;
  font-size: 0.82rem;
  letter-spacing: 0.02em;
}

.feed-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  animation: fadeInUp 0.6s ease 0.3s both;
}

.feed-actions button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-weight: 600;
  cursor: pointer;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  transition: background var(--transition), color var(--transition), transform 0.2s ease;
}

.feed-actions button:hover {
  background: var(--accent-soft);
  color: var(--accent);
  transform: scale(1.05);
}

.feed-card--ad {
  gap: 18px;
  background: linear-gradient(135deg, rgba(76, 110, 245, 0.08), rgba(32, 201, 151, 0.08));
}

.feed-card--ad .feed-card-header span {
  color: var(--text-secondary);
}

.feed-card--ad .avatar {
  background: linear-gradient(135deg, rgba(76, 110, 245, 0.65), rgba(33, 212, 253, 0.65));
}

.feed-ad-body {
  display: grid;
  gap: 10px;
}

.feed-ad-body h3 {
  margin: 0;
  font-size: 1.2rem;
}

.feed-ad-body p {
  margin: 0;
  color: var(--text-secondary);
  line-height: 1.6;
}

.feed-ad-list {
  margin: 0;
  padding-left: 18px;
  color: var(--text-secondary);
  display: grid;
  gap: 6px;
}

.feed-ad-actions {
  display: flex;
  justify-content: flex-start;
}

/* Right rail */
.trending-list {
  display: grid;
  gap: 12px;
}

.trending-product {
  display: grid;
  gap: 8px;
  padding: 10px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface-alt);
  transition: all var(--transition);
}

.trending-product:hover {
  background: var(--surface);
  border-color: var(--accent);
  box-shadow: 0 4px 12px rgba(76, 110, 245, 0.1);
}

.trending-product-image {
  width: 100%;
  height: 140px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  background: var(--border);
}

.trending-product-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.trending-product-info strong {
  font-size: 0.9rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.trending-product-price {
  font-size: 0.85rem;
  color: var(--accent);
  font-weight: 600;
}

.trending-item {
  display: grid;
  gap: 6px;
}

.trending-item span {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.contact-list {
  display: grid;
  gap: 12px;
}

.contact-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 6px rgba(32, 201, 151, 0.15);
}

/* Floating action buttons */
.floating-bar {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) scale(1);
  display: flex;
  gap: 14px;
  z-index: 60;
  padding: 14px 20px;
  background: linear-gradient(135deg, rgba(76, 110, 245, 0.95), rgba(33, 212, 253, 0.95));
  border-radius: 56px;
  box-shadow: 0 20px 45px rgba(76, 110, 245, 0.35);
  backdrop-filter: blur(12px);
  opacity: 1;
  transition: all 300ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

.floating-bar.scrolled {
  gap: 8px;
  padding: 10px 14px;
  border-radius: 40px;
  opacity: 0.75;
  transform: translateX(-50%) scale(0.6);
  transition: all 200ms cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.fab--horizontal {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, #ffffff, #f0f7ff);
  color: #4c6ef5;
  font-size: 1.2rem;
  display: grid;
  place-items: center;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
  cursor: pointer;
  transition: transform 200ms cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 200ms ease, filter 200ms ease;
  padding: 0;
}

.fab--horizontal i {
  font-size: 1.4rem;
}

.fab--horizontal:hover {
  transform: translateY(-2px) scale(1.08);
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.15);
}

.fab--center {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, #4c6ef5, #1f4cff);
  color: #ffffff;
  font-size: 1.4rem;
  display: grid;
  place-items: center;
  box-shadow: 0 12px 28px rgba(76, 110, 245, 0.3);
  cursor: pointer;
  transition: transform 200ms cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 200ms ease, filter 200ms ease;
  padding: 0;
}

.fab--center i {
  font-size: 1.8rem;
}

.fab--center:hover {
  transform: translateY(-4px) scale(1.12);
  box-shadow: 0 16px 36px rgba(76, 110, 245, 0.4);
}

.floating-bar.scrolled .fab--center {
  width: 44px;
  height: 44px;
  font-size: 1rem;
}

.floating-bar.scrolled .fab--center:hover {
  filter: brightness(1.2);
  transform: translateY(-2px) scale(1.15);
}

.floating-bar.scrolled .fab--horizontal:hover {
  filter: brightness(1.15);
  transform: translateY(-1px) scale(1.12);
}

/* Modal */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal[hidden] {
  display: none !important;
}

.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: fadeIn 200ms ease-out;
  z-index: 0;
}

.modal__card {
  position: relative;
  z-index: 1;
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: 0 40px 80px rgba(15, 23, 42, 0.2);
  max-width: 900px;
  width: 100%;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  animation: slideUp 300ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

.modal__header h2 {
  margin: 0;
  font-size: 1.5rem;
  color: var(--text-primary);
}

.image-modal-stats-header {
  display: flex;
  gap: 16px;
  margin-left: auto;
  margin-right: 16px;
}

.image-modal-stats-header .stat-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.image-modal-stats-header .stat-icon {
  font-size: 1rem;
}

.image-modal-stats-header .stat-value {
  font-weight: 600;
  color: var(--text-primary);
}

.modal__close {
  font-size: 1.8rem;
  color: var(--text-secondary);
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 6px 12px;
  transition: color var(--transition);
}

.modal__close:hover {
  color: var(--text-primary);
}

.modal__content {
  flex: 1;
  overflow-y: auto;
  padding: 28px;
}

.businesses-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}

.business-listing {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-alt);
  transition: all var(--transition);
}

.business-listing:hover {
  border-color: var(--accent);
  background: rgba(76, 110, 245, 0.06);
  box-shadow: 0 12px 24px rgba(76, 110, 245, 0.1);
  transform: translateY(-2px);
}

.business-header {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.business-logo {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, #4c6ef5, #21d4fd);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.business-meta {
  display: grid;
  gap: 4px;
}

.business-meta h3 {
  margin: 0;
  font-size: 1.15rem;
  color: var(--text-primary);
  font-weight: 600;
}

.business-meta .business-type {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.business-info {
  display: grid;
  gap: 10px;
}

.info-row {
  display: flex;
  gap: 10px;
  font-size: 0.95rem;
}

.info-row .label {
  color: var(--text-secondary);
  font-weight: 500;
  min-width: 100px;
}

.info-row .value {
  color: var(--text-primary);
  font-weight: 500;
}

.business-services {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.service-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 20px;
  background: rgba(76, 110, 245, 0.12);
  color: #4c6ef5;
  font-size: 0.85rem;
  font-weight: 500;
}

.service-badge i {
  font-size: 0.95rem;
}

.business-action {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 16px;
  border: none;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, #1a8917, #20c997);
  color: #ffffff;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  width: 100%;
}

.business-action:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(26, 137, 23, 0.3);
}

.business-action i {
  font-size: 1.1rem;
}

.business-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

.business-card {
  display: grid;
  gap: 14px;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-alt);
  transition: all var(--transition);
}

.business-card:hover {
  border-color: var(--accent);
  background: rgba(76, 110, 245, 0.06);
  box-shadow: 0 12px 24px rgba(76, 110, 245, 0.1);
  transform: translateY(-2px);
}

.business-card__icon {
  font-size: 2.2rem;
  text-align: center;
}

.business-card h3 {
  margin: 0;
  font-size: 1.1rem;
  color: var(--text-primary);
}

.business-card p {
  margin: 0;
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.business-card .pill-button {
  justify-self: start;
  margin-top: 8px;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

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

/* Utility */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(76, 110, 245, 0.12);
  color: var(--accent);
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.metric-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.9rem;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.metric-row:last-child {
  border-bottom: none;
}

.metric-row strong {
  color: var(--text-primary);
}

.ad-card {
  display: grid;
  gap: 12px;
  text-align: left;
  background: linear-gradient(135deg, rgba(76, 110, 245, 0.12), rgba(33, 212, 253, 0.12));
}

.ad-card h3 {
  margin: 0;
  font-size: 1.1rem;
}

.ad-card p {
  margin: 0;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* Empty state fallback */
.empty {
  border-radius: var(--radius-lg);
  background: repeating-linear-gradient(120deg, rgba(76, 110, 245, 0.1), rgba(76, 110, 245, 0.1) 16px, rgba(76, 110, 245, 0.04) 16px, rgba(76, 110, 245, 0.04) 32px);
  padding: 28px;
  text-align: center;
  color: var(--text-secondary);
}

/* Responsiveness */
@media (max-width: 1280px) {
  .layout {
    grid-template-columns: 240px minmax(0, 1fr) 280px;
  }
}

@media (max-width: 1080px) {
  .layout {
    grid-template-columns: minmax(0, 1fr) 320px;
  }

  .sidebar-left {
    display: none;
  }
}

@media (max-width: 920px) {
  .layout {
    grid-template-columns: minmax(0, 1fr);
    padding: 22px 22px 80px;
  }

  .sidebar-right {
    display: none;
  }

  .topbar {
    padding: 12px 5vw;
  }

  .search {
    max-width: none;
    margin: 0 20px;
  }

  .floating-actions {
    bottom: 20px;
    right: 20px;
  }
}

@media (max-width: 640px) {
  html, body {
    overflow-x: hidden;
    width: 100%;
    max-width: 100vw;
  }

  .app {
    overflow-x: hidden;
    width: 100%;
    max-width: 100vw;
  }

  .search {
    display: none;
  }

  .topbar {
    justify-content: space-between;
    padding: 10px 16px;
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
  }

  .brand {
    font-size: 0.9rem;
    gap: 8px;
  }

  .brand-logo {
    width: 36px;
    height: 36px;
    font-size: 1.2rem;
  }

  .brand-text {
    display: none;
  }

  .nav-actions {
    gap: 8px;
  }

  .user-menu-button {
    padding: 6px 10px;
    font-size: 0.8rem;
  }

  .user-name {
    max-width: 80px;
  }

  .user-dropdown-menu {
    min-width: 180px;
    right: -10px;
  }

  .dropdown-item {
    padding: 10px 14px;
    font-size: 0.9rem;
  }

  .icon-button {
    width: 36px;
    height: 36px;
    font-size: 1rem;
  }

  .user-pill {
    padding: 4px;
  }

  .avatar--small {
    width: 32px;
    height: 32px;
    font-size: 0.7rem;
  }

  .layout {
    grid-template-columns: 1fr;
    gap: 16px;
    padding: 16px 12px 100px;
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
  }

  .layout main {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
  }

  .sidebar {
    display: none;
  }

  .sidebar-right {
    display: none;
  }

  .story-rail {
    margin: 0 -12px;
    padding: 0 12px;
    overflow-x: auto;
  }

  .stories {
    gap: 10px;
    padding: 0;
  }

  .story-card {
    min-width: 90px;
    max-width: 90px;
    height: 120px;
    padding: 8px;
  }

  .story-card__logo {
    width: 48px;
    height: 48px;
    font-size: 1rem;
  }

  .story-user {
    font-size: 0.75rem;
  }

  .story-nav {
    display: none;
  }

  .composer.card {
    padding: 14px;
  }

  .composer textarea {
    font-size: 14px;
    min-height: 80px;
  }

  .composer-footer {
    gap: 8px;
  }

  .icon-group {
    gap: 6px;
  }

  .pill-button {
    padding: 8px 14px;
    font-size: 13px;
  }

  .feed-card {
    padding: 14px;
    border-radius: 12px;
  }

  .feed-card-header {
    margin-bottom: 10px;
  }

  .avatar {
    width: 44px;
    height: 44px;
    font-size: 0.85rem;
  }

  .feed-meta {
    gap: 4px;
  }

  .feed-meta div {
    font-size: 14px;
  }

  .feed-meta span {
    font-size: 12px;
  }

  .feed-card > p {
    font-size: 14px;
    line-height: 1.5;
  }

  .post-media {
    margin: 12px 0;
    border-radius: 10px;
    max-width: 100%;
    overflow: hidden;
  }

  .post-media img,
  .post-media video,
  .post-media svg {
    width: 100%;
    max-width: 100%;
    height: auto;
  }

  .post-media figcaption {
    padding: 8px;
    font-size: 12px;
  }

  .feed-actions {
    padding: 10px 0 0;
    gap: 12px;
  }

  .feed-actions button {
    font-size: 13px;
    padding: 6px 12px;
  }

  .feed-card-tools {
    gap: 4px;
  }

  .feed-card-tools .icon-button {
    width: 32px;
    height: 32px;
    font-size: 0.9rem;
  }

  .sale-badge {
    width: 50px;
    height: 50px;
    top: 8px;
    right: 8px;
  }

  .sale-badge-text {
    font-size: 7px;
  }

  .sale-badge-percent {
    font-size: 13px;
  }

  .shop-now-btn {
    bottom: 8px;
    right: 8px;
    padding: 8px 14px;
    font-size: 13px;
  }

  .shop-now-btn i {
    font-size: 14px;
  }

  .floating-bar {
    bottom: 12px;
    right: 12px;
    gap: 10px;
  }

  .fab--horizontal,
  .fab--center {
    width: 48px;
    height: 48px;
    font-size: 1.2rem;
  }

  .modal__card {
    width: 95%;
    max-width: 95vw;
    max-height: 85vh;
    margin: 0 auto;
    border-radius: 12px;
  }

  .modal__header {
    padding: 14px;
  }

  .modal__header h2 {
    font-size: 1.1rem;
  }

  .modal__content {
    padding: 14px;
    max-height: calc(85vh - 120px);
    overflow-y: auto;
  }

  .businesses-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .business-listing {
    padding: 14px;
  }

  .business-logo {
    width: 48px;
    height: 48px;
    font-size: 1rem;
  }

  .business-meta h3 {
    font-size: 15px;
  }

  .business-meta .business-type {
    font-size: 12px;
  }

  .info-row {
    font-size: 13px;
  }

  .business-action {
    padding: 8px 12px;
    font-size: 13px;
  }

  .story-viewer {
    padding: 16px 8px;
  }

  .story-viewer__card {
    width: 95%;
    max-width: 95vw;
    padding: 16px;
    border-radius: 12px;
  }

  .story-viewer__slide {
    min-height: 280px;
    border-radius: 10px;
  }

  .story-viewer__slide-inner {
    padding: 16px;
  }

  .story-viewer__slide-inner h2 {
    font-size: 1.2rem;
  }

  .story-viewer__slide-inner p {
    font-size: 13px;
  }

  .story-viewer__actions {
    flex-direction: column;
    gap: 10px;
  }

  .story-viewer__company-bar {
    padding: 10px;
  }

  .story-viewer__logo {
    width: 36px;
    height: 36px;
    font-size: 0.8rem;
  }

  .story-viewer__company-name {
    font-size: 14px;
  }

  .load-more-container {
    margin: 20px 0;
    padding: 16px 0;
  }

  #load-more-btn {
    padding: 10px 20px;
    font-size: 14px;
  }

  .card {
    padding: 14px;
    border-radius: 12px;
  }

  .section-title {
    font-size: 14px;
    margin-bottom: 12px;
  }
}

/* Load More Section */
.load-more-container {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 24px 16px;
  margin: 24px auto;
  width: 100%;
  max-width: 600px;
}

#load-more-btn {
  min-width: 200px;
  padding: 12px 24px;
  font-size: 14px;
  font-weight: 600;
  border: none;
  background: var(--accent);
  color: white;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition);
}

#load-more-btn:hover:not(:disabled) {
  background: #4557d4;
  transform: translateY(-2px);
  box-shadow: 0 8px 16px rgba(76, 110, 245, 0.3);
}

#load-more-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Loading Spinner */
.loading-spinner {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  color: var(--text-secondary);
}

.spinner {
  width: 20px;
  height: 20px;
  border: 3px solid rgba(76, 110, 245, 0.2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* Sale Badge Styles */
.sale-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #f03e3e 0%, #fa5252 100%);
  color: white;
  border-radius: 50px;
  padding: 6px 16px;
  font-weight: 700;
  font-size: 13px;
  z-index: 10;
  box-shadow: 0 4px 12px rgba(240, 62, 62, 0.4);
  animation: salePopIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  gap: 6px;
  white-space: nowrap;
}

.sale-badge-pulse {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  border-radius: 50px;
  background: rgba(255, 255, 255, 0.3);
  animation: salePulse 2s ease-in-out infinite;
}

.sale-badge-text {
  position: relative;
  z-index: 2;
  display: inline;
  line-height: 1;
  letter-spacing: 0.5px;
  font-size: 11px;
}

.sale-badge-percent {
  position: relative;
  z-index: 2;
  display: inline;
  font-size: 14px;
  line-height: 1;
  font-weight: 800;
}

/* Shop Now Button */
.shop-now-btn {
  position: absolute;
  bottom: 12px;
  left: 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, #20c997 0%, #12b886 100%);
  color: white;
  border: none;
  border-radius: 50px;
  padding: 8px 16px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  z-index: 9;
  box-shadow: 0 4px 12px rgba(32, 201, 151, 0.4);
  animation: shopSlideIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) 0.2s both;
  transition: all 0.3s ease;
  text-decoration: none;
}

.shop-now-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(32, 201, 151, 0.5);
  background: linear-gradient(135deg, #1aad88 0%, #0d9d77 100%);
  color: white;
}

.shop-now-btn:active {
  transform: translateY(0);
}

@keyframes salePopIn {
  0% {
    transform: scale(0) rotate(-30deg);
    opacity: 0;
  }
  70% {
    transform: scale(1.15) rotate(5deg);
  }
  100% {
    transform: scale(1) rotate(0deg);
    opacity: 1;
  }
}

@keyframes salePulse {
  0%, 100% {
    opacity: 0.4;
    transform: scale(1);
  }
  50% {
    opacity: 0.7;
    transform: scale(1.05);
  }
}

/* Ensure post-media is position relative for absolute positioning of badge - already set above */

/* Post Animations */
@keyframes feedSlideIn {
  0% {
    opacity: 0;
    transform: translateY(20px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInLeft {
  0% {
    opacity: 0;
    transform: translateX(-15px);
  }
  100% {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes scaleIn {
  0% {
    opacity: 0;
    transform: scale(0.95);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes fadeInUp {
  0% {
    opacity: 0;
    transform: translateY(10px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInRight {
  0% {
    opacity: 0;
    transform: translateX(15px);
  }
  100% {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes shopSlideIn {
  0% {
    opacity: 0;
    transform: translateY(15px) scale(0.9);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Video Player Modal (TikTok Style) */
.video-player-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 200;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 200ms ease;
}

.video-player-modal[hidden] {
  display: none;
}

.video-player-container {
  position: relative;
  width: 100%;
  height: 100%;
  max-width: 600px;
  max-height: 800px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
  border-radius: 20px;
  overflow: hidden;
}

.main-video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
}

.video-close-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.6);
  color: #ffffff;
  border: none;
  font-size: 1.8rem;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background 200ms ease, transform 200ms ease;
  z-index: 10;
}

.video-close-btn:hover {
  background: rgba(0, 0, 0, 0.9);
  transform: scale(1.1);
}

.video-controls {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 16px;
  z-index: 10;
}

.video-nav-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.6);
  background: rgba(0, 0, 0, 0.5);
  color: #ffffff;
  font-size: 1.4rem;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: all 200ms ease;
}

.video-nav-btn:hover {
  background: rgba(0, 0, 0, 0.8);
  border-color: #ffffff;
  transform: scale(1.08);
}

/* Mobile responsive video player */
@media (max-width: 768px) {
  .video-player-container {
    max-width: 100%;
    max-height: 100%;
    border-radius: 0;
  }
  
  .video-controls {
    bottom: 16px;
    gap: 12px;
  }
  
  .video-nav-btn {
    width: 44px;
    height: 44px;
    font-size: 1.2rem;
  }
}

/* iPhone 11 and Similar Devices - Additional Fixes */
@media (max-width: 414px) {
  html {
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
  }

  body {
    -webkit-overflow-scrolling: touch;
  }

  * {
    -webkit-tap-highlight-color: transparent;
  }

  img, video, svg {
    max-width: 100%;
    height: auto;
  }

  .topbar {
    padding: 10px 12px;
  }

  .brand {
    font-size: 0.85rem;
    gap: 6px;
  }

  .brand-logo {
    width: 32px;
    height: 32px;
    font-size: 1.1rem;
  }

  .nav-actions {
    gap: 6px;
  }

  .icon-button {
    width: 34px;
    height: 34px;
    font-size: 0.95rem;
  }

  .avatar--small {
    width: 30px;
    height: 30px;
  }

  .layout {
    padding: 12px 10px 100px;
    gap: 14px;
  }

  .story-rail {
    margin: 0 -10px;
    padding: 0 10px;
  }

  .story-card {
    min-width: 85px;
    max-width: 85px;
    height: 115px;
    padding: 6px;
  }

  .story-card__logo {
    width: 44px;
    height: 44px;
    font-size: 0.95rem;
  }

  .story-user {
    font-size: 0.7rem;
  }

  .composer.card {
    padding: 12px;
  }

  .composer textarea {
    font-size: 13px;
    min-height: 70px;
    padding: 10px;
  }

  .feed-card {
    padding: 12px;
  }

  .avatar {
    width: 44px;
    height: 44px;
    font-size: 0.8rem;
  }

  .feed-meta div {
    font-size: 13px;
  }

  .feed-meta span {
    font-size: 11px;
  }

  .feed-card > p {
    font-size: 13px;
  }

  .post-media {
    margin: 10px 0;
  }

  .feed-actions button {
    font-size: 12px;
    padding: 5px 10px;
  }

  .feed-card-tools .icon-button {
    width: 30px;
    height: 30px;
    font-size: 0.85rem;
  }

  .sale-badge {
    width: 45px;
    height: 45px;
    padding: 4px 12px;
  }

  .sale-badge-text {
    font-size: 6px;
  }

  .sale-badge-percent {
    font-size: 12px;
  }

  .shop-now-btn {
    padding: 6px 12px;
    font-size: 12px;
  }

  .floating-bar {
    bottom: 10px;
    right: 10px;
  }

  .fab--horizontal,
  .fab--center {
    width: 44px;
    height: 44px;
    font-size: 1.1rem;
  }

  .modal__card {
    width: 96%;
    max-width: 96vw;
  }

  .modal__header {
    padding: 12px;
  }

  .modal__header h2 {
    font-size: 1rem;
  }

  .modal__content {
    padding: 12px;
  }

  .business-listing {
    padding: 12px;
  }

  .business-logo {
    width: 44px;
    height: 44px;
    font-size: 0.95rem;
  }

  .business-meta h3 {
    font-size: 14px;
  }

  .business-action {
    padding: 7px 10px;
    font-size: 12px;
  }

  #load-more-btn {
    min-width: 160px;
    padding: 10px 18px;
    font-size: 13px;
  }
}

/* Success Notification Animations */
@keyframes slideInRight {
  0% {
    opacity: 0;
    transform: translateX(100px);
  }
  100% {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideOutRight {
  0% {
    opacity: 1;
    transform: translateX(0);
  }
  100% {
    opacity: 0;
    transform: translateX(100px);
  }
}

/* Like Button Animations */
.like-button {
  position: relative;
  transition: all 0.3s ease;
  cursor: pointer;
}

.like-button:hover {
  transform: scale(1.1);
}

.like-button.liked {
  animation: likeButtonPulse 0.5s ease;
}

.like-button.liked .like-icon {
  color: #f43f5e;
  animation: heartBeat 0.5s ease;
}

.like-button.liking {
  pointer-events: none;
}

.like-count {
  display: inline-block;
  transition: transform 0.2s ease;
  font-weight: 600;
}

@keyframes likeButtonPulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.2);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes heartBeat {
  0%, 100% {
    transform: scale(1);
  }
  10%, 30% {
    transform: scale(0.9);
  }
  20%, 40%, 60%, 80% {
    transform: scale(1.1);
  }
  50%, 70% {
    transform: scale(1.05);
  }
}

/* Floating Hearts Animation */
.floating-heart {
  position: fixed;
  font-size: 24px;
  pointer-events: none;
  z-index: 9999;
  animation: floatUp 1s ease-out forwards;
  opacity: 0;
}

@keyframes floatUp {
  0% {
    opacity: 1;
    transform: translateY(0) scale(1) rotate(0deg);
  }
  50% {
    opacity: 0.8;
    transform: translateY(-50px) scale(1.2) rotate(15deg);
  }
  100% {
    opacity: 0;
    transform: translateY(-120px) scale(0.5) rotate(30deg);
  }
}

/* Comments Modal Styles */
.modal__card--comments {
  max-width: 700px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
}

.modal__card--comments .modal__content {
  flex: 1;
  overflow-y: auto;
  padding: 0;
}

.modal-post-content {
  padding: 20px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-alt);
}

.modal-post-content .feed-meta {
  margin-bottom: 12px;
}

.modal-post-content p {
  margin: 12px 0;
  line-height: 1.6;
}

.modal-post-actions {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.modal-post-actions .like-button {
  background: none;
  border: none;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.2s ease;
  font-size: 15px;
}

.modal-post-actions .like-button:hover {
  background: var(--accent-soft);
}

.comments-section {
  padding: 20px;
}

.comments-title {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--text-primary);
}

.comments-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-height: 400px;
  overflow-y: auto;
  padding-right: 8px;
}

.comments-list::-webkit-scrollbar {
  width: 6px;
}

.comments-list::-webkit-scrollbar-track {
  background: var(--bg);
  border-radius: 3px;
}

.comments-list::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

.comments-list::-webkit-scrollbar-thumb:hover {
  background: var(--text-secondary);
}

.comment-item {
  display: flex;
  gap: 12px;
  padding: 12px;
  background: var(--surface);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}

.comment-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--success));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 14px;
  color: white;
  flex-shrink: 0;
}

.comment-content {
  flex: 1;
  min-width: 0;
}

.comment-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.comment-header strong {
  font-size: 14px;
  color: var(--text-primary);
}

.comment-time {
  font-size: 12px;
  color: var(--text-secondary);
}

.comment-text {
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-primary);
  margin: 0;
  word-wrap: break-word;
}

.add-comment-form {
  display: flex;
  gap: 12px;
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  background: var(--surface);
}

.add-comment-form textarea {
  flex: 1;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 14px;
  resize: none;
  transition: border-color 0.2s ease;
}

.add-comment-form textarea:focus {
  outline: none;
  border-color: var(--accent);
}

.add-comment-form .pill-button {
  align-self: flex-end;
  padding: 10px 24px;
  white-space: nowrap;
}

.comment-button {
  cursor: pointer;
  transition: all 0.2s ease;
}

.comment-button:hover {
  transform: scale(1.05);
  color: var(--accent);
}

/* Mobile responsiveness for comments modal */
@media (max-width: 768px) {
  .modal__card--comments {
    max-width: 95vw;
    max-height: 90vh;
  }
  
  .comments-list {
    max-height: 300px;
  }
  
  .add-comment-form {
    flex-direction: column;
    gap: 8px;
  }
  
  .add-comment-form .pill-button {
    width: 100%;
  }
}

/* Insights Button Styles */
.insights-button {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 12px;
  margin-left: 8px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.insights-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.5);
}

.insights-button i {
  font-size: 14px;
}

/* Insights Modal Styles */
.modal__card--insights {
  max-width: 600px;
  max-height: 80vh;
}

.insights-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 16px;
  margin-bottom: 30px;
  padding: 20px;
}

.insight-card {
  background: var(--surface);
  border-radius: var(--radius-md);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  border: 2px solid var(--border);
  transition: all 0.3s ease;
}

.insight-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-soft);
}

.insight-card--likes {
  border-color: #f43f5e;
}

.insight-card--comments {
  border-color: #667eea;
}

.insight-card--impressions {
  border-color: #20c997;
}

.insight-icon {
  font-size: 36px;
  line-height: 1;
}

.insight-info {
  flex: 1;
}

.insight-label {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 4px;
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.insight-value {
  font-size: 32px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
}

.insights-chart {
  padding: 20px;
  background: var(--surface-alt);
  border-radius: var(--radius-md);
  margin: 0 20px 20px 20px;
}

.insights-chart h3 {
  font-size: 18px;
  margin-bottom: 20px;
  color: var(--text-primary);
}

.engagement-bars {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.engagement-bar {
  display: grid;
  grid-template-columns: 100px 1fr 60px;
  align-items: center;
  gap: 12px;
}

.bar-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.bar-container {
  background: var(--bg);
  border-radius: 8px;
  height: 24px;
  overflow: hidden;
  position: relative;
}

.bar {
  height: 100%;
  border-radius: 8px;
  transition: width 0.8s ease;
  background: linear-gradient(90deg, var(--accent), var(--success));
}

.bar--likes {
  background: linear-gradient(90deg, #f43f5e, #ff6b6b);
}

.bar--comments {
  background: linear-gradient(90deg, #667eea, #764ba2);
}

/* Share Modal Styles */
.share-preview {
  background: var(--surface-alt);
  border-radius: var(--radius-md);
  padding: 20px;
  margin-bottom: 16px;
  border-left: 4px solid var(--accent);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.share-preview-header {
  margin-bottom: 12px;
  color: var(--text-primary);
  font-size: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.share-preview-header::before {
  content: '👤';
  font-size: 18px;
}

.share-post-text {
  color: var(--text-primary);
  line-height: 1.6;
  margin: 0;
  font-size: 15px;
}

#share-preview-link {
  word-break: break-all;
  color: var(--accent);
}

.share-link-container {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
}

.share-button {
  cursor: pointer;
  transition: all 0.2s ease;
}

.share-button:hover {
  color: var(--accent);
  transform: scale(1.1);
}

.share-count {
  font-weight: 600;
}

/* Mobile responsiveness for share modal */
@media (max-width: 768px) {
  .share-actions {
    flex-direction: column;
  }
  
  .share-actions button {
    width: 100%;
  }
}

.bar--impressions {
  background: linear-gradient(90deg, #20c997, #10b981);
}

.bar-value {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  text-align: right;
}

/* Mobile responsiveness for insights modal */
@media (max-width: 768px) {
  .modal__card--insights {
    max-width: 95vw;
  }
  
  .insights-grid {
    grid-template-columns: 1fr;
  }
  
  .insight-value {
    font-size: 24px;
  }
  
  .engagement-bar {
    grid-template-columns: 80px 1fr 50px;
    gap: 8px;
  }
  
  .bar-label {
    font-size: 12px;
  }
  
  .bar-value {
    font-size: 12px;
  }
}

/* Post Impression Tracking - Subtle indicator */
.feed-card[data-impression-tracked="true"] {
  position: relative;
}

.feed-card[data-impression-tracked="true"]::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 3px;
  height: 0%;
  background: linear-gradient(180deg, var(--accent), var(--success));
  border-radius: 0 0 3px 3px;
  transition: height 0.5s ease;
  opacity: 0.6;
}

.feed-card.viewing::before {
  height: 100%;
}

/* Image Modal Styles */
.modal__card--image {
  max-width: 95vw;
  max-height: 90vh;
  width: 900px;
}

.image-modal-container {
  display: flex;
  gap: 20px;
  align-items: flex-start;
}

.image-modal-image {
  flex: 1;
  max-width: 60%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.image-modal-image img {
  max-width: 100%;
  max-height: 80vh;
  object-fit: contain;
  border-radius: var(--radius-md);
}

.image-modal-info {
  flex: 1;
  min-width: 300px;
  max-width: 400px;
}

.image-modal-stats {
  display: flex;
  gap: 20px;
  margin-bottom: 20px;
  padding: 20px;
  background: var(--surface-alt);
  border-radius: var(--radius-md);
}

.stat-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
  color: var(--text-primary);
}

.stat-icon {
  font-size: 1.2rem;
}

.stat-value {
  font-size: 1.5rem;
  font-weight: 700;
}

.stat-label {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.image-modal-comments h4 {
  margin: 0 0 16px 0;
  padding: 20px 20px 0 20px;
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
}

.image-modal-comments .comments-list {
  max-height: 400px;
  overflow-y: auto;
  padding: 0 20px 20px 20px;
}

/* Mobile responsiveness for image modal */
@media (max-width: 768px) {
  .modal__card--image {
    max-width: 95vw;
    max-height: 95vh;
  }

  .image-modal-container {
    flex-direction: column;
    gap: 16px;
  }

  .image-modal-image {
    max-width: 100%;
  }

  .image-modal-image img {
    max-height: 50vh;
  }

  .image-modal-info {
    min-width: unset;
    max-width: unset;
  }

  .image-modal-stats {
    padding: 16px;
  }

  .image-modal-comments .comments-list {
    max-height: 300px;
    padding: 0 16px 16px 16px;
  }
}

/* Story Modal Styles */
#story-modal .modal__content {
  padding: 24px;
}

#story-form .form-group {
  margin-bottom: 20px;
}

#story-form label {
  display: block;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
  font-size: 14px;
}

#story-form input[type="file"] {
  width: 100%;
  padding: 12px;
  border: 2px dashed var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--text-primary);
  cursor: pointer;
  transition: var(--transition);
}

#story-form input[type="file"]:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

#story-form input[type="file"]:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: var(--shadow-ring);
}

#story-form textarea {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 14px;
  resize: vertical;
  min-height: 80px;
  transition: var(--transition);
}

#story-form textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: var(--shadow-ring);
}

#story-form .form-help {
  display: block;
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 4px;
}

#story-form .form-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

#story-form .btn {
  padding: 10px 20px;
  border: none;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

#story-form .btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

#story-form .btn-primary {
  background: var(--accent);
  color: white;
}

#story-form .btn-primary:hover:not(:disabled) {
  background: #3b5bdb;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(76, 110, 245, 0.3);
}

#story-form .btn-secondary {
  background: var(--surface);
  color: var(--text-primary);
  border: 1px solid var(--border);
}

#story-form .btn-secondary:hover {
  background: var(--surface-alt);
}

#story-form .btn-loading {
  display: none;
}

#story-form .btn-loading i {
  animation: spin 1s linear infinite;
}

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

/* Responsive adjustments */
@media (max-width: 768px) {
  #story-modal .modal__content {
    padding: 16px;
  }

  #story-form .form-actions {
    flex-direction: column;
  }

  #story-form .btn {
    width: 100%;
    justify-content: center;
  }
}
