/* =========================
   GLOBAL FOUNDATION
========================= */

*{
  box-sizing:border-box;
}

body{
  font-family:Segoe UI,Arial;
  background:linear-gradient(180deg,#6b8fbf,#8b7cf6,#4f46e5);
  margin:0;
  color:white;
}

body::before{
  content:"";
  position:fixed;
  top:0;
  left:0;
  width:100%;
  height:3px;
  background:#3A7CA5;
  z-index:9999;
}

/* =========================
   CONTAINER
========================= */

.container{
  max-width:1200px;
  margin:auto;
  padding:24px 20px;
  display:flex;
  flex-direction:column;
  gap:18px;
}

/* =========================
   HEADER + HERO
========================= */

.header{
  text-align:center;
  margin-bottom:20px;
  padding-bottom:14px;
}

.brand{
  display:inline-flex;
  align-items:center;
  gap:8px;
}

.hero{
  text-align:center;
  margin-top:28px;
  margin-bottom:30px;
}

.hero-title{
  display:flex;
  justify-content:center;
  align-items:center;
  gap:18px;
}

.hero-icon{
  width:68px;
  height:auto;
}

.hero h1{
  margin:0;
  font-size:46px;
  color:#0f0f11;
  line-height:1.1;
}

.subtitle{
  margin-top:10px;
  font-size:20px;
  font-weight:600;
  color:#e6e6e6;
}

.title-block{
  text-align:center;
  margin-bottom:20px;
}

.title-block .intro{
  max-width:460px;
  margin:10px auto 0;
  text-align:center;
  font-size:14px;
  opacity:0.85;
}

.title-block::after{
  content:"";
  display:block;
  width:80px;
  height:2px;
  margin:12px auto 0;

  background:linear-gradient(
    90deg,
    transparent,
    rgba(255,255,255,0.25),
    transparent
  );

  border-radius:2px;
}

/* =========================
   ACCESS CARD
========================= */

.access-wrapper{
  display:flex;
  justify-content:center;
  padding:0 20px 60px;
}

.access-card{
  width:100%;
  max-width:760px;
  background:rgba(8,18,48,0.92);
  border-radius:24px;
  padding:70px 50px;
  text-align:center;

  box-shadow:0 12px 35px rgba(0,0,0,0.35);
}

/* =========================
   PANELS
========================= */

.panel{
  position:relative;

  display:flex;
  flex-direction:column;

  gap:6px;
  padding:16px;

  background:rgba(15,23,42,0.88);

  border-radius:16px;
  border:1px solid rgba(255,255,255,0.04);

  backdrop-filter:blur(6px);

  min-width:0;
  overflow:visible;

  transition:
    transform 0.15s ease,
    box-shadow 0.15s ease;

  box-shadow:
    0 6px 20px rgba(0,0,0,0.25),
    inset 0 1px 0 rgba(255,255,255,0.03);
}

.panel::before{
  content:"";

  position:absolute;
  top:0;
  left:0;
  right:0;

  height:1px;

  background:linear-gradient(
    90deg,
    transparent,
    rgba(255,255,255,0.12),
    transparent
  );
}

.panel:hover{
  transform:translateY(-2px);

  box-shadow:
    0 10px 28px rgba(0,0,0,0.35),
    inset 0 1px 0 rgba(255,255,255,0.05);
}

.panel h3{
  font-size:14px;
  font-weight:600;
  letter-spacing:0.4px;
  margin-bottom:8px;

  color:rgba(255,255,255,0.92);
}

.panel label{
  margin-top:3px;
  margin-bottom:1px;
  font-size:12px;
  opacity:0.9;
}

.panel.scene-style{
  border:1px solid rgba(120,170,255,0.22);

  box-shadow:
    0 10px 32px rgba(60,120,255,0.18),
    inset 0 1px 0 rgba(255,255,255,0.05);
}

/* =========================
   FORM ELEMENTS
========================= */

.field-group{
  display:flex;
  flex-direction:column;
}

label{
  font-size:12px;
  display:block;
  margin-top:6px;
}

input,
select,
textarea{
  width:100%;

  border-radius:6px;
  border:none;

  padding:6px;
  font-size:13px;
}

input,
select{
  height:34px;
  margin-bottom:8px;
}

select{
  width:100%;
}

/* =========================
   BUTTON SYSTEM
========================= */

.button{
  position:relative;

  display:inline-flex;
  align-items:center;
  justify-content:center;

  padding:10px 18px;

  border:none;
  border-radius:8px;

  cursor:pointer;

  font-weight:600;
  font-size:13px;

  transition:all 0.15s ease;

  box-shadow:0 4px 12px rgba(0,0,0,0.35);
}

.button::before{
  content:"";

  position:absolute;
  top:0;
  left:0;

  width:100%;
  height:50%;

  background:linear-gradient(
    to bottom,
    rgba(255,255,255,0.25),
    rgba(255,255,255,0.05)
  );

  border-radius:8px 8px 0 0;

  pointer-events:none;
  opacity:0.6;
}

.button:hover{
  transform:translateY(-2px);
  box-shadow:0 6px 18px rgba(0,0,0,0.45);
}

.button:active{
  transform:translateY(1px);

  box-shadow:
    inset 0 2px 6px rgba(0,0,0,0.4),
    0 2px 6px rgba(0,0,0,0.25);
}

.top-buttons,
.bottom-buttons{
  display:flex;
  justify-content:center;
  align-items:center;
  gap:10px;

  margin-top:8px;
  flex-wrap:wrap;
}

/* =========================
   BUTTON VARIANTS
========================= */

.btn-generate{
  background:linear-gradient(90deg,#4facfe,#00f2fe);
  color:#002b36;
}

.btn-generate:hover{
  box-shadow:0 0 12px rgba(0,242,254,0.6);
}

.btn-regenerate{
  background:linear-gradient(90deg,#38bdf8,#0ea5e9);
  color:#022c22;
}

.btn-regenerate:hover{
  box-shadow:0 0 12px rgba(14,165,233,0.5);
}

.btn-variation{
  background:linear-gradient(90deg,#a855f7,#ec4899);
  color:#ffffff;
}

.btn-variation:hover{
  box-shadow:0 0 12px rgba(236,72,153,0.5);
}

.btn-enhance{
  background:linear-gradient(90deg,#fde047,#facc15);
  color:#3b2f00;
}

.btn-enhance:hover{
  box-shadow:0 0 12px rgba(250,204,21,0.5);
}

.btn-lock{
  background:linear-gradient(90deg,#e5e7eb,#ffffff);
  color:#111827;
}

.btn-unlock{
  background:linear-gradient(90deg,#fb923c,#f97316);
  color:#ffffff;
}

.btn-unlock:hover{
  box-shadow:0 0 12px rgba(249,115,22,0.5);
}

.btn-save{
  background:linear-gradient(90deg,#34d399,#10b981);
  color:#022c22;
}

.btn-copy{
  background:linear-gradient(90deg,#ff0f7b,#ec4899);
  color:#ffffff;
}

.btn-delete{
  background:linear-gradient(90deg,#ef4444,#dc2626);
  color:#ffffff;
}

.btn-copy,
.btn-delete{
  opacity:0.85;
}

/* =========================
   UTILITIES
========================= */

.dimmed{
  opacity:0.3;
  pointer-events:none;
  filter:grayscale(60%);
}

.dimmed select,
.dimmed input{
  cursor:not-allowed;
}

.helper-text{
  font-size:12px;
  opacity:0.7;
  margin:4px 0 8px;
}

textarea::placeholder{
  color:#6b7280;
  font-size:12px;
}

.section-divider{
  width:80%;
  height:1px;
  margin:24px auto 20px;
  background:rgba(255,255,255,0.12);
}

.app-footer{
  text-align:center;
  font-size:11px;
  opacity:0.6;
  margin:20px 0 10px;
}

.app-footer::before{
  content:"";
  display:block;
  width:90%;
  height:1px;
  margin:0 auto 16px;

  background:rgba(255,255,255,0.1);
}

/* =========================
   COLLAPSIBLE PANELS
========================= */

.panel-header{
  display:flex;
  justify-content:space-between;
  align-items:center;
  cursor:pointer;
}

.panel.collapsible{
  padding:12px 16px;
}

.panel.collapsible .panel-content{
  display:none;
}

.panel.collapsible.active .panel-content{
  display:block;
}

.panel-content{
  width:100%;
  box-sizing:border-box;
  padding-right:4px;

  display:flex;
  flex-direction:column;
  gap:6px;
}

.toggle{
  font-size:16px;
  opacity:0.7;
  transition:transform 0.2s ease;
}

.collapsible.active .toggle{
  transform:rotate(45deg);
}

/* =========================
   ADVANCED STYLE SECTION
========================= */

.advanced-style{
  margin-top:10px;
  padding-top:10px;

  border-top:1px solid rgba(255,255,255,0.08);

  opacity:0.9;
}

/* =========================
   HELP ICON
========================= */

.help{
  display:inline-flex;
  align-items:center;
  justify-content:center;

  width:14px;
  height:14px;

  font-size:10px;
  font-weight:600;

  border-radius:50%;

  background:#1f2937;
  color:#9ca3af;

  cursor:pointer;

  transition:
    background 0.15s ease,
    color 0.15s ease;
}

.help:hover{
  background:#374151;
  color:#ffffff;
}

/* =========================
   TOOLTIPS
========================= */

[data-help]{
  position:relative;
}

[data-help]::after{
  content:attr(data-help);

  position:absolute;
  bottom:140%;
  left:50%;

  transform:translateX(-50%);

  background:#111827;
  color:#e5e7eb;

  padding:6px 8px;
  border-radius:6px;

  font-size:11px;
  line-height:1.3;

  min-width:140px;
  max-width:220px;

  text-align:center;

  opacity:0;
  pointer-events:none;

  transition:opacity 0.2s ease;

  z-index:9999;
}

[data-help]:hover::after{
  opacity:1;
}

/* =========================
   CHECKBOX SYSTEM
========================= */

.variation-bar input[type="checkbox"],
.variation-toggles input[type="checkbox"]{
  transform:scale(0.75);

  width:14px;
  height:14px;

  accent-color:#3b82f6;

  cursor:pointer;
}

/* =========================
   CREATOR LAYOUT
========================= */

.creator-layout .top-layout{
  max-width:1100px;
  margin:0 auto 30px;
}

/* =========================
   GRID SYSTEM
========================= */

.creator-layout .grid-4{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:16px;
}

.creator-layout .grid-2{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:16px;
  align-items:start;
}

/* =========================
   WORKSPACE PANEL
========================= */

.creator-layout .workspace-panel{
  padding:20px 20px 18px;
}

.creator-layout .workspace-panel h2,
.creator-layout .flow-text{
  text-align:center;
}

.creator-layout .flow-text{
  font-size:12px;
  opacity:0.8;
  margin-bottom:10px;
}

/* =========================
   VARIATION CONTROLS
========================= */

.creator-layout .variation-bar{
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:12px;

  margin:10px 0 14px;
}

.creator-layout .variation-count{
  display:flex;
  align-items:center;
  justify-content:center;

  gap:14px;
  flex-wrap:wrap;

  font-size:12px;
}

.creator-layout .control-group{
  display:flex;
  align-items:center;
  gap:6px;
}

/* =========================
   TOGGLES
========================= */

.creator-layout .variation-toggles{
  display:flex;
  justify-content:center;
  gap:10px;

  flex-wrap:wrap;
}

.creator-layout .variation-toggles label{
  display:flex;
  align-items:center;
  gap:6px;

  font-size:11px;
}

/* =========================
   OUTPUT SYSTEM
========================= */

.creator-layout .output-grid{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:20px;

  margin-top:10px;
}

.creator-layout .output-grid textarea{
  min-height:120px;
  resize:vertical;
}

/* =========================
   VARIATIONS GRID
========================= */

.creator-layout .variations-grid{
  display:grid;
  grid-template-columns:
    repeat(auto-fit,minmax(220px,1fr));

  gap:12px;
  margin-top:6px;
}

.creator-layout .var-card{
  display:flex;
  flex-direction:column;

  gap:10px;
  padding:12px;

  line-height:1.4;
}

.creator-layout .var-card button{
  align-self:flex-start;
  padding:4px 10px;
  font-size:11px;
}

/* =========================
   CHARACTER LIBRARY
========================= */

.creator-layout .library-item{
  padding:12px 14px;
  margin-bottom:10px;

  border-radius:8px;

  background:rgba(255,255,255,0.03);

  cursor:pointer;

  transition:all 0.15s ease;
}

.creator-layout .library-item:hover{
  background:rgba(255,255,255,0.08);
}

.creator-layout .library-item div:last-child{
  font-size:12px;
  opacity:0.75;
  line-height:1.4;
}

.creator-layout .library-title{
  font-size:13px;
  font-weight:600;

  margin-bottom:6px;

  color:rgba(255,255,255,0.95);
}

.creator-layout .library-item.active{
  background:rgba(79,70,229,0.25);

  border:1px solid rgba(99,102,241,0.6);
}

/* =========================
   RESPONSIVE LAYOUTS
========================= */

@media(max-width:1024px){

  .creator-layout .grid-4{
    grid-template-columns:1fr 1fr;
  }

}

@media(max-width:768px){

  .creator-layout .grid-4,
  .creator-layout .grid-2,
  .creator-layout .output-grid{
    grid-template-columns:1fr;
  }

  .hero-title{
    flex-direction:column;
    text-align:center;
  }

  .hero h1{
    font-size:38px;
  }

  .container{
    padding:20px 14px;
  }

  .access-card{
    padding:50px 24px;
  }

  .top-buttons,
  .bottom-buttons{
    flex-direction:column;
  }

  .button{
    width:100%;
  }

}

/* =========================
   EXPLORER MOBILE BUTTONS
========================= */

@media(max-width:768px){

  .explorer-layout .top-buttons,
  .explorer-layout .bottom-buttons{
    display:flex;
    flex-direction:column;
    align-items:center;

    gap:12px;

    width:100%;
  }

  .explorer-layout .top-buttons .button,
  .explorer-layout .bottom-buttons .button{
    width:100%;
    max-width:280px;
  }

}