/* layout.css — enhanced professional layout system */

/* === MAIN APP CONTAINER === */
.app{
  min-height:calc(100vh - 64px);
  width:100%;
  margin:0;
  padding:0;
  background: var(--bg);
}

/* Sidebar removed - using header navigation instead */

/* === WORKSPACE === */
.app-workspace{
  width:100%;
  min-height:calc(100vh - 64px);
  position:relative;
}

/* === PANELS === */
.panel{
  padding:0;
  width:100%;
  min-height:calc(100vh - 64px);
  height:auto;
  display:flex;
  flex-direction:column;
  background:transparent;
  border:0;
  box-shadow:none;
}

.panel__head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:4px 10px;
  border-bottom:1px solid var(--line);
  background:rgba(255,255,255,.02);
  position:relative;
  min-height: 28px;
}
.panel__head::after{
  content:'';
  position:absolute;
  bottom:0;
  left:10px;
  right:10px;
  height:1px;
  background:linear-gradient(90deg, transparent, var(--line), transparent);
}
.title{
  font-weight:600;
  font-size:10px;
  letter-spacing:.3px;
  text-transform: uppercase;
}

.panel .actions{
  display:flex;
  gap:6px;
  align-items:center;
}

/* === CANVAS & PREVIEW AREAS === */
.canvas-wrap, .preview-wrap{
  min-height:600px;
  border:1px solid var(--line);
  border-radius:var(--radius);
  overflow: hidden;
  background:linear-gradient(135deg, #0d1117 0%, #0a0d12 100%);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.06),
    0 8px 32px rgba(0,0,0,.2);
  position: relative;
}
html[data-theme="light"] .canvas-wrap, 
html[data-theme="light"] .preview-wrap{
  background:linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
}

canvas{
  display:block;
  width:100%;
  height:auto;
  max-height:65vh;
}

.crosshair{
  position:absolute;
  width:16px;
  height:16px;
  border:2px solid #fff;
  border-radius:50%;
  pointer-events:none;
  transform:translate(-50%,-50%);
  filter:drop-shadow(0 0 8px rgba(0,0,0,.6));
  box-shadow:0 0 0 1px rgba(0,0,0,.3);
}

#previewFrame{
  width:100%;
  height:100%;
  min-height:calc(100vh - 200px);
  border:0;
  display:block;
  background:transparent;
}

/* Preview mode specific styling */
[data-view="preview"] .preview-wrap {
  min-height: calc(100vh - 180px);
  height: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
}

[data-view="preview"] .card {
  margin: 16px;
  padding: 0;
  display: flex;
  flex-direction: column;
  height: calc(100vh - 96px);
}

[data-view="preview"] .panel-header--compact {
  flex-shrink: 0;
}

/* === GRADIENT DISPLAY === */
#gradient{
  height:200px;
  border-radius:14px;
  border:1px solid var(--line);
  margin:16px;
  margin-top: 0;
  box-shadow:
    0 8px 32px rgba(0,0,0,.15),
    inset 0 1px 0 rgba(255,255,255,.1);
  position:relative;
  overflow:hidden;
}
#gradient::before{
  content:'';
  position:absolute;
  inset:0;
  border-radius:inherit;
  background:linear-gradient(180deg, rgba(255,255,255,.12), rgba(255,255,255,0) 60%);
  pointer-events:none;
}
#gradient::after{
  content:'';
  position:absolute;
  inset:0;
  border-radius:inherit;
  box-shadow:inset 0 0 0 1px rgba(255,255,255,.08);
  pointer-events:none;
}

/* === CARDS IN PANELS === */
.panel .card{
  margin:16px;
  padding:0;
}

.panel .card:first-child {
  margin-top: 16px;
}

.panel .card.glass {
  padding: 20px;
}

/* === ENHANCED TEXTAREA/INPUTS === */
#jsonOut, #gradCss{
  width:100%;
  height:180px;
  background:var(--panel-2);
  border:1px solid var(--line);
  border-radius:12px;
  color:var(--text);
  padding:16px;
  font-family:'SF Mono', Monaco, 'Cascadia Code', monospace;
  font-size:13px;
  line-height:1.5;
  resize:vertical;
  transition:border-color .2s ease;
}
#jsonOut:focus, #gradCss:focus{
  outline:none;
  border-color:var(--ring);
  box-shadow:0 0 0 3px rgba(91,140,255,.1);
}

/* === FOOTER === */
.footer{
  padding:16px 20px;
  border-top:1px solid var(--line);
  opacity:.7;
  font-size:14px;
  text-align:center;
  background:var(--panel);
  margin-top:auto;
}

/* === RESPONSIVE DESIGN === */
@media (max-width:768px){
  .panel .card{
    margin:12px;
  }
  .panel__head{
    padding:4px 10px;
  }
  canvas{
    max-height:50vh;
  }

  [data-view="preview"] .card {
    margin: 12px;
    height: calc(100vh - 88px);
  }

  #previewFrame {
    min-height: calc(100vh - 150px);
  }
}

/* === SPECIAL LAYOUT FOR IMAGE VIEW === */
[data-view="image"]{
  grid-template-rows:auto 1fr auto;
}
[data-view="image"] .canvas-wrap{
  flex:1 1 auto;
  min-height:0;
  overflow:hidden;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
}
[data-view="image"] .image-swatches{
  margin:0;
  border-top:1px solid var(--line);
  border-radius:0;
  background:rgba(255,255,255,.02);
}

/* === SCROLL STYLING === */
*::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
*::-webkit-scrollbar-track {
  background: var(--panel-2);
  border-radius: 4px;
}
*::-webkit-scrollbar-thumb {
  background: var(--line);
  border-radius: 4px;
}
*::-webkit-scrollbar-thumb:hover {
  background: var(--ring);
}

/* === ENHANCED FOCUS STATES === */
.panel:focus-within {
  box-shadow: 
    0 8px 32px rgba(0,0,0,.15),
    0 0 0 2px var(--ring),
    inset 0 1px 0 rgba(255,255,255,.1);
}

/* === LOADING STATES === */
.panel.loading {
  position: relative;
}
.panel.loading::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.1);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

/* === ANIMATION IMPROVEMENTS === */
@media (prefers-reduced-motion: no-preference) {
  .panel {
    animation: slideIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  }
  
  @keyframes slideIn {
    from {
      opacity: 0;
      transform: translateY(20px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
}