/* Script View Page - Modern Enhanced Design */

/* ==========================
   BASE LAYOUT & WRAPPER
   ========================== */

.script-view-page {
  background: linear-gradient(180deg, #0a0e17 0%, #0f1419 50%, #1a1f2e 100%);
  min-height: 100vh;
  padding: 0 0 80px 0;
  position: relative;
}

.script-view-page::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 400px;
  background: radial-gradient(ellipse at top, rgba(102, 126, 234, 0.15) 0%, transparent 60%);
  pointer-events: none;
}

.script-view-page .container {
  position: relative;
  z-index: 1;
}

/* ==========================
   BREADCRUMB
   ========================== */

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 24px 0;
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.6);
  padding: 16px 24px;
  background: rgba(20, 25, 35, 0.6);
  backdrop-filter: blur(10px);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.breadcrumb a {
  color: rgba(255, 255, 255, 0.7);
  transition: all 0.3s ease;
  text-decoration: none;
  position: relative;
}

.breadcrumb a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, #667eea, #764ba2);
  transition: width 0.3s ease;
}

.breadcrumb a:hover {
  color: #667eea;
}

.breadcrumb a:hover::after {
  width: 100%;
}

.breadcrumb i {
  font-size: 0.625rem;
  opacity: 0.5;
}

/* ==========================
   MAIN LAYOUT
   ========================== */

.script-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 32px;
  margin-top: 32px;
}

@media (max-width: 1024px) {
  .script-layout {
    grid-template-columns: 1fr;
  }
}

/* ==========================
   HEADER CARD - ENHANCED
   ========================== */

.script-header-card {
  background: linear-gradient(135deg, rgba(20, 25, 35, 0.9) 0%, rgba(15, 20, 30, 0.8) 100%);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  padding: 40px;
  margin-bottom: 24px;
  box-shadow:
    0 20px 60px rgba(0, 0, 0, 0.3),
    0 0 100px rgba(102, 126, 234, 0.1);
  position: relative;
  overflow: hidden;
}

.script-header-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #667eea, #764ba2, #f093fb);
  background-size: 200% 100%;
  animation: gradientShift 3s ease infinite;
}

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

.script-header-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 28px;
  flex-wrap: wrap;
  gap: 16px;
}

.script-badges-large {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* ==========================
   BADGES - ENHANCED
   ========================== */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  border-radius: 24px;
  font-size: 0.875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  transition: all 0.3s ease;
  animation: fadeInUp 0.5s ease forwards;
  opacity: 0;
}

.badge:nth-child(1) { animation-delay: 0.1s; }
.badge:nth-child(2) { animation-delay: 0.2s; }
.badge:nth-child(3) { animation-delay: 0.3s; }
.badge:nth-child(4) { animation-delay: 0.4s; }

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

.badge:hover {
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.badge i {
  font-size: 0.75rem;
}

.badge-verified {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
}

.badge-featured {
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  color: #fff;
}

.badge-mobile {
  background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
  color: #fff;
}

.badge-key {
  background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
  color: #fff;
}

.badge-paid {
  background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
  color: #fff;
}

.badge-panda {
  background: linear-gradient(135deg, #4ade80 0%, #22c55e 100%);
  color: #fff;
  font-weight: 600;
}

.badge-panda-vss {
  background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
  color: #fff;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.badge-panda-vss i {
  font-size: 0.85em;
}

/* ==========================
   OWNER ACTIONS
   ========================== */

.script-actions-owner {
  display: flex;
  gap: 10px;
}

.btn-sm {
  padding: 10px 20px;
  font-size: 0.875rem;
  border-radius: 10px;
  font-weight: 600;
  transition: all 0.3s ease;
}

.btn-sm:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

/* ==========================
   TITLE & DESCRIPTION
   ========================== */

.script-header-title {
  font-size: 2.75rem;
  font-weight: 800;
  color: #fff;
  margin-bottom: 16px;
  line-height: 1.2;
  background: linear-gradient(135deg, #fff 0%, #e2e8f0 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: fadeIn 0.6s ease;
}

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

.script-header-description {
  color: rgba(255, 255, 255, 0.85);
  line-height: 1.7;
  margin-bottom: 32px;
  font-size: 1.05rem;
  animation: fadeIn 0.8s ease;
}

/* ==========================
   META GRID - ENHANCED
   ========================== */

.script-meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
  padding: 24px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.meta-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  transition: transform 0.3s ease;
}

.meta-item:hover {
  transform: translateX(4px);
}

.meta-item i {
  color: #667eea;
  margin-top: 4px;
  font-size: 1.1rem;
}

.meta-item > div {
  flex: 1;
}

.meta-label {
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.75rem;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
}

.meta-value {
  color: #fff;
  font-weight: 600;
  font-size: 1rem;
}

.meta-value a {
  color: #fff;
  text-decoration: none;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.meta-value a:hover {
  color: #667eea;
}

.verified-icon {
  color: #667eea;
  font-size: 0.875rem;
}

/* ==========================
   STATS - LARGE DISPLAY
   ========================== */

.script-stats-large {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

.stat-large {
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.25) 0%, rgba(118, 75, 162, 0.25) 100%);
  padding: 18px;
  border-radius: 12px;
  border: 2px solid rgba(139, 156, 255, 0.5);
  text-align: center;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.stat-large:hover {
  transform: translateY(-3px);
  border-color: rgba(139, 156, 255, 0.8);
  box-shadow: 0 8px 24px rgba(102, 126, 234, 0.4);
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.3) 0%, rgba(118, 75, 162, 0.3) 100%);
}

.stat-large .stat-icon i {
  font-size: 1.75rem;
  color: #a8b7ff;
  filter: brightness(1.3) drop-shadow(0 2px 6px rgba(139, 156, 255, 0.4));
}

.stat-large .stat-info {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.stat-value {
  font-size: 2.25rem;
  font-weight: 800;
  color: #ffffff;
  line-height: 1;
  text-shadow: 0 3px 10px rgba(0, 0, 0, 0.5), 0 0 20px rgba(139, 156, 255, 0.3);
  filter: brightness(1.2);
}

.stat-label {
  color: #d4dcff;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  font-weight: 600;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* ==========================
   TAGS - ENHANCED
   ========================== */

.script-tags-large {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.tag {
  padding: 8px 18px;
  border-radius: 20px;
  font-size: 0.875rem;
  font-weight: 600;
  background: linear-gradient(135deg, var(--tag-color, #667eea) 0%, color-mix(in srgb, var(--tag-color, #667eea) 80%, black) 100%);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: all 0.3s ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.tag:hover {
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
  filter: brightness(1.1);
}

/* ==========================
   CODE SECTION - ENHANCED
   ========================== */

.code-section-card {
  background: linear-gradient(135deg, rgba(20, 25, 35, 0.95) 0%, rgba(15, 20, 30, 0.9) 100%);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  overflow: hidden;
  box-shadow:
    0 20px 60px rgba(0, 0, 0, 0.3),
    0 0 100px rgba(102, 126, 234, 0.05);
  margin-bottom: 24px;
}

.code-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 32px;
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.code-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0;
}

.code-title i {
  color: #667eea;
  font-size: 1.3rem;
}

.code-actions {
  display: flex;
  gap: 12px;
}

.code-container {
  position: relative;
  background: #1a1e2e;
  padding: 0;
}

.code-container pre {
  margin: 0;
  padding: 32px;
  max-height: 600px;
  overflow: auto;
  background: transparent;
}

.code-container pre code {
  font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
  font-size: 0.9rem;
  line-height: 1.7;
  color: #d4d4d4;
}

.code-container::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}

.code-container::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
}

.code-container::-webkit-scrollbar-thumb {
  background: rgba(102, 126, 234, 0.3);
  border-radius: 6px;
  border: 2px solid rgba(0, 0, 0, 0.2);
}

.code-container::-webkit-scrollbar-thumb:hover {
  background: rgba(102, 126, 234, 0.5);
}

/* Key System Notice */
.key-system-notice {
  display: flex;
  gap: 20px;
  padding: 24px 32px;
  background: linear-gradient(135deg, rgba(250, 112, 154, 0.1) 0%, rgba(254, 225, 64, 0.1) 100%);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  align-items: center;
}

.key-system-notice i {
  font-size: 2rem;
  color: #fee140;
}

.key-system-notice > div {
  flex: 1;
}

.key-system-notice strong {
  color: #fff;
  font-size: 1.1rem;
  display: block;
  margin-bottom: 8px;
}

.key-system-notice p {
  color: rgba(255, 255, 255, 0.7);
  margin: 0 0 12px 0;
}

/* ==========================
   SIDEBAR - ENHANCED
   ========================== */

.script-sidebar {
  position: sticky;
  top: 88px;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
}

.script-sidebar::-webkit-scrollbar {
  width: 6px;
}

.script-sidebar::-webkit-scrollbar-track {
  background: transparent;
}

.script-sidebar::-webkit-scrollbar-thumb {
  background: rgba(102, 126, 234, 0.3);
  border-radius: 3px;
}

.sidebar-card {
  background: linear-gradient(135deg, rgba(20, 25, 35, 0.9) 0%, rgba(15, 20, 30, 0.8) 100%);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 18px;
  padding: 28px;
  margin-bottom: 20px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
  transition: all 0.3s ease;
}

.sidebar-card:hover {
  border-color: rgba(102, 126, 234, 0.3);
  box-shadow: 0 16px 50px rgba(0, 0, 0, 0.4);
}

.sidebar-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 16px;
  border-bottom: 2px solid rgba(102, 126, 234, 0.2);
}

.sidebar-title i {
  color: #667eea;
}

/* ==========================
   ACTIONS (LIKE, FAVORITE, ETC)
   ========================== */

.sidebar-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 24px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 0.95rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
}

.action-btn:hover {
  background: rgba(102, 126, 234, 0.2);
  border-color: rgba(102, 126, 234, 0.4);
  transform: translateX(4px);
}

.action-btn.active {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-color: transparent;
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.3);
}

.action-btn i {
  font-size: 1rem;
}

/* Simplified Actions */
.sidebar-actions-simple {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.action-btn-simple {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.03);
  color: #fff;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}

.action-btn-simple:hover {
  background: rgba(102, 126, 234, 0.15);
  border-color: rgba(102, 126, 234, 0.3);
}

.action-btn-simple.active {
  background: rgba(102, 126, 234, 0.25);
  border-color: rgba(102, 126, 234, 0.5);
  color: #667eea;
}

.action-btn-simple i {
  font-size: 0.875rem;
  opacity: 0.8;
}

.action-btn-simple.report-btn:hover {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.3);
  color: #ef4444;
}

.like-count {
  margin-left: auto;
  background: rgba(0, 0, 0, 0.3);
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 0.875rem;
}

/* ==========================
   AUTHOR CARD
   ========================== */

.author-card-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 16px;
}

.author-avatar-large {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  border: 4px solid rgba(102, 126, 234, 0.3);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  object-fit: cover;
  transition: all 0.3s ease;
}

.author-avatar-large:hover {
  transform: scale(1.05);
  border-color: rgba(102, 126, 234, 0.6);
}

.author-name-large {
  font-size: 1.25rem;
  font-weight: 700;
  color: #fff;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.author-reputation {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: rgba(102, 126, 234, 0.1);
  border-radius: 20px;
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.875rem;
  font-weight: 600;
}

.author-reputation i {
  color: #fbbf24;
}

/* ==========================
   RELATED SCRIPTS
   ========================== */

.related-scripts-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.related-script-item {
  display: flex;
  gap: 14px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  transition: all 0.3s ease;
  text-decoration: none;
  color: inherit;
}

.related-script-item:hover {
  background: rgba(102, 126, 234, 0.1);
  border-color: rgba(102, 126, 234, 0.3);
  transform: translateX(6px);
}

.related-script-info {
  flex: 1;
  min-width: 0;
}

.related-script-title {
  font-weight: 600;
  color: #fff;
  margin: 0 0 8px 0;
  font-size: 0.95rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.related-script-meta {
  display: flex;
  gap: 12px;
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.8rem;
}

.related-script-meta span {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ==========================
   RESPONSIVE
   ========================== */

@media (max-width: 768px) {
  .script-header-card {
    padding: 24px;
  }

  .script-header-title {
    font-size: 2rem;
  }

  .script-meta-grid {
    grid-template-columns: 1fr;
    padding: 16px;
  }

  .script-stats-large {
    grid-template-columns: repeat(2, 1fr);
  }

  .code-header {
    flex-direction: column;
    gap: 16px;
    align-items: flex-start;
  }

  .code-actions {
    width: 100%;
    flex-direction: column;
  }
}

/* Report Modal Styles */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 9999;
  animation: fadeIn 0.2s ease;
}

.modal.active {
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
}

.modal-content {
  position: relative;
  background: linear-gradient(135deg, #1a1f2e 0%, #0f1419 100%);
  border: 1px solid rgba(102, 126, 234, 0.2);
  border-radius: 16px;
  max-width: 600px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  animation: slideUp 0.3s ease;
}

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

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.modal-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0;
}

.modal-title i {
  color: #667eea;
}

.modal-close {
  background: none;
  border: none;
  color: #94a3b8;
  font-size: 1.25rem;
  cursor: pointer;
  padding: 8px;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.modal-close:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
}

.modal-body {
  padding: 24px;
}

.form-group {
  margin-bottom: 24px;
}

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: #e2e8f0;
  margin-bottom: 8px;
}

.required {
  color: #ef4444;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 12px 16px;
  background: rgba(15, 20, 25, 0.8);
  border: 1px solid rgba(102, 126, 234, 0.2);
  border-radius: 8px;
  color: #fff;
  font-size: 0.9375rem;
  font-family: 'Inter', sans-serif;
  transition: all 0.2s ease;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-select {
  cursor: pointer;
}

.form-textarea {
  resize: vertical;
  min-height: 150px;
}

.form-hint {
  display: block;
  font-size: 0.8125rem;
  color: #94a3b8;
  margin-top: 6px;
}

.form-hint-group {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 6px;
}

.modal-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 32px;
}

.modal-actions .btn {
  padding: 12px 24px;
  font-weight: 600;
}

/* Custom scrollbar for modal */
.modal-content::-webkit-scrollbar {
  width: 8px;
}

.modal-content::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 8px;
}

.modal-content::-webkit-scrollbar-thumb {
  background: rgba(102, 126, 234, 0.3);
  border-radius: 8px;
}

.modal-content::-webkit-scrollbar-thumb:hover {
  background: rgba(102, 126, 234, 0.5);
}
