/* TweetShot Studio - Custom Styles */
@import url('chirp-fonts.css');


/* Canvas Dot Pattern */
.dot-pattern {
  background-color: #f1f3f5;
  background-image: radial-gradient(rgba(100, 116, 139, 0.2) 1px, transparent 1px);
  background-size: 16px 16px;
}

/* Transparent Checkerboard Pattern */
.checkerboard {
  background-color: #ffffff;
  background-image: linear-gradient(45deg, #e2e8f0 25%, transparent 25%),
                    linear-gradient(-45deg, #e2e8f0 25%, transparent 25%),
                    linear-gradient(45deg, transparent 75%, #e2e8f0 75%),
                    linear-gradient(-45deg, transparent 75%, #e2e8f0 75%);
  background-size: 12px 12px;
  background-position: 0 0, 0 6px, 6px -6px, -6px 0px;
}

/* Thin Scrollbar */
::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 9999px;
}

::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* Card Themes */
.card-theme-light {
  background-color: #ffffff !important;
  color: #0f1419 !important;
  border-color: rgba(226, 232, 240, 0.8) !important;
}
.card-theme-light .tweet-author-name,
.card-theme-light .tweet-text,
.card-theme-light #tweetAuthorName,
.card-theme-light #tweetText {
  color: #0f1419 !important;
}
.card-theme-light .tweet-handle,
.card-theme-light .tweet-timestamp,
.card-theme-light .tweet-views,
.card-theme-light .tweet-metrics-container,
.card-theme-light #tweetHandle,
.card-theme-light #tweetTimestamp,
.card-theme-light #tweetMetricsContainer,
.card-theme-light #tweetInlineViews {
  color: #536471 !important;
}
.card-theme-light .card-divider,
.card-theme-light #cardDivider {
  background-color: #eff3f4 !important;
}

/* Dark Theme (Lights Out - Pitch Black) */
.card-theme-dark {
  background-color: #000000 !important;
  color: #f7f9f9 !important;
  border-color: #2f3336 !important;
}
.card-theme-dark .tweet-author-name,
.card-theme-dark .tweet-text,
.card-theme-dark #tweetAuthorName,
.card-theme-dark #tweetText {
  color: #f7f9f9 !important;
}
.card-theme-dark .tweet-handle,
.card-theme-dark .tweet-timestamp,
.card-theme-dark .tweet-views,
.card-theme-dark .tweet-metrics-container,
.card-theme-dark #tweetHandle,
.card-theme-dark #tweetTimestamp,
.card-theme-dark #tweetMetricsContainer,
.card-theme-dark #tweetInlineViews {
  color: #71767b !important;
}
.card-theme-dark .card-divider,
.card-theme-dark #cardDivider {
  background-color: #2f3336 !important;
}
.card-theme-dark [contenteditable="true"]:hover {
  background-color: rgba(255, 255, 255, 0.08) !important;
}

/* Dim Theme (Twitter Blue Slate #15202B) */
.card-theme-dim {
  background-color: #15202b !important;
  color: #f7f9f9 !important;
  border-color: #38444d !important;
}
.card-theme-dim .tweet-author-name,
.card-theme-dim .tweet-text,
.card-theme-dim #tweetAuthorName,
.card-theme-dim #tweetText {
  color: #ffffff !important;
}
.card-theme-dim .tweet-handle,
.card-theme-dim .tweet-timestamp,
.card-theme-dim .tweet-views,
.card-theme-dim .tweet-metrics-container,
.card-theme-dim #tweetHandle,
.card-theme-dim #tweetTimestamp,
.card-theme-dim #tweetMetricsContainer,
.card-theme-dim #tweetInlineViews {
  color: #8899a6 !important;
}
.card-theme-dim .card-divider,
.card-theme-dim #cardDivider {
  background-color: #38444d !important;
}
.card-theme-dim [contenteditable="true"]:hover {
  background-color: rgba(255, 255, 255, 0.08) !important;
}

/* Glassmorphism Theme (Frosted Acrylic) */
.card-theme-glass {
  background-color: rgba(255, 255, 255, 0.72) !important;
  backdrop-filter: blur(20px) saturate(180%) !important;
  -webkit-backdrop-filter: blur(20px) saturate(180%) !important;
  border-color: rgba(255, 255, 255, 0.45) !important;
  box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.15) !important;
  color: #0f1419 !important;
}
.card-theme-glass .tweet-author-name,
.card-theme-glass .tweet-text,
.card-theme-glass #tweetAuthorName,
.card-theme-glass #tweetText {
  color: #0f1419 !important;
}
.card-theme-glass .card-divider,
.card-theme-glass #cardDivider {
  background-color: rgba(0, 0, 0, 0.06) !important;
}

/* Multi-Tweet Layout Stability */
.tweet-card-unit {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: all 0.2s ease-in-out;
  box-sizing: border-box;
}

.export-target {
  box-sizing: border-box;
  width: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: stretch;
  position: relative;
  border-radius: 0 !important;
  transition: all 0.2s ease-in-out;
}

.tweet-text {
  word-break: break-word;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
  line-height: 1.35 !important;
  letter-spacing: -0.012em;
  font-size: 16px;
  margin-top: 2px;
  margin-bottom: 12px;
  padding: 0;
}

/* Twitter Hashtag Stili (#1d9bf0) */
.tweet-hashtag,
.tweet-text .tweet-hashtag,
.card-theme-light .tweet-text .tweet-hashtag,
.card-theme-dark .tweet-text .tweet-hashtag,
.card-theme-dim .tweet-text .tweet-hashtag,
.card-theme-glass .tweet-text .tweet-hashtag {
  color: #1d9bf0 !important;
  text-decoration: none;
  font-weight: inherit;
}

/* Card Header - Precision Alignment (0px Shift in Preview and Export) */
.tweet-header-user {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1 1 0%;
}

.tweet-author-box {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  flex: 1 1 0%;
  overflow: visible;
}

.tweet-author-row {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  overflow: visible;
}

.tweet-author-name {
  font-weight: 700;
  font-size: 15px;
  line-height: 1.45;
  white-space: nowrap;
  overflow-x: hidden;
  overflow-y: visible;
  text-overflow: ellipsis;
  display: inline-block;
  margin: 0;
  padding: 0 0 3px 0;
  box-sizing: content-box;
}

.tweet-verified-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 17px;
  height: 17px;
}

.tweet-handle-row {
  display: flex;
  align-items: center;
  min-width: 0;
  margin-top: 1px;
  overflow: visible;
}

.tweet-handle {
  font-size: 14px;
  line-height: 1.45;
  white-space: nowrap;
  overflow-x: hidden;
  overflow-y: visible;
  text-overflow: ellipsis;
  display: inline-block;
  margin: 0;
  padding: 0 0 3px 0;
  box-sizing: content-box;
}

/* ContentEditable Focus Ring */
[contenteditable="true"] {
  border-radius: 4px;
  transition: background-color 0.15s ease;
}

[contenteditable="true"]:hover {
  background-color: rgba(100, 116, 139, 0.08);
}

[contenteditable="true"]:focus {
  outline: 2px dashed #0284c7 !important;
  outline-offset: 2px;
  background-color: rgba(14, 165, 233, 0.06) !important;
}

/* Card Shadows */
.shadow-preset-none {
  box-shadow: none !important;
}
.shadow-preset-small {
  box-shadow: 0 2px 8px -1px rgba(0, 0, 0, 0.08), 0 1px 4px -1px rgba(0, 0, 0, 0.04) !important;
}
.shadow-preset-medium {
  box-shadow: 0 12px 28px -4px rgba(0, 0, 0, 0.14), 0 6px 12px -2px rgba(0, 0, 0, 0.06) !important;
}
.shadow-preset-large {
  box-shadow: 0 24px 48px -8px rgba(0, 0, 0, 0.22), 0 12px 24px -4px rgba(0, 0, 0, 0.12) !important;
}
.shadow-preset-glow {
  box-shadow: 0 0 40px rgba(56, 189, 248, 0.45), 0 12px 24px -4px rgba(0, 0, 0, 0.15) !important;
}

/* Animations for Video Preview */
@keyframes fadeAndRise {
  0% {
    opacity: 0;
    transform: translateY(28px) scale(0.98);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.anim-fade-rise {
  animation: fadeAndRise 0.85s cubic-bezier(0.16, 1, 0.3, 1) forwards !important;
}

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

.anim-slide-up {
  animation: slideUp 0.85s cubic-bezier(0.16, 1, 0.3, 1) forwards !important;
}

@keyframes zoomIn {
  0% {
    opacity: 0;
    transform: scale(0.82);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

.anim-zoom-in {
  animation: zoomIn 0.85s cubic-bezier(0.16, 1, 0.3, 1) forwards !important;
}

/* Active Selected Tweet Unit (Only highlights the header, leaves exportTarget 100% clean) */
.tweet-card-unit.tweet-unit-active .tweet-header-strip {
  filter: drop-shadow(0 2px 6px rgba(99, 102, 241, 0.25));
}

/* Toast animations */
@keyframes toastIn {
  from {
    transform: translateY(12px) scale(0.96);
    opacity: 0;
  }
  to {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

.toast-animate {
  animation: toastIn 0.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* ================= Mobile Responsive Tweaks ================= */
@media (max-width: 767px) {
  #sidebar {
    box-shadow: -8px 0 32px rgba(15, 23, 42, 0.18) !important;
  }
  
  /* Touch target sizes */
  button, input, select {
    min-height: 36px;
  }

  /* Compact padding in mobile preview */
  #canvasViewport {
    padding: 8px !important;
  }

  .tweet-card-unit {
    width: 100% !important;
    max-width: 100% !important;
  }

  .export-target {
    max-width: 100% !important;
  }

  /* iOS safe area */
  #btnMobileSettingsFab {
    bottom: calc(1.25rem + env(safe-area-inset-bottom, 0px));
    right: calc(1.25rem + env(safe-area-inset-right, 0px));
  }
}
