/* GOLPOOGRO - Premium Instagram + Threads Create Post Modal Styles */

.create-post-overlay {
  position: fixed;
  inset: 0;
  background: rgba(4, 8, 15, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: 1050;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--spacing-md);
  opacity: 0;
  transition: opacity 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
}

.create-post-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

/* Apple-level Cinematic Modal Entry Animations */
.create-post-modal {
  width: 100%;
  max-width: 680px;
  height: 90vh;
  max-height: 820px;
  background: rgba(13, 20, 35, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-lg);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6), 
              0 0 100px rgba(30, 144, 255, 0.08); /* Sophisticated ambient flow */
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
  transform: scale(0.92) translate3d(0, 40px, 0);
  opacity: 0;
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1),
              opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.create-post-overlay.active .create-post-modal {
  transform: scale(1) translate3d(0, 0, 0);
  opacity: 1;
}

/* Glassmorphic highlights & reflections */
.glass-effects {
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  position: relative;
}

.glass-effects::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.12),
    rgba(255, 255, 255, 0.02)
  );
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

/* Modal Header styling */
.post-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--spacing-md) var(--spacing-lg);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(10, 15, 28, 0.4);
}

.user-profile-badge {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
}

.border-glow-blue {
  border: 2px solid rgba(59, 130, 246, 0.6);
  box-shadow: 0 0 12px rgba(59, 130, 246, 0.25);
}

.user-meta-info {
  display: flex;
  flex-direction: column;
}

.user-title-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.user-name {
  font-size: 0.95rem;
  color: var(--text-primary);
  font-weight: 500;
  letter-spacing: -0.01em;
}

.svg-badge-teal {
  width: 15px;
  height: 15px;
  color: var(--accent-teal);
  fill: rgba(20, 241, 149, 0.1);
}

.user-subrow {
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
  margin-top: 2px;
}

.level-indicator {
  font-size: 0.75rem;
  color: var(--accent-gold);
  font-weight: 500;
}

.bullet-dot {
  color: var(--text-muted);
  font-size: 0.8rem;
}

.audience-select {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  color: var(--text-muted);
  font-size: 0.72rem;
  padding: 2px 6px;
  cursor: pointer;
  outline: none;
  transition: all 0.3s;
}

.audience-select:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
}

.post-modal-close {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 50%;
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.post-modal-close:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.15);
  color: var(--text-primary);
  transform: scale(1.05);
}

/* Scrollable area */
.post-modal-scroll-area {
  flex: 1;
  overflow-y: auto;
  padding: var(--spacing-lg);
  display: flex;
  flex-direction: column;
  gap: var(--spacing-lg);
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.05) transparent;
}

.post-modal-scroll-area::-webkit-scrollbar {
  width: 5px;
}

.post-modal-scroll-area::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.06);
  border-radius: 4px;
}

/* Horizontal scroller of post type options */
.post-type-scroller {
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
  overflow-x: auto;
  overflow-y: visible;
  padding-top: 8px;
  padding-bottom: 12px;
  flex-shrink: 0;
  scrollbar-width: none;
}

.post-type-scroller::-webkit-scrollbar {
  display: none;
}

.post-type-btn {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  padding: var(--spacing-xs) 14px;
  border-radius: 20px;
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.post-type-btn svg {
  width: 15px;
  height: 15px;
}

.post-type-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.12);
  color: var(--text-primary);
}

.post-type-btn.active {
  background: rgba(59, 130, 246, 0.12);
  border-color: rgba(59, 130, 246, 0.35);
  color: var(--accent-blue);
  box-shadow: inset 0 0 10px rgba(59, 130, 246, 0.05);
}

/* Accordion triggers for advanced panel features */
.nested-widgets-accordion {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
}

.accordion-trigger {
  width: 100%;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  padding: 12px 16px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--text-muted);
  font-size: 0.88rem;
  cursor: pointer;
  transition: all 0.3s;
  text-align: left;
}

.accordion-trigger:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
}

.accordion-trigger .title-left {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
}

.accordion-trigger .title-left svg {
  width: 16px;
  height: 16px;
}

.accordion-trigger .chevron {
  width: 14px;
  height: 14px;
  transition: transform 0.3s;
}

.accordion-trigger.active .chevron {
  transform: rotate(45deg);
}

.accordion-content {
  display: none;
  padding: 4px var(--spacing-md) var(--spacing-md);
  background: rgba(5, 8, 16, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.03);
  border-top: none;
  border-bottom-left-radius: var(--radius-md);
  border-bottom-right-radius: var(--radius-md);
  margin-top: -8px;
  margin-bottom: var(--spacing-xs);
}

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

/* Poll builder inside modal */
.poll-builder-ui {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
}

.poll-input-fields {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-xs);
}

.poll-actions-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--spacing-md);
}

.duration-select {
  background: rgba(13, 20, 35, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  color: var(--text-muted);
  font-size: 0.75rem;
  padding: var(--spacing-xs) var(--spacing-sm);
  outline: none;
  cursor: pointer;
}

/* Metadata Accessories Grid elements */
.meta-triggers-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--spacing-sm);
  margin-top: var(--spacing-sm);
}

.meta-select-wrap {
  position: relative;
  display: flex;
  align-items: center;
  background: rgba(250, 250, 250, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-md);
  padding: var(--spacing-xs) var(--spacing-sm);
  transition: all 0.3s;
}

.meta-select-wrap:focus-within, .meta-select-wrap:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.12);
}

.meta-icon {
  width: 15px;
  height: 15px;
  margin-right: var(--spacing-sm);
  flex-shrink: 0;
}

.glass-meta-select {
  background: transparent;
  width: 100%;
  border: none;
  outline: none;
  color: var(--text-muted);
  font-size: 0.8rem;
  cursor: pointer;
}

.glass-meta-select option {
  background: rgb(13, 20, 35);
  color: var(--text-muted);
}

.glass-meta-input {
  background: transparent;
  width: 100%;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-size: 0.8rem;
}

.glass-meta-input::placeholder {
  color: var(--text-muted);
  font-size: 0.75rem;
}

/* GIF Search Panel */
.gif-search-wrapper {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
}

.gif-results-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--spacing-xs);
  max-height: 140px;
  overflow-y: auto;
}

.gif-item {
  aspect-ratio: 16/9;
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.05);
  cursor: pointer;
  transition: all 0.2s;
}

.gif-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}

.gif-item:hover, .gif-item.active {
  border-color: var(--accent-blue);
  transform: scale(1.05);
}

/* AI Assistant Card */
.ai-assistant-card {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.04) 0%, rgba(9, 137, 252, 0.02) 100%);
  border: 1px solid rgba(59, 130, 246, 0.25);
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
  overflow: hidden;
}

.border-glow-teal {
  box-shadow: 0 0 20px rgba(59, 130, 246, 0.15);
}

.ai-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.ai-title {
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.ai-title svg {
  width: 14px;
  height: 14px;
}

.anim-sparkle {
  animation: pulse-bloom 2s infinite ease-in-out;
}

@keyframes pulse-bloom {
  0%, 100% { opacity: 0.7; transform: scale(1); filter: drop-shadow(0 0 1px #3b82f6); }
  50% { opacity: 1; transform: scale(1.15); filter: drop-shadow(0 0 6px #3b82f6); }
}

.ai-explanation {
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: var(--line-height-relaxed);
}

.ai-suggestion-preview {
  background: rgba(5, 8, 16, 0.35);
  border: 1px dashed rgba(59, 130, 246, 0.2);
  border-radius: 6px;
  padding: var(--spacing-sm);
  font-size: 0.78rem;
  line-height: var(--line-height-relaxed);
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.3s;
}

.ai-suggestion-preview:hover {
  background: rgba(59, 130, 246, 0.1);
  border-style: solid;
}

/* Modal Persistent Footer controls */
.post-modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--spacing-md) var(--spacing-lg);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(10, 15, 28, 0.5);
  gap: var(--spacing-md);
}

.footer-actions-left {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
}

.footer-actions-right {
  display: flex;
  align-items: center;
}

/* Micro Spinner for Broadcast loads */
.btn-loader-donut {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin-loop 0.8s linear infinite;
  margin-right: 8px;
}

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

/* Multimedia progressive upload progress bar */
.upload-progress-veil {
  position: absolute;
  inset: 0;
  background: rgba(5, 8, 16, 0.85);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  z-index: 1060;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--spacing-lg);
}

.progress-box {
  width: 100%;
  max-width: 440px;
  background: rgba(13, 20, 35, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  padding: var(--spacing-lg);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
}

.progress-info-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--spacing-sm);
}

.progress-title {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-primary);
}

.progress-percent {
  font-size: 0.85rem;
  color: var(--accent-teal);
  font-weight: 600;
}

.progress-bar-rail {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 3px;
  position: relative;
  overflow: hidden;
}

.progress-bar-fill {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent-blue) 0%, var(--accent-teal) 100%);
  border-radius: 3px;
  transition: width 0.15s ease-out;
}

/* Responsive Fullscreen / Bottom-sheet Modal system on Mobile screen breakpoints (< 768px) */
@media (max-width: 767px) {
  .create-post-overlay {
    align-items: flex-end;
    padding: 0;
  }

  .create-post-modal {
    height: 92vh;
    max-height: 92vh;
    border-radius: 20px 20px 0 0;
    border-left: none;
    border-right: none;
    border-bottom: none;
    transform: translate3d(0, 100%, 0);
    opacity: 1; /* Fully visible, animate offset translation scale instead of opacity decay on mobile */
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  }

  .create-post-overlay.active .create-post-modal {
    transform: translate3d(0, 0, 0);
    opacity: 1;
  }

  /* Grabber handle accent at top of the bottom sheet */
  .create-post-modal::before {
    content: '';
    display: block;
    width: 36px;
    height: 4px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 2px;
    margin: 8px auto 0;
    flex-shrink: 0;
  }

  .meta-triggers-grid {
    grid-template-columns: 1fr;
  }
}

/* Skeleton pulse animation inside creation modal header */
@keyframes pulse {
  0%, 100% {
    opacity: 0.35;
    background-color: rgba(255, 255, 255, 0.08);
  }
  50% {
    opacity: 0.75;
    background-color: rgba(255, 255, 255, 0.18);
  }
}

.skeleton-text {
  animation: pulse 1.5s infinite ease-in-out;
}
