/* ==============================================================================
   UZKIRO / SHADOW: ADVANCED POWER TOOLS & FUNCTIONAL HUBS CSS
   Open-Design, Onlook, Awesome-REA, WhisperLiveKit, Aiogram, and Polar Engines
   ============================================================================== */

/* Base container for all power tool panels (with proper hidden support) */
.power-tools-panel[hidden],
:root[data-theme] .power-tools-panel[hidden],
section.power-tools-panel[hidden] {
  display: none !important;
}

.power-tools-panel:not([hidden]),
:root[data-theme] .power-tools-panel:not([hidden]),
section.power-tools-panel:not([hidden]) {
  display: flex !important;
  flex-direction: column !important;
  gap: 20px !important;
  width: 100% !important;
  max-width: 1280px !important;
  margin: 0 auto !important;
  min-width: 0 !important;
  padding: 10px 0 60px !important;
  animation: ptFadeIn 0.24s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

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

.pt-hero-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  padding: 22px 28px;
  border-radius: 20px;
  background: rgba(14, 18, 28, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
}

.pt-hero-info h2 {
  margin: 0 0 6px 0;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #f8fafc;
  display: flex;
  align-items: center;
  gap: 12px;
}

.pt-hero-info p {
  margin: 0;
  font-size: 13.5px;
  color: #94a3b8;
  max-width: 680px;
  line-height: 1.5;
}

.pt-badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.3);
  color: #38bdf8;
  box-shadow: 0 0 15px rgba(56, 189, 248, 0.15);
}

.pt-badge-pill i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 8px currentColor;
}

/* ==============================================================================
   1. API & REVERSE ENGINEERING LAB (Awesome-REA)
   ============================================================================== */
.api-lab-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: 20px;
}

@media (max-width: 1080px) {
  .api-lab-grid { grid-template-columns: 1fr; }
}

.api-request-card, .api-response-card, .pt-glass-card {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  padding: 22px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(20px);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.api-url-bar {
  display: flex;
  gap: 10px;
  align-items: center;
}

.method-select {
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 13.5px;
  font-weight: 700;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(30, 41, 59, 0.9);
  color: #38bdf8;
  cursor: pointer;
  outline: none;
}

.api-input-url {
  flex: 1;
  padding: 11px 16px;
  border-radius: 12px;
  background: rgba(11, 15, 25, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #f1f5f9;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 13.5px;
  outline: none;
  transition: border-color 0.2s ease;
}

.api-input-url:focus {
  border-color: #38bdf8;
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.2);
}

.btn-send-req {
  padding: 11px 22px;
  border-radius: 12px;
  font-size: 13.5px;
  font-weight: 650;
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  border: 1px solid rgba(56, 189, 248, 0.4);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-send-req:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(2, 132, 199, 0.4);
}

.api-presets-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.api-presets-label {
  font-size: 12px;
  color: #94a3b8;
  font-weight: 550;
}

.api-preset-chip {
  padding: 5px 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 11.5px;
  font-family: ui-monospace, monospace;
  color: #cbd5e1;
  cursor: pointer;
  transition: all 0.15s ease;
}

.api-preset-chip:hover {
  background: rgba(56, 189, 248, 0.15);
  border-color: rgba(56, 189, 248, 0.35);
  color: #38bdf8;
}

.api-tabs-header {
  display: flex;
  gap: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 8px;
}

.api-tab-btn {
  background: transparent;
  border: 0;
  color: #94a3b8;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 8px;
  position: relative;
}

.api-tab-btn.active {
  color: #38bdf8;
}

.api-tab-btn.active::after {
  content: '';
  position: absolute;
  bottom: -9px;
  left: 0;
  right: 0;
  height: 2px;
  background: #38bdf8;
  border-radius: 2px;
}

.api-json-editor {
  width: 100%;
  height: 180px;
  padding: 12px;
  border-radius: 12px;
  background: rgba(11, 15, 25, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #f1f5f9;
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 12.5px;
  line-height: 1.5;
  resize: vertical;
  outline: none;
}

.api-json-editor:focus {
  border-color: #38bdf8;
}

.api-response-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 12px;
}

.api-status-badge {
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  font-family: ui-monospace, monospace;
}

.api-status-badge.status-200 { background: rgba(16, 185, 129, 0.15); color: #10b981; border: 1px solid rgba(16, 185, 129, 0.3); }
.api-status-badge.status-400 { background: rgba(245, 158, 11, 0.15); color: #f59e0b; border: 1px solid rgba(245, 158, 11, 0.3); }
.api-status-badge.status-500 { background: rgba(239, 68, 68, 0.15); color: #ef4444; border: 1px solid rgba(239, 68, 68, 0.3); }

.api-response-viewer {
  background: rgba(11, 15, 25, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 14px;
  min-height: 240px;
  max-height: 380px;
  overflow: auto;
  font-family: ui-monospace, Consolas, monospace;
  font-size: 12.5px;
  color: #e2e8f0;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-all;
}

/* ==============================================================================
   2. AI DESIGN & VISUAL CANVAS STUDIO (Open-Design & Onlook)
   ============================================================================== */
.design-studio-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.4fr);
  gap: 20px;
}

@media (max-width: 1080px) {
  .design-studio-grid { grid-template-columns: 1fr; }
}

.theme-presets-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
}

.theme-card-option {
  padding: 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.theme-card-option:hover, .theme-card-option.active {
  background: rgba(56, 189, 248, 0.1);
  border-color: rgba(56, 189, 248, 0.4);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(56, 189, 248, 0.15);
}

.theme-color-dots {
  display: flex;
  gap: 6px;
}

.theme-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.token-slider-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.token-slider-head {
  display: flex;
  justify-content: space-between;
  font-size: 12.5px;
  color: #cbd5e1;
}

.token-slider-head span:last-child {
  font-family: ui-monospace, monospace;
  color: #38bdf8;
  font-weight: 600;
}

.pt-slider {
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.1);
  outline: none;
  cursor: pointer;
  accent-color: #38bdf8;
}

.component-stage {
  border: 1px dashed rgba(255, 255, 255, 0.15);
  border-radius: 16px;
  padding: 24px;
  background: rgba(11, 15, 25, 0.6);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.component-stage-row {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

/* ==============================================================================
   3. WHISPER LIVE AUDIO & VOICE STUDIO (WhisperLiveKit)
   ============================================================================== */
.whisper-studio-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.3fr);
  gap: 20px;
}

@media (max-width: 1080px) {
  .whisper-studio-grid { grid-template-columns: 1fr; }
}

.mic-recorder-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 30px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.8) 0%, rgba(10, 15, 28, 0.95) 100%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  text-align: center;
}

.mic-pulse-btn {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  border: 2px solid rgba(56, 189, 248, 0.5);
  color: #fff;
  font-size: 28px;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: all 0.25s ease;
  box-shadow: 0 0 25px rgba(2, 132, 199, 0.4);
}

.mic-pulse-btn:hover {
  transform: scale(1.06);
  box-shadow: 0 0 35px rgba(56, 189, 248, 0.6);
}

.mic-pulse-btn.is-recording {
  background: linear-gradient(135deg, #dc2626 0%, #991b1b 100%);
  border-color: #ef4444;
  animation: micPulseAnim 1.2s infinite;
}

@keyframes micPulseAnim {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }
  70% { transform: scale(1.08); box-shadow: 0 0 0 16px rgba(239, 68, 68, 0); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

.audio-waveform-canvas {
  width: 100%;
  height: 70px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.transcript-output-box {
  width: 100%;
  height: 180px;
  padding: 14px;
  border-radius: 14px;
  background: rgba(11, 15, 25, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #f8fafc;
  font-size: 14px;
  line-height: 1.6;
  resize: vertical;
  outline: none;
}

.transcript-output-box:focus {
  border-color: #38bdf8;
}

/* ==============================================================================
   4. TELEGRAM BOT & AIOGRAM 3 STUDIO (Aiogram)
   ============================================================================== */
.bot-studio-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(320px, 380px);
  gap: 24px;
}

@media (max-width: 1080px) {
  .bot-studio-grid { grid-template-columns: 1fr; }
}

.bot-commands-table {
  width: 100%;
  border-collapse: collapse;
}

.bot-commands-table th {
  text-align: left;
  padding: 10px 12px;
  font-size: 12px;
  color: #94a3b8;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.bot-commands-table td {
  padding: 12px;
  font-size: 13px;
  color: #e2e8f0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.bot-cmd-tag {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.25);
  color: #38bdf8;
  font-family: ui-monospace, monospace;
  font-weight: 600;
}

/* Realistic Telegram Phone Preview */
.telegram-phone-frame {
  width: 100%;
  max-width: 360px;
  margin: 0 auto;
  border-radius: 36px;
  background: #0f172a;
  border: 10px solid #1e293b;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.1);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.tg-phone-header {
  padding: 14px 18px;
  background: #1e293b;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.tg-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0ea5e9, #2563eb);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 14px;
}

.tg-phone-body {
  padding: 16px;
  background: #0b1120;
  min-height: 360px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  justify-content: flex-end;
}

.tg-bubble {
  padding: 12px 14px;
  border-radius: 16px 16px 16px 4px;
  background: #1e293b;
  color: #f1f5f9;
  font-size: 13px;
  line-height: 1.5;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.tg-inline-keyboard {
  display: grid;
  gap: 6px;
}

.tg-kb-btn {
  padding: 9px 12px;
  border-radius: 10px;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.3);
  color: #38bdf8;
  font-size: 12.5px;
  font-weight: 600;
  text-align: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.tg-kb-btn:hover {
  background: rgba(56, 189, 248, 0.25);
  transform: translateY(-1px);
}

/* ==============================================================================
   5. POLAR.SH MONETIZATION & PAYWALL HUB (Polar)
   ============================================================================== */
.monetization-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
}

.pricing-card {
  border-radius: 20px;
  padding: 26px;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  flex-direction: column;
  gap: 18px;
  position: relative;
  transition: all 0.25s ease;
}

.pricing-card:hover {
  transform: translateY(-4px);
  border-color: rgba(56, 189, 248, 0.4);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5), 0 0 25px rgba(56, 189, 248, 0.15);
}

.pricing-card.featured {
  border-color: #38bdf8;
  background: linear-gradient(180deg, rgba(14, 165, 233, 0.12) 0%, rgba(15, 23, 42, 0.9) 100%);
  box-shadow: 0 16px 40px rgba(2, 132, 199, 0.25);
}

.pricing-featured-badge {
  position: absolute;
  top: -12px;
  right: 24px;
  padding: 4px 12px;
  border-radius: 999px;
  background: linear-gradient(135deg, #0ea5e9, #38bdf8);
  color: #0b1120;
  font-size: 11px;
  font-weight: 750;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.pricing-tier-name {
  font-size: 20px;
  font-weight: 700;
  color: #f8fafc;
}

.price-tag {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.price-val {
  font-size: 32px;
  font-weight: 800;
  color: #f8fafc;
  letter-spacing: -0.03em;
}

.price-period {
  font-size: 13px;
  color: #94a3b8;
}

.pricing-feature-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pricing-feature-list li {
  font-size: 13px;
  color: #cbd5e1;
  display: flex;
  align-items: center;
  gap: 10px;
}

.pricing-feature-list li i {
  color: #10b981;
  font-style: normal;
  font-weight: 700;
}

.btn-pricing-action {
  width: 100%;
  padding: 12px;
  border-radius: 12px;
  font-size: 13.5px;
  font-weight: 650;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.05);
  color: #f8fafc;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
}

.btn-pricing-action:hover {
  background: rgba(255, 255, 255, 0.12);
}

.btn-pricing-action.primary {
  background: linear-gradient(135deg, #0284c7 0%, #0ea5e9 100%);
  border-color: #38bdf8;
  color: #fff;
  box-shadow: 0 4px 16px rgba(2, 132, 199, 0.35);
}

.btn-pricing-action.primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(2, 132, 199, 0.5);
}

/* ==========================================================================
   Role-Based Access Control (RBAC): Admin (Owner) vs Member (Guest/Client)
   ========================================================================== */
html[data-owner="false"] [data-admin-only="true"],
html[data-role="member"] [data-admin-only="true"],
[data-owner="false"] .admin-only,
[data-role="member"] .admin-only,
html[data-owner="false"] [data-role-required="admin"],
html[data-role="member"] [data-role-required="admin"] {
  display: none !important;
}

html:not([data-owner="false"]) [data-member-only="true"],
html[data-role="admin"] [data-member-only="true"],
[data-owner="true"] .member-only,
[data-role="admin"] .member-only,
html:not([data-role="member"]) [data-role-required="member"] {
  display: none !important;
}

/* User Role Badges & Controls */
.role-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.02em;
  margin-top: 4px;
}
.role-badge.admin {
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.35);
  color: #fbbf24;
}
.role-badge.member {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: #34d399;
}

.role-switcher-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #cbd5e1;
  font-size: 11px;
  border-radius: 6px;
  padding: 3px 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-top: 4px;
  display: inline-block;
}
.role-switcher-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}
