/* =================================================================
   Oost Profile Panel - Session 59
   ================================================================= */

/* -- Overlay -- */
.oost-profile-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
}
.oost-profile-panel.open ~ .oost-profile-overlay,
.oost-profile-panel.open + .oost-profile-overlay {
  opacity: 1;
  visibility: visible;
}

/* -- Panel -- */
.oost-profile-panel {
  position: fixed;
  top: 0;
  right: -420px;
  width: 400px;
  max-width: 92vw;
  height: 100vh;
  z-index: 1001;
  background: #111028;
  border-left: 1px solid rgba(255, 215, 0, 0.15);
  display: flex;
  flex-direction: column;
  transition: right 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}
.oost-profile-panel.open {
  right: 0;
}

/* -- Header -- */
.oost-profile-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}
.oost-profile-header h3 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  color: #f0f0f0;
}
.oost-profile-close {
  background: none;
  border: none;
  color: #888;
  font-size: 1.6rem;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
  transition: color 0.2s;
}
.oost-profile-close:hover {
  color: #fff;
}

/* -- Scrollable content -- */
#oost-profile-content {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px 100px;
}

/* -- Sections -- */
.profile-section {
  margin-bottom: 24px;
}
.profile-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: #FFD700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}
.profile-hint {
  font-size: 0.78rem;
  color: #777;
  margin: 6px 0 0;
  line-height: 1.4;
}

/* -- Text inputs -- */
.profile-textarea {
  width: 100%;
  min-height: 64px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: #e0e0e0;
  font-family: inherit;
  font-size: 0.9rem;
  padding: 10px 12px;
  resize: vertical;
  transition: border-color 0.2s;
  box-sizing: border-box;
}
.profile-textarea:focus {
  outline: none;
  border-color: rgba(255, 215, 0, 0.4);
}
.profile-input {
  width: 80px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: #e0e0e0;
  font-family: inherit;
  font-size: 0.9rem;
  padding: 8px 12px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  transition: border-color 0.2s;
}
.profile-input:focus {
  outline: none;
  border-color: rgba(255, 215, 0, 0.4);
}

/* -- Chips -- */
.profile-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.profile-chip {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  color: #b0b0c0;
  transition: all 0.2s;
}
.profile-chip:hover {
  border-color: rgba(255, 215, 0, 0.3);
  color: #e0e0e0;
}
.profile-chip.active {
  background: rgba(255, 215, 0, 0.15);
  border-color: #FFD700;
  color: #FFD700;
  font-weight: 600;
}

/* -- Toggle switch -- */
.profile-toggle-section {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}
.profile-toggle-section .profile-label {
  flex: 1;
  min-width: 150px;
  margin-bottom: 0;
}
.profile-toggle-section .profile-hint {
  width: 100%;
}
.profile-toggle {
  position: relative;
  width: 48px;
  height: 26px;
  flex-shrink: 0;
}
.profile-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}
.profile-toggle-slider {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 26px;
  cursor: pointer;
  transition: background 0.3s;
}
.profile-toggle-slider::before {
  content: "";
  position: absolute;
  width: 20px;
  height: 20px;
  left: 3px;
  bottom: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.3s;
}
.profile-toggle input:checked + .profile-toggle-slider {
  background: #FFD700;
}
.profile-toggle input:checked + .profile-toggle-slider::before {
  transform: translateX(22px);
}

/* -- Footer with save button -- */
.oost-profile-footer {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 16px 24px;
  background: rgba(17, 16, 40, 0.95);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(8px);
}
#oost-profile-save-btn {
  width: 100%;
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  background: #FFD700;
  color: #0c0a1f;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.2s, background 0.2s;
}
#oost-profile-save-btn:hover:not(:disabled) {
  opacity: 0.9;
}
#oost-profile-save-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
#oost-profile-save-btn.saving {
  background: #888;
  color: #fff;
}
#oost-profile-save-btn.saved {
  background: #22c55e;
  color: #fff;
}
#oost-profile-save-btn.error {
  background: #ef4444;
  color: #fff;
}

/* -- User dropdown menu (replaces simple sign-out button) -- */
.oost-user-menu {
  position: relative;
}
.oost-user-trigger {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 8px;
  transition: background 0.2s;
  border: none;
  background: none;
  color: inherit;
  font-family: inherit;
}
.oost-user-trigger:hover {
  background: rgba(255, 255, 255, 0.06);
}
.oost-user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 215, 0, 0.2);
  color: #FFD700;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  overflow: hidden;
  flex-shrink: 0;
}
.oost-user-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}
.oost-user-chevron {
  font-size: 0.6rem;
  color: #888;
  transition: transform 0.2s;
}
.oost-user-menu.open .oost-user-chevron {
  transform: rotate(180deg);
}

.oost-user-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 200px;
  background: #1a1838;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 6px 0;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: all 0.2s;
  z-index: 500;
}
.oost-user-menu.open .oost-user-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.oost-user-dropdown-email {
  padding: 10px 16px;
  font-size: 0.78rem;
  color: #888;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.oost-user-dropdown-item {
  display: block;
  width: 100%;
  padding: 10px 16px;
  background: none;
  border: none;
  color: #d0d0dd;
  font-family: inherit;
  font-size: 0.88rem;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s;
}
.oost-user-dropdown-item:hover {
  background: rgba(255, 255, 255, 0.06);
}
.oost-user-dropdown-item.danger {
  color: #ef4444;
}
.oost-user-dropdown-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.06);
  margin: 4px 0;
}

/* -- Subscription tier banner -- */
.profile-tier-banner {
  padding: 14px 16px;
  border-radius: 10px;
  margin-bottom: 20px;
}
.profile-tier-banner.tier-free {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.profile-tier-banner.tier-scout {
  background: rgba(255, 215, 0, 0.08);
  border: 1px solid rgba(255, 215, 0, 0.2);
}
.profile-tier-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.profile-tier-label {
  font-weight: 700;
  font-size: 0.95rem;
  color: #e0e0e0;
}
.tier-scout .profile-tier-label {
  color: #FFD700;
}
.profile-upgrade-btn {
  padding: 6px 16px;
  border: none;
  border-radius: 6px;
  background: #FFD700;
  color: #0c0a1f;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.2s;
  flex-shrink: 0;
}
.profile-upgrade-btn:hover {
  opacity: 0.85;
}

/* -- Meta / timestamp -- */
.profile-meta {
  margin-bottom: 16px;
}
.profile-meta-text {
  font-size: 0.78rem;
  color: #666;
  font-style: italic;
}

/* -- Search Again button -- */
.oost-search-again-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 20px;
  padding: 10px 20px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  color: #c0c0cc;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}
.oost-search-again-btn:hover {
  border-color: rgba(255, 215, 0, 0.3);
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

/* -- Responsive -- */
@media (max-width: 480px) {
  .oost-profile-panel {
    width: 100vw;
    max-width: 100vw;
    right: -100vw;
  }
}
