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

:root{
  --bg:#0b1120;
  --panel:#111827;
  --panel-light:#1e293b;
  --border:rgba(255,255,255,0.08);

  --text:#f8fafc;
  --muted:#94a3b8;

  --primary:#7c3aed;
  --primary-2:#8b5cf6;

  --shadow:0 20px 50px rgba(0,0,0,0.35);
}

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

body{
  font-family:'Inter',sans-serif;
  background:
    radial-gradient(circle at top left,#312e81 0%,transparent 30%),
    radial-gradient(circle at bottom right,#0f766e 0%,transparent 30%),
    var(--bg);

  min-height:100vh;
  color:var(--text);
  padding:24px;
}

/* APP LAYOUT */

.app-shell{
  display:grid;
  grid-template-columns:340px 1fr;
  gap:24px;
  min-height:calc(100vh - 48px);
}

/* SIDEBAR */

.sidebar{
  background:rgba(17,24,39,0.7);
  border:1px solid var(--border);
  backdrop-filter:blur(18px);
  border-radius:28px;
  padding:24px;
  overflow:auto;
  box-shadow:var(--shadow);
}

.brand{
  display:flex;
  align-items:center;
  gap:14px;
  margin-bottom:28px;
}

a.back {
  float:right;
  margin-bottom: 10px;
  color: #ffffff;
  -webkit-text-decoration: none;
  -moz-text-decoration: none;
  text-decoration: none;
}

.brand-logo{
  width:55px;
  height:55px;
  border-radius:18px;

  background:linear-gradient(135deg,#7c3aed,#06b6d4);

  display:flex;
  align-items:center;
  justify-content:center;

  font-weight:800;
  font-size:1.4rem;
}

.brand h1{
  font-size:1.1rem;
}

.brand p{
  color:var(--muted);
  font-size:0.9rem;
}

/* PANELS */

.panel{
  background:rgba(255,255,255,0.03);
  border:1px solid var(--border);
  border-radius:24px;
  padding:22px;
  margin-bottom:22px;
}

.panel-header{
  margin-bottom:20px;
}

.panel-header h2{
  font-size:1rem;
}

.field{
  margin-bottom:18px;
}

label{
  display:block;
  margin-bottom:10px;
  font-size:0.92rem;
  color:#cbd5e1;
}

input,
textarea{
  width:100%;
  border:none;
  outline:none;

  background:rgba(255,255,255,0.06);
  border:1px solid transparent;

  color:white;

  border-radius:14px;
  padding:14px;
  font-size:0.95rem;

  transition:0.25s ease;
}

input:focus,
textarea:focus{
  border-color:#8b5cf6;
  background:rgba(255,255,255,0.08);
}

textarea{
  resize:none;
}

/* RANGE */

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

.range-wrap span{
  min-width:34px;
  text-align:center;
  padding:8px;
  border-radius:12px;
  background:rgba(255,255,255,0.08);
}

/* COLORS */

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

.color-preview{
  width:40px;
  height:40px;
  border-radius:12px;
  border:2px solid rgba(255,255,255,0.15);
}

/* BUTTONS */

.button-group{
  display:flex;
  gap:12px;
}

button{
  border:none;
  cursor:pointer;
  transition:0.25s ease;
  font-weight:600;
}

.primary-btn{
  width:100%;
  padding:14px;
  border-radius:16px;

  background:linear-gradient(135deg,#7c3aed,#8b5cf6);
  color:white;
}

.primary-btn:hover{
  transform:translateY(-2px);
  box-shadow:0 12px 25px rgba(124,58,237,0.35);
}

.secondary-btn{
  width:100%;
  padding:14px;
  border-radius:16px;

  background:rgba(255,255,255,0.06);
  color:white;
}

.secondary-btn:hover{
  background:rgba(255,255,255,0.1);
}

/* MAIN */

.main-content{
  display:flex;
  flex-direction:column;
  gap:24px;
}

/* PREVIEW */

.preview-panel,
.code-panel{
  background:rgba(17,24,39,0.7);
  border:1px solid var(--border);
  border-radius:28px;
  backdrop-filter:blur(18px);
  padding:24px;
  box-shadow:var(--shadow);
}

.panel-top{
  margin-bottom:20px;
}

.panel-top h2{
  font-size:1.3rem;
}

.panel-top p{
  color:var(--muted);
}

/* GRID */

#generatedGrid{
  display:grid;
  gap:20px;
  border-radius:24px;
  padding:20px;
  min-height:350px;
  transition:0.3s ease;
}

.grid-item{
  overflow:hidden;
  border-radius:22px;
  position:relative;
  transition:0.35s ease;
}

.grid-item:hover{
  transform:translateY(-6px) scale(1.01);
}

.grid-item img{
  width:100%;
  height:220px;
  object-fit:cover;
}

.grid-content{
  padding:22px;
  backdrop-filter:blur(8px);
}

.grid-content h3{
  font-size:1.15rem;
  margin-bottom:10px;
}

.grid-content p{
  color:rgba(255,255,255,0.8);
  line-height:1.5;
}

/* CODE PANEL */

.tabs{
  display:flex;
  gap:12px;
  margin-bottom:20px;
}

.tab{
  padding:12px 18px;
  border-radius:14px;
  background:rgba(255,255,255,0.05);
  color:white;
}

.tab.active{
  background:linear-gradient(135deg,#7c3aed,#8b5cf6);
}

.tab-content{
  display:none;
  position:relative;
}

.tab-content.active{
  display:block;
}

pre{
  overflow:auto;
  border-radius:20px;
  padding:24px;
  background:#020617;
  border:1px solid rgba(255,255,255,0.05);

  line-height:1.6;
  color:#38bdf8;
}

.copy-btn{
  position:absolute;
  top:14px;
  right:14px;

  padding:10px 16px;
  border-radius:12px;

  background:#1e293b;
  color:white;
}

.copy-btn:hover{
  background:#334155;
}

/* RESPONSIVE */

@media(max-width:1000px){

  .app-shell{
    grid-template-columns:1fr;
  }

}