/* ============================================================
   WSocks Mini App — Component Styles (shared across pages)
   ============================================================ */

/* === Modal / Dialog === */
dialog {
  border: none;
  border-radius: var(--radius);
  padding: 0;
  background: var(--card);
  color: var(--text);
  box-shadow: 0 48px 90px rgba(0, 0, 0, 0.45);
  width: min(420px, 92vw);
  backdrop-filter: blur(var(--blur));
  animation: modalFadeIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

dialog::backdrop {
  background: rgba(3, 6, 16, 0.65);
  backdrop-filter: blur(10px);
  animation: backdropFadeIn 0.3s ease-out;
}

@keyframes modalFadeIn {
  from {
    opacity: 0;
    transform: scale(0.9) translateY(-20px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

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

.modal-content {
  display: flex;
  flex-direction: column;
  padding: 24px;
  gap: 16px;
}

.modal-header h3 {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
}

.modal-header span {
  color: rgba(255, 255, 255, 0.7);
  font-size: 14px;
}

.modal-close {
  background: var(--btn-bg);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) - 4px);
  padding: 12px;
  color: var(--text);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s ease;
  margin-top: 8px;
}

.modal-close:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  background: var(--card-hover);
}

/* === Tabs === */
.tabs-header {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  border-bottom: 2px solid var(--group-bg);
}

.tab-btn {
  flex: 1;
  background: transparent;
  border: none;
  padding: 12px;
  color: rgba(255, 255, 255, 0.6);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all 0.3s ease;
  position: relative;
}

.tab-btn::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transition: transform 0.3s ease;
}

.tab-btn:hover {
  color: var(--text);
}

.tab-btn.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.tab-btn.active::after {
  transform: scaleX(1);
}

.tabs-content {
  min-height: 220px;
  position: relative;
  overflow: hidden;
}

.tab-panel {
  display: none;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.tab-panel.active {
  display: block;
  opacity: 1;
  transform: translateY(0);
  animation: tabFadeIn 0.4s ease-out;
}

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

.tab-content-inner {
  padding: 8px 0;
  animation: contentFadeIn 0.4s ease-out 0.1s both;
}

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

.tab-content-inner h3 {
  margin: 0 0 12px;
  font-size: 20px;
  font-weight: 700;
}

.tab-content-inner p {
  margin: 0 0 16px;
  color: rgba(255, 255, 255, 0.7);
  line-height: 1.6;
}

/* === Badge === */
.badge {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 10;
  padding: 4px 10px;
  border-radius: 999px;
  background: #ffffff;
  color: #000000;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
}

/* === Copy button === */
.copy-btn {
  background: var(--accent);
  border: 1px solid var(--accent);
  border-radius: calc(var(--radius) - 4px);
  padding: 12px 20px;
  color: var(--bg);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s ease;
  box-shadow: 0 4px 12px rgba(255, 255, 255, 0.1);
}

.copy-btn:hover {
  transform: translateY(-2px);
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  box-shadow: 0 6px 16px rgba(255, 255, 255, 0.15);
}

/* === Button base === */
button {
  font-family: inherit;
}

.btn-secondary,
.btn-primary {
  border: none;
  border-radius: 999px;
  padding: 12px 22px;
  font-size: 15px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: 600;
}

.btn-secondary {
  background: var(--btn-bg);
  color: var(--text);
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0,0,0,0.3);
}

.btn-primary {
  background: var(--text);
  color: var(--bg);
  box-shadow: 0 4px 12px rgba(255, 255, 255, 0.12);
}

.btn-primary:hover {
  transform: translateY(-2px);
  background: var(--accent-hover);
  box-shadow: 0 6px 16px rgba(255, 255, 255, 0.2);
}

/* === Large action button (.btn) === */
.actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.btn {
  background: var(--btn-bg);
  border: none;
  border-radius: var(--radius);
  color: var(--text);
  font-size: 16px;
  padding: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  transition: all 0.25s ease;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: rgba(255,255,255,0.12);
  transition: left 0.4s ease;
}

.btn:hover::before {
  left: 0;
}

.btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}

.btn:active {
  transform: scale(0.96);
  box-shadow: 0 4px 14px rgba(0,0,0,0.2);
}

.btn-accent {
  background: linear-gradient(135deg, #ffffff, #666666, #ffffff);
  background-size: 200% 200%;
  animation: gradientShift 5s ease infinite;
  color: #000000;
  font-weight: 700;
  border: 1px solid #ffffff;
}

@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* === Light theme — component overrides === */
.light dialog {
  background: #ffffff;
  box-shadow: 0 48px 90px rgba(0, 0, 0, 0.15);
  border-color: #e0e0e6;
}

.light dialog::backdrop {
  background: rgba(0, 0, 0, 0.3);
}

.light .modal-header h3 {
  color: var(--text);
}

.light .modal-header span {
  color: rgba(26, 26, 26, 0.7);
}

.light .modal-close {
  background: rgba(0, 0, 0, 0.04);
  border-color: #e0e0e6;
}

.light .tab-btn {
  color: rgba(26, 26, 26, 0.6);
}

.light .tab-btn:hover {
  color: var(--text);
}

.light .tabs-header {
  border-bottom-color: rgba(0, 0, 0, 0.1);
}

.light .tab-btn.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.light .tab-content-inner p {
  color: rgba(26, 26, 26, 0.7);
}

.light .badge {
  background: #000000;
  color: #ffffff;
}

.light .copy-btn {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--bg);
}

.light .copy-btn:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

.light .btn {
  color: var(--text);
}

.light .btn-secondary {
  background: var(--btn-bg);
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.light .btn-secondary:hover {
  background: rgba(0, 0, 0, 0.12);
  box-shadow: 0 6px 16px rgba(0,0,0,0.15);
}

.light .btn-primary {
  background: var(--text);
  color: var(--bg);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.light .btn-primary:hover {
  background: var(--accent-hover);
  box-shadow: 0 6px 16px rgba(0,0,0,0.2);
}

.light .btn-accent {
  background: linear-gradient(135deg, #000000, #888888, #000000);
  color: #ffffff;
  border-color: #000000;
}
