/* Runa Chat — User Profile CSS */

/* ── Overlay ───────────────────────────────────────────────────────────── */
.up-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 9000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.up-overlay.visible {
  opacity: 1;
  visibility: visible;
}

/* ── Modal ─────────────────────────────────────────────────────────────── */
.up-modal {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  max-width: 420px;
  background: var(--bg-primary);
  overflow-y: auto;
  overflow-x: hidden;
  transform: translateX(100%);
  transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1);
  -webkit-overflow-scrolling: touch;
}

.up-modal.visible {
  transform: translateX(0);
}

@media (max-width: 480px) {
  .up-modal {
    max-width: 100%;
  }
}

/* ── Header ────────────────────────────────────────────────────────────── */
.up-header {
  position: relative;
  height: 120px;
}

.up-header-bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, 
    rgba(124, 58, 237, 0.4) 0%, 
    rgba(236, 72, 153, 0.3) 50%,
    rgba(249, 115, 22, 0.2) 100%
  );
  filter: blur(0);
}

.up-close {
  position: absolute;
  top: 16px;
  left: 16px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  transition: all 0.2s ease;
}

.up-close:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: scale(1.05);
}

.up-close svg {
  width: 20px;
  height: 20px;
  color: #fff;
}

/* ── Avatar Section ────────────────────────────────────────────────────── */
.up-avatar-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: -60px;
  padding: 0 20px 20px;
  position: relative;
  z-index: 5;
}

.up-avatar-ring {
  position: relative;
  width: 120px;
  height: 120px;
  padding: 4px;
  background: conic-gradient(
    from 0deg,
    #00d4ff,
    #7c3aed,
    #ec4899,
    #f97316,
    #00d4ff
  );
  border-radius: 50%;
  animation: avatarRingRotate 8s linear infinite;
}

@keyframes avatarRingRotate {
  from { filter: hue-rotate(0deg); }
  to { filter: hue-rotate(360deg); }
}

.up-avatar-img,
.up-avatar-placeholder {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--bg-primary);
}

.up-avatar-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
  font-weight: 600;
  color: #fff;
}

.up-online-dot {
  position: absolute;
  bottom: 8px;
  right: 8px;
  width: 20px;
  height: 20px;
  background: #22c55e;
  border: 3px solid var(--bg-primary);
  border-radius: 50%;
  animation: onlinePulse 2s ease-in-out infinite;
}

@keyframes onlinePulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.4); }
  50% { box-shadow: 0 0 0 8px rgba(34, 197, 94, 0); }
}

.up-name {
  margin: 12px 0 2px;
  font-size: 24px;
  font-weight: 600;
  color: var(--text-primary);
}

.up-username {
  font-size: 15px;
  color: var(--accent-cyan);
}

.up-status {
  margin-top: 4px;
  font-size: 13px;
  color: var(--text-muted);
}

/* ── Action Buttons (iOS Style) ────────────────────────────────────────── */
.up-actions {
  display: flex;
  justify-content: center;
  gap: 16px;
  padding: 16px 20px 24px;
}

.up-action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.up-action-btn:hover {
  transform: scale(1.05);
}

.up-action-btn:active {
  transform: scale(0.95);
}

.up-action-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.25s ease;
}

.up-action-icon svg {
  width: 24px;
  height: 24px;
  color: var(--text-primary);
}

.up-action-btn:hover .up-action-icon {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.2);
}

.up-action-btn.active .up-action-icon {
  background: rgba(124, 58, 237, 0.3);
  border-color: rgba(124, 58, 237, 0.4);
}

.up-action-btn.active .up-action-icon svg {
  color: var(--accent-purple);
}

.up-action-btn span:last-child {
  font-size: 12px;
  color: var(--text-secondary);
}

/* ── Sections ──────────────────────────────────────────────────────────── */
.up-sections {
  padding: 0 16px 32px;
}

.up-section {
  background: rgba(255, 255, 255, 0.04);
  border-radius: 12px;
  margin-bottom: 12px;
  overflow: hidden;
}

.up-section-clickable {
  cursor: pointer;
  transition: background 0.2s ease;
}

.up-section-clickable:hover {
  background: rgba(255, 255, 255, 0.08);
}

.up-section-clickable:active {
  background: rgba(255, 255, 255, 0.06);
}

.up-section-header {
  padding: 12px 16px 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.5px;
  background: transparent;
}

.up-section-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
}

.up-section-icon {
  font-size: 20px;
  width: 28px;
  text-align: center;
  flex-shrink: 0;
}

.up-section-content {
  flex: 1;
  min-width: 0;
}

.up-section-label {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.up-section-value {
  font-size: 15px;
  color: var(--text-primary);
}

.up-chevron {
  width: 20px;
  height: 20px;
  color: var(--text-muted);
  flex-shrink: 0;
}

/* ── Auto-delete ───────────────────────────────────────────────────────── */
.up-autodelete {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px 16px 16px;
}

.up-autodelete-btn {
  padding: 8px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
}

.up-autodelete-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.15);
}

.up-autodelete-btn.active {
  background: linear-gradient(135deg, var(--accent-purple), var(--accent-cyan));
  border-color: transparent;
  color: #fff;
}

/* ── Groups ────────────────────────────────────────────────────────────── */
.up-groups {
  padding: 0 0 8px;
}

.up-group-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  cursor: pointer;
  transition: background 0.2s ease;
}

.up-group-item:hover {
  background: rgba(255, 255, 255, 0.06);
}

.up-group-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(124, 58, 237, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.up-group-info {
  flex: 1;
  min-width: 0;
}

.up-group-name {
  font-size: 15px;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.up-group-members {
  font-size: 13px;
  color: var(--text-muted);
}

/* ── Danger Zone ───────────────────────────────────────────────────────── */
.up-danger-zone {
  background: transparent;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.up-danger-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: none;
  border: none;
  cursor: pointer;
  width: 100%;
  text-align: left;
  transition: background 0.2s ease;
}

.up-danger-btn:hover {
  background: rgba(239, 68, 68, 0.1);
}

.up-danger-icon {
  font-size: 18px;
}

.up-danger-btn span:last-child {
  font-size: 15px;
  color: var(--text-danger, #ef4444);
}

/* ── Mobile Optimizations ──────────────────────────────────────────────── */
@media (max-width: 480px) {
  .up-avatar-ring {
    width: 100px;
    height: 100px;
  }

  .up-avatar-placeholder {
    font-size: 40px;
  }

  .up-name {
    font-size: 22px;
  }

  .up-actions {
    gap: 12px;
    padding: 12px 16px 20px;
  }

  .up-action-icon {
    width: 52px;
    height: 52px;
  }

  .up-action-icon svg {
    width: 22px;
    height: 22px;
  }
}

/* ── Safe area for notched devices ─────────────────────────────────────── */
@supports (padding-top: env(safe-area-inset-top)) {
  .up-modal {
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
  }
}

/* ── Reduced motion ────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .up-overlay,
  .up-modal,
  .up-action-btn,
  .up-action-icon,
  .up-avatar-ring {
    transition: none;
    animation: none;
  }
}

/* ── Dark theme adjustments (already dark, but explicit) ──────────────── */
[data-theme="dark"] .up-section {
  background: rgba(255, 255, 255, 0.04);
}

[data-theme="light"] .up-overlay {
  background: rgba(0, 0, 0, 0.4);
}

[data-theme="light"] .up-modal {
  background: #f5f5f5;
}

[data-theme="light"] .up-section {
  background: rgba(0, 0, 0, 0.04);
}

[data-theme="light"] .up-action-icon {
  background: rgba(0, 0, 0, 0.06);
  border-color: rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .up-close {
  background: rgba(0, 0, 0, 0.2);
}

/* ══════════════════════════════════════════════════════════════════════════
   v0.9.7 — Coming Soon Modal
   ══════════════════════════════════════════════════════════════════════════ */

#up-coming-soon {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

#up-coming-soon.visible {
  opacity: 1;
}

.up-cs-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
}

.up-cs-modal {
  background: rgba(30, 25, 50, 0.95);
  border-radius: 20px;
  padding: 32px 28px;
  max-width: 320px;
  width: 90%;
  text-align: center;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.up-cs-icon {
  font-size: 48px;
  margin-bottom: 16px;
}
.up-cs-icon svg{width:46px;height:46px;fill:none;stroke:currentColor}

.up-cs-title {
  font-size: 20px;
  font-weight: 600;
  color: #fff;
  margin-bottom: 12px;
}

.up-cs-message {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.7);
  line-height: 1.5;
  margin-bottom: 24px;
}

.up-cs-btn {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, #00d4ff 0%, #7c3aed 100%);
  border: none;
  border-radius: 12px;
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s, opacity 0.2s;
}

.up-cs-btn:hover {
  transform: scale(1.02);
}

.up-cs-btn:active {
  transform: scale(0.98);
  opacity: 0.9;
}

/* ══════════════════════════════════════════════════════════════════════════
   v0.9.7 — Gallery Modal
   ══════════════════════════════════════════════════════════════════════════ */

#up-gallery {
  position: fixed;
  inset: 0;
  z-index: 9500;
  opacity: 0;
  transition: opacity 0.3s ease;
}

#up-gallery.visible {
  opacity: 1;
}

.up-gallery-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.up-gallery-modal {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  max-width: 480px;
  background: var(--bg-primary, #0d0b1a);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1);
}

#up-gallery.visible .up-gallery-modal {
  transform: translateX(0);
}

.up-gallery-header {
  padding: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}

.up-gallery-back {
  position: absolute;
  left: 12px;
  top: 12px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.up-gallery-back svg {
  width: 20px;
  height: 20px;
}

.up-gallery-title {
  font-size: 18px;
  font-weight: 600;
  color: #fff;
  margin: 0;
}

.up-gallery-subtitle {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.5);
  margin-top: 4px;
}

.up-gallery-tabs {
  display: flex;
  padding: 12px;
  gap: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.up-gallery-tab {
  flex: 1;
  padding: 10px 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid transparent;
  border-radius: 10px;
  color: rgba(255, 255, 255, 0.6);
  font-size: 14px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  transition: all 0.2s ease;
}

.up-gallery-tab:hover {
  background: rgba(255, 255, 255, 0.08);
}

.up-gallery-tab.active {
  background: rgba(0, 212, 255, 0.15);
  border-color: rgba(0, 212, 255, 0.3);
  color: #00d4ff;
}

.up-gallery-count {
  font-size: 11px;
  opacity: 0.7;
}

.up-gallery-content {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  -webkit-overflow-scrolling: touch;
}
.up-gallery-more{display:block;margin:14px auto 4px;padding:10px 18px;border:1px solid rgba(245,130,32,.35);border-radius:10px;background:rgba(245,130,32,.1);color:var(--accent-orange,#f58220);cursor:pointer}
.up-gallery-media-download{position:absolute;right:6px;bottom:6px;display:grid;width:28px;height:28px;place-items:center;border-radius:50%;background:rgba(0,0,0,.62);color:#fff;opacity:0;transition:opacity .15s}
.up-gallery-item:hover .up-gallery-media-download,.up-gallery-media-download:focus{opacity:1}
.up-gallery-media-download svg,.up-gallery-file-download svg,.up-gallery-voice-play svg{width:17px;height:17px}
@media(max-width:768px){.up-gallery-media-download{opacity:1}}

.up-gallery-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 200px;
  gap: 12px;
  color: rgba(255, 255, 255, 0.5);
}

.up-gallery-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid rgba(255, 255, 255, 0.1);
  border-top-color: #00d4ff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.up-gallery-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 200px;
  gap: 12px;
  color: rgba(255, 255, 255, 0.4);
}

.up-gallery-empty-icon {
  font-size: 48px;
  opacity: 0.5;
}

/* Grid for photos/videos */
.up-gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
}

.up-gallery-item {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 4px;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.05);
}

.up-gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.2s;
}

.up-gallery-item:hover img {
  transform: scale(1.05);
}

.up-gallery-duration {
  position: absolute;
  bottom: 4px;
  right: 4px;
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 4px;
}

.up-gallery-circle-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 16px;
  height: 16px;
  background: rgba(0, 212, 255, 0.8);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 8px;
  color: #fff;
}

/* List for voice/files */
.up-gallery-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.up-gallery-voice-item,
.up-gallery-file-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.2s;
  text-decoration: none;
  color: inherit;
}

.up-gallery-voice-item:hover,
.up-gallery-file-item:hover {
  background: rgba(255, 255, 255, 0.08);
}

.up-gallery-voice-play {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #00d4ff 0%, #7c3aed 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 14px;
  flex-shrink: 0;
}

.up-gallery-voice-info,
.up-gallery-file-info {
  flex: 1;
  min-width: 0;
}

.up-gallery-voice-sender,
.up-gallery-file-name {
  font-size: 14px;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.up-gallery-voice-meta,
.up-gallery-file-meta {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.5);
  margin-top: 2px;
}

.up-gallery-file-icon {
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.up-gallery-file-download {
  font-size: 20px;
  opacity: 0.6;
}

/* Mobile adjustments */
@media (max-width: 480px) {
  .up-gallery-modal {
    max-width: 100%;
  }
  
  .up-gallery-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 2px;
  }
}
