@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

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

:root {
  --bg: #0a0a12;
  --bg-secondary: #10101f;
  --bg-card: #151528;
  --accent: #1e1e3f;
  --highlight: #7c3aed;
  --highlight-2: #06b6d4;
  --highlight-glow: rgba(124, 58, 237, .25);
  --gradient: linear-gradient(135deg, #7c3aed, #06b6d4);
  --gradient-hover: linear-gradient(135deg, #6d28d9, #0891b2);
  --text: #f0f0f5;
  --text-secondary: #8888aa;
  --border: #1e1e3f;
  --radius: 16px;
  --shadow: 0 8px 32px rgba(0,0,0,.4);
}

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  display: flex;
  min-height: 100vh;
}

/* SIDEBAR */
.sidebar {
  width: 270px;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  overflow-y: auto;
  z-index: 100;
  transition: transform .3s;
}

.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

.sidebar .logo {
  padding: 24px 20px;
  font-size: 1.3rem;
  font-weight: 800;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
  letter-spacing: -.5px;
}

.sidebar .logo span {
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.sidebar .category {
  padding: 18px 20px 6px;
  font-size: .65rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--text-secondary);
  font-weight: 700;
}

.sidebar a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 20px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: .85rem;
  font-weight: 500;
  transition: all .2s;
  cursor: pointer;
  border-left: 3px solid transparent;
}

.sidebar a:hover {
  color: var(--text);
  background: rgba(124, 58, 237, .08);
  border-left-color: var(--highlight);
}

.sidebar a.active {
  color: #fff;
  background: rgba(124, 58, 237, .15);
  border-left-color: var(--highlight);
}

.sidebar a .icon {
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.sidebar a:hover .icon svg,
.sidebar a.active .icon svg {
  stroke: var(--highlight-2);
}

/* ANIMATED BACKGROUND */
.bg-animation {
  position: fixed;
  top: 0; left: 270px; right: 0; bottom: 0;
  z-index: -1;
  overflow: hidden;
  background: var(--bg);
}

.bg-animation .orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: .15;
  animation: float 20s ease-in-out infinite;
}

.bg-animation .orb:nth-child(1) {
  width: 500px; height: 500px;
  background: #7c3aed;
  top: -10%; right: -5%;
  animation-duration: 22s;
}

.bg-animation .orb:nth-child(2) {
  width: 400px; height: 400px;
  background: #06b6d4;
  bottom: -10%; left: 10%;
  animation-duration: 18s;
  animation-delay: -5s;
}

.bg-animation .orb:nth-child(3) {
  width: 300px; height: 300px;
  background: #ec4899;
  top: 40%; right: 20%;
  animation-duration: 25s;
  animation-delay: -10s;
  opacity: .1;
}

.bg-animation .orb:nth-child(4) {
  width: 250px; height: 250px;
  background: #7c3aed;
  bottom: 20%; right: 40%;
  animation-duration: 20s;
  animation-delay: -8s;
  opacity: .08;
}

@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  25% { transform: translate(60px, -40px) scale(1.1); }
  50% { transform: translate(-30px, 50px) scale(.95); }
  75% { transform: translate(40px, 30px) scale(1.05); }
}

/* Particles */
.bg-animation .particle {
  position: absolute;
  width: 2px; height: 2px;
  background: rgba(124, 58, 237, .4);
  border-radius: 50%;
  animation: rise linear infinite;
}

@keyframes rise {
  0% { transform: translateY(100vh) scale(0); opacity: 0; }
  10% { opacity: 1; }
  90% { opacity: 1; }
  100% { transform: translateY(-10vh) scale(1); opacity: 0; }
}

/* MAIN */
.main {
  margin-left: 270px;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  position: relative;
}

/* AD BANNER */
.ad-banner {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  padding: 10px;
  text-align: center;
  min-height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  font-size: .75rem;
  letter-spacing: .5px;
}

/* CONTENT */
.content {
  flex: 1;
  padding: 40px;
  max-width: 920px;
  width: 100%;
  margin: 0 auto;
}

.content h1 {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 8px;
  letter-spacing: -.5px;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.content .subtitle {
  color: var(--text-secondary);
  margin-bottom: 28px;
  font-size: .95rem;
}

/* TOOL CARD */
.tool-area {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.tool-area label {
  display: block;
  font-size: .8rem;
  color: var(--text-secondary);
  margin-bottom: 6px;
  margin-top: 18px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .5px;
}

.tool-area label:first-child { margin-top: 0; }

.tool-area textarea,
.tool-area input[type="text"],
.tool-area input[type="number"],
.tool-area input[type="file"],
.tool-area select {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-size: .9rem;
  font-family: 'Inter', sans-serif;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}

.tool-area textarea { min-height: 120px; resize: vertical; font-family: 'JetBrains Mono', monospace, 'Inter'; }

.tool-area textarea:focus,
.tool-area input:focus,
.tool-area select:focus {
  border-color: var(--highlight);
  box-shadow: 0 0 0 3px var(--highlight-glow);
}

.tool-area input[type="file"] { cursor: pointer; }

.tool-area input[type="range"] {
  -webkit-appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: var(--border);
  outline: none;
  margin-top: 8px;
}

.tool-area input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--gradient);
  cursor: pointer;
  box-shadow: 0 0 8px var(--highlight-glow);
}

.tool-area .btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 18px;
  padding: 12px 28px;
  background: var(--gradient);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: .9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s;
  box-shadow: 0 4px 15px var(--highlight-glow);
}

.tool-area .btn:hover {
  background: var(--gradient-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px var(--highlight-glow);
}

.tool-area .btn:active {
  transform: translateY(0);
}

.tool-area .btn-secondary {
  background: var(--accent);
  box-shadow: none;
}

.tool-area .btn-secondary:hover {
  background: #2a2a5a;
  box-shadow: none;
}

.tool-area .output {
  margin-top: 18px;
  padding: 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  min-height: 60px;
  word-break: break-all;
  font-family: 'JetBrains Mono', monospace;
  font-size: .85rem;
  white-space: pre-wrap;
  line-height: 1.6;
}

.tool-area .row {
  display: flex;
  gap: 12px;
  align-items: end;
}

.tool-area .row > * { flex: 1; }

.tool-area .color-preview {
  width: 60px;
  height: 42px;
  border-radius: 10px;
  border: 1px solid var(--border);
  flex: none;
}

.tool-area .range-val {
  display: inline-block;
  min-width: 40px;
  text-align: center;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 800;
}

.tool-area .password-display {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.3rem;
  letter-spacing: 2px;
  padding: 20px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  text-align: center;
  word-break: break-all;
  margin-top: 16px;
  color: var(--highlight-2);
}

.tool-area .palette {
  display: flex;
  gap: 10px;
  margin-top: 14px;
  flex-wrap: wrap;
}

.tool-area .palette-color {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all .2s;
  box-shadow: 0 2px 8px rgba(0,0,0,.3);
}

.tool-area .palette-color:hover {
  border-color: #fff;
  transform: scale(1.1);
}

/* IMAGE PREVIEW */
.img-preview {
  max-width: 100%;
  max-height: 300px;
  border-radius: 12px;
  margin-top: 14px;
  box-shadow: 0 4px 16px rgba(0,0,0,.3);
}

.img-info {
  color: var(--text-secondary);
  font-size: .8rem;
  margin-top: 10px;
  font-weight: 500;
}

/* HOME GRID */
.home-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 18px;
}

.home-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  cursor: pointer;
  transition: all .3s;
  text-decoration: none;
  color: var(--text);
  position: relative;
  overflow: hidden;
}

.home-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--gradient);
  opacity: 0;
  transition: opacity .3s;
}

.home-card:hover {
  border-color: var(--highlight);
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(124, 58, 237, .15);
}

.home-card:hover::before { opacity: 1; }

.home-card .card-icon {
  font-size: 2rem;
  margin-bottom: 12px;
  color: var(--highlight-2);
}

.home-card .card-icon svg { width: 32px; height: 32px; }
.home-card h3 { font-size: .95rem; font-weight: 700; margin-bottom: 6px; }
.home-card p { font-size: .78rem; color: var(--text-secondary); line-height: 1.4; }

/* ADS */
.ad-sidebar {
  margin-top: auto;
  padding: 16px;
  display: flex;
  justify-content: center;
  border-top: 1px solid var(--border);
}

.ad-inline {
  margin-top: 24px;
  padding: 16px 0;
  text-align: center;
  min-height: 100px;
}

/* FOOTER */
.footer {
  padding: 24px 30px;
  text-align: center;
  color: var(--text-secondary);
  font-size: .75rem;
  border-top: 1px solid var(--border);
}

/* MOBILE TOGGLE */
.menu-toggle {
  display: none;
  position: fixed;
  top: 14px; left: 14px;
  z-index: 200;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px 14px;
  border-radius: 10px;
  cursor: pointer;
  transition: background .2s;
}

.menu-toggle:hover { background: var(--accent); }

/* QR canvas */
#qr-output canvas { border-radius: 12px; }

/* ANIMATIONS */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.tool-area { animation: fadeIn .3s ease-out; }
.home-card { animation: fadeIn .3s ease-out backwards; }
.home-card:nth-child(2) { animation-delay: .05s; }
.home-card:nth-child(3) { animation-delay: .1s; }
.home-card:nth-child(4) { animation-delay: .15s; }
.home-card:nth-child(5) { animation-delay: .2s; }
.home-card:nth-child(6) { animation-delay: .25s; }
.home-card:nth-child(7) { animation-delay: .3s; }
.home-card:nth-child(8) { animation-delay: .35s; }

/* RESPONSIVE */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main { margin-left: 0; }
  .menu-toggle { display: block; }
  .content { padding: 20px; padding-top: 64px; }
  .tool-area .row { flex-direction: column; }
  .home-grid { grid-template-columns: 1fr; }
}
