:root {
  --bg-dark: #0f172a;
  --bg-sidebar: #1e293b;
  --bg-card: rgba(30, 41, 59, 0.7);
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --accent-primary: #38bdf8;
  --accent-secondary: #818cf8;
  --border-color: rgba(255, 255, 255, 0.1);
  --border-hover: rgba(255, 255, 255, 0.2);
  --gradient-accent: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Outfit', sans-serif;
  background-color: var(--bg-dark);
  color: var(--text-main);
  background-image: radial-gradient(circle at 15% 50%, rgba(56, 189, 248, 0.05), transparent 25%),
                    radial-gradient(circle at 85% 30%, rgba(129, 140, 248, 0.05), transparent 25%);
  overflow: hidden;
}

.app-container {
  display: flex;
  height: 100vh;
  width: 100vw;
}

/* Glassmorphism utility */
.glass-card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--border-hover);
}

/* Sidebar */
.sidebar {
  width: 280px;
  background-color: rgba(15, 23, 42, 0.95);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  z-index: 10;
}

.sidebar-header {
  padding: 24px;
  border-bottom: 1px solid var(--border-color);
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo h1 {
  font-size: 1.25rem;
  font-weight: 600;
  background: var(--gradient-accent);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 16px 12px;
}

.sidebar-nav ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.category-item {
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 0.95rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 12px;
}

.category-item:hover {
  background-color: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
  transform: translateX(4px);
}

.category-item.active {
  background: var(--gradient-accent);
  color: #fff;
  font-weight: 500;
  box-shadow: 0 4px 12px rgba(56, 189, 248, 0.2);
}

/* Main Content */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.topbar {
  padding: 24px 40px;
  border-bottom: 1px solid var(--border-color);
  background-color: rgba(15, 23, 42, 0.8);
  backdrop-filter: blur(8px);
  z-index: 5;
}

.topbar h2 {
  font-size: 1.5rem;
  font-weight: 500;
  letter-spacing: -0.02em;
}

.content-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 40px;
}

/* Welcome View */
.welcome-view {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.welcome-card {
  text-align: center;
  padding: 60px 40px;
  max-width: 500px;
  animation: fadeUp 0.6s ease-out forwards;
}

.welcome-card .emoji {
  font-size: 3rem;
  margin-bottom: 20px;
  display: inline-block;
  animation: float 3s ease-in-out infinite;
}

.welcome-card h2 {
  font-size: 1.8rem;
  margin-bottom: 16px;
  background: var(--gradient-accent);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.welcome-card p {
  color: var(--text-muted);
  line-height: 1.6;
}

/* Category View */
.category-view {
  display: flex;
  flex-direction: column;
  gap: 40px;
  max-width: 1200px;
  margin: 0 auto;
  animation: fadeIn 0.4s ease-out forwards;
}

.hidden {
  display: none !important;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.section-header h3 {
  font-size: 1.1rem;
  color: var(--text-muted);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
}

.action-btn {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  border-radius: 8px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.action-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-main);
}

/* Iframe */
.iframe-container {
  width: 100%;
  height: 450px;
  overflow: hidden;
  position: relative;
}

iframe {
  width: 100%;
  height: 100%;
  border: none;
  background-color: transparent;
}

/* Code Tabs */
.tabs-container {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.tabs-header {
  display: flex;
  flex-wrap: wrap;
  background-color: rgba(0, 0, 0, 0.2);
  border-bottom: 1px solid var(--border-color);
}

.css-tabs-wrapper {
  display: flex;
  flex-wrap: wrap;
}

.tab-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 16px 24px;
  font-size: 0.9rem;
  font-family: 'Fira Code', monospace;
  cursor: pointer;
  transition: all 0.2s ease;
  border-bottom: 2px solid transparent;
}

.tab-btn:hover {
  background-color: rgba(255, 255, 255, 0.03);
  color: var(--text-main);
}

.tab-btn.active {
  color: var(--accent-primary);
  border-bottom-color: var(--accent-primary);
  background-color: rgba(56, 189, 248, 0.05);
}

.tabs-content {
  position: relative;
  background: #1d1f21; /* Match prism dark theme roughly */
}

.code-panel {
  display: none;
  position: relative;
}

.code-panel.active {
  display: block;
  animation: fadeIn 0.3s ease-out;
}

.code-utils {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 10;
}

.copy-btn {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  padding: 6px 16px;
  border-radius: 6px;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s;
  backdrop-filter: blur(4px);
}

.copy-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

.copy-btn.copied {
  background: #10b981;
  border-color: #059669;
}

pre {
  margin: 0 !important;
  padding: 24px !important;
  max-height: 500px;
  border-radius: 0 0 16px 16px !important;
  background: transparent !important;
  font-family: 'Fira Code', monospace !important;
  font-size: 0.9rem !important;
}

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

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

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}
