/* ===== CODE VIEW PAGE ===== */
.code-view-page { min-height: 100vh; background: #090506; padding-top: 56px; position: relative; overflow-x: hidden; }
.code-view-bg { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.bg-gradient-orb { position: absolute; border-radius: 50%; filter: blur(100px); opacity: 0.5; animation: floatOrb 20s ease-in-out infinite; }
.orb-2 { top: 50%; right: -15%; width: 500px; height: 500px; background: radial-gradient(circle, rgba(239,68,68,0.28) 0%, transparent 70%); animation-delay: -7s; }
.bg-mesh { position: absolute; inset: 0; opacity: 0.02; background-image: linear-gradient(rgba(255,255,255,0.5) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,0.5) 1px, transparent 1px); background-size: 40px 40px; }

.code-view-container { max-width: 1400px; margin: 0 auto; padding: 16px 20px 40px; position: relative; z-index: 1; }

/* Topbar */
.code-topbar { display: flex; align-items: center; justify-content: space-between; padding: 10px 16px; background: rgba(13,13,18,0.8); border: 1px solid rgba(255,255,255,0.07); border-radius: 12px; margin-bottom: 16px; backdrop-filter: blur(10px); }
.back-link { display: flex; align-items: center; gap: 8px; color: #94a3b8; font-size: 14px; font-weight: 500; transition: color 0.2s; }
.back-link:hover { color: #e2e8f0; }
.topbar-center { flex: 1; display: flex; justify-content: center; }
.file-indicator { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 500; }
.file-dot { width: 10px; height: 10px; border-radius: 50%; }
.topbar-actions { display: flex; gap: 6px; }
.topbar-btn { width: 32px; height: 32px; border-radius: 8px; background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.07); color: #94a3b8; display: flex; align-items: center; justify-content: center; transition: all 0.2s; }
.topbar-btn:hover { background: rgba(255,255,255,0.1); color: #e2e8f0; }

/* Layout */
.code-view-layout { display: grid; grid-template-columns: 1fr 300px; gap: 16px; }

/* Editor Wrapper */
.code-editor-wrapper { background: #140b0d; border: 1px solid rgba(255,255,255,0.07); border-radius: 12px; overflow: hidden; display: flex; flex-direction: column; }

/* Editor Header */
.editor-header { display: flex; align-items: center; justify-content: space-between; padding: 0 12px; background: #1d1114; border-bottom: 1px solid rgba(255,255,255,0.07); height: 40px; }
.editor-tabs { display: flex; }
.editor-tab { display: flex; align-items: center; gap: 6px; padding: 0 16px; height: 40px; border-right: 1px solid rgba(255,255,255,0.07); font-size: 13px; background: #140b0d; }
.tab-icon { font-size: 12px; }
.tab-name { font-weight: 500; }
.tab-ext { color: #6b7280; font-size: 12px; }
.editor-actions { display: flex; gap: 6px; }
.editor-action-btn { display: flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 6px; background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.07); color: #94a3b8; font-size: 12px; transition: all 0.2s; }
.editor-action-btn:hover { background: rgba(255,255,255,0.1); color: #e2e8f0; }

/* Code Block */
.code-editor { display: flex; flex: 1; overflow: hidden; min-height: 600px; max-height: 1000px; }
.code-gutter { background: #140b0d; border-right: 1px solid rgba(255,255,255,0.05); padding: 16px 0; min-width: 50px; overflow: hidden; user-select: none; }
.gutter-line { display: flex; align-items: center; justify-content: flex-end; padding: 0 12px; height: 21px; }
.line-num { font-size: 12px; font-family: 'Fira Code', monospace; color: #3d4451; }
.code-scroll { flex: 1; overflow: auto; }
.code-pre { margin: 0; padding: 16px; background: #140b0d; min-height: 100%; }
.code-pre code { font-family: 'Fira Code', monospace; font-size: 13px; line-height: 21px; }

/* Terminal */
.terminal-section { border-top: 1px solid rgba(255,255,255,0.07); }
.terminal-header { display: flex; align-items: center; justify-content: space-between; padding: 0 12px; background: #1d1114; height: 36px; }
.terminal-tabs { display: flex; gap: 2px; }
.terminal-tab { display: flex; align-items: center; gap: 5px; padding: 0 12px; height: 36px; font-size: 12px; color: #6b7280; border-bottom: 2px solid transparent; transition: all 0.2s; }
.terminal-tab.active { color: #e2e8f0; border-bottom-color: #ef4444; }
.tab-badge { background: rgba(239,68,68,0.2); color: #ef4444; border-radius: 4px; padding: 1px 5px; font-size: 10px; }
.terminal-actions { display: flex; align-items: center; gap: 6px; }
.terminal-run-btn { display: flex; align-items: center; gap: 5px; padding: 4px 12px; border-radius: 6px; background: #22c55e; color: #fff; font-size: 12px; font-weight: 600; transition: all 0.2s; }
.terminal-run-btn:hover { background: #16a34a; }
.terminal-action { width: 26px; height: 26px; border-radius: 5px; background: rgba(255,255,255,0.05); color: #6b7280; display: flex; align-items: center; justify-content: center; font-size: 11px; transition: all 0.2s; }
.terminal-action:hover { background: rgba(255,255,255,0.1); color: #e2e8f0; }
.terminal-body { background: #140b0d; }
.terminal-content { padding: 10px 16px; min-height: 80px; max-height: 160px; overflow-y: auto; font-family: 'Fira Code', monospace; font-size: 12px; line-height: 1.6; }
.terminal-welcome { display: flex; gap: 8px; color: #6b7280; }
.term-prefix { color: #22c55e; }
.terminal-line { display: flex; gap: 8px; margin-bottom: 2px; }
.terminal-line.success .term-text { color: #22c55e; }
.terminal-line.error .term-text { color: #ef4444; }
.terminal-line.info .term-text { color: #ef4444; }
.terminal-line.output .term-text { color: #e2e8f0; }
.terminal-input-area { display: flex; align-items: center; gap: 8px; padding: 6px 16px; border-top: 1px solid rgba(255,255,255,0.05); }
.input-prefix { color: #22c55e; font-family: 'Fira Code', monospace; font-size: 12px; }
.terminal-input { flex: 1; background: none; border: none; outline: none; color: #e2e8f0; font-family: 'Fira Code', monospace; font-size: 12px; }

/* Editor Footer */
.editor-footer { display: flex; align-items: center; justify-content: space-between; padding: 0 12px; background: #1d1114; height: 24px; border-top: 1px solid rgba(255,255,255,0.07); }
.footer-item { font-size: 11px; color: #6b7280; display: flex; align-items: center; gap: 4px; margin-right: 12px; }
.footer-item.success { color: #22c55e; }
.footer-left, .footer-right { display: flex; align-items: center; }
.footer-lang { padding: 1px 8px; border-radius: 4px; font-size: 11px; font-weight: 600; }

/* Info Panel */
.code-info-panel { display: flex; flex-direction: column; gap: 12px; }
.info-card { background: rgba(13,13,18,0.8); border: 1px solid rgba(255,255,255,0.07); border-radius: 12px; overflow: hidden; backdrop-filter: blur(10px); }
.info-card-header { display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-bottom: 1px solid rgba(255,255,255,0.07); font-size: 13px; font-weight: 600; color: #94a3b8; }

/* Author Card */
.author-card-modern { position: relative; }
.author-content { display: flex; align-items: center; gap: 12px; padding: 16px; }
.author-avatar-wrapper { position: relative; flex-shrink: 0; }
.author-avatar { width: 48px; height: 48px; border-radius: 50%; }
.avatar-ring { position: absolute; inset: -3px; border-radius: 50%; border: 2px solid; }
.author-details { display: flex; flex-direction: column; gap: 2px; }
.author-label { font-size: 11px; color: #6b7280; text-transform: uppercase; letter-spacing: 0.5px; }
.author-name { font-size: 15px; font-weight: 700; }
.author-time { font-size: 12px; color: #6b7280; }

/* Stats Row */
.stats-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stat-card-mini { background: rgba(13,13,18,0.8); border: 1px solid rgba(255,255,255,0.07); border-radius: 12px; padding: 14px; display: flex; align-items: center; gap: 10px; }
.stat-icon-wrap { width: 36px; height: 36px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 14px; flex-shrink: 0; }
.stat-icon-wrap.red { background: rgba(239,68,68,0.15); color: #ef4444; }
.stat-icon-wrap.blue { background: rgba(239,68,68,0.15); color: #ef4444; }
.stat-data { display: flex; flex-direction: column; }
.stat-number { font-size: 20px; font-weight: 800; }
.stat-label { font-size: 11px; color: #6b7280; }

/* Action Buttons */
.action-buttons { display: flex; flex-direction: column; gap: 8px; }
.action-btn-modern {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px; border-radius: 10px; font-size: 14px; font-weight: 600;
  background: rgba(239,68,68,0.1); border: 1px solid rgba(239,68,68,0.2); color: #ef4444;
  transition: all 0.2s; position: relative; overflow: hidden;
}
.action-btn-modern:hover { background: rgba(239,68,68,0.2); transform: translateY(-1px); }
.action-btn-modern.liked { background: rgba(239,68,68,0.25); border-color: rgba(239,68,68,0.5); }
.action-btn-modern.secondary { background: rgba(255,255,255,0.05); border-color: rgba(255,255,255,0.1); color: #94a3b8; }
.action-btn-modern.secondary:hover { background: rgba(255,255,255,0.1); color: #e2e8f0; }

/* Info Grid */
.info-grid { padding: 12px 16px; display: flex; flex-direction: column; gap: 10px; }
.info-item { display: flex; justify-content: space-between; align-items: center; }
.info-key { font-size: 12px; color: #6b7280; }
.info-val { font-size: 13px; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.lang-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }

/* Description */
.description-text { padding: 12px 16px; font-size: 13px; color: #94a3b8; line-height: 1.6; }

/* Share Card */
.share-card .share-buttons { display: flex; gap: 8px; padding: 12px 16px; }
.share-btn { width: 40px; height: 40px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 16px; transition: all 0.2s; }
.share-btn.twitter { background: rgba(29,161,242,0.1); border: 1px solid rgba(29,161,242,0.2); color: #1da1f2; }
.share-btn.twitter:hover { background: rgba(29,161,242,0.2); }
.share-btn.discord { background: rgba(239,68,68,0.12); border: 1px solid rgba(239,68,68,0.24); color: #ef4444; }
.share-btn.discord:hover { background: rgba(239,68,68,0.22); }
.share-btn.link { background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1); color: #94a3b8; }
.share-btn.link:hover { background: rgba(255,255,255,0.1); }

/* Delete */
.delete-btn { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 10px; border-radius: 10px; background: rgba(239,68,68,0.08); border: 1px solid rgba(239,68,68,0.15); color: #ef4444; font-size: 13px; font-weight: 600; transition: all 0.2s; }
.delete-btn:hover { background: rgba(239,68,68,0.2); }

/* Toast */
.toast { position: fixed; bottom: 24px; right: 24px; padding: 12px 20px; border-radius: 10px; background: #1e1e2e; border: 1px solid rgba(255,255,255,0.1); color: #e2e8f0; font-size: 14px; font-weight: 500; z-index: 9999; display: flex; align-items: center; gap: 8px; transform: translateY(100px); opacity: 0; transition: all 0.3s; }
.toast.show { transform: translateY(0); opacity: 1; }
.toast.success { border-color: rgba(34,197,94,0.3); }
.toast.success i { color: #22c55e; }
.toast.error { border-color: rgba(239,68,68,0.3); }
.toast.error i { color: #ef4444; }

/* Responsive */
@media (max-width: 900px) {
  .code-view-layout { grid-template-columns: 1fr; }
  .code-info-panel { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
  .author-card-modern, .action-buttons, .delete-btn { grid-column: 1/-1; }
}
@media (max-width: 600px) {
  .code-info-panel { grid-template-columns: 1fr; }
}
