/* ESigny AI - Design System & Custom Styles */

:root {
  --teal: #2dd4bf;
  --slate: #0f172a;
  --slate-dark: #020617;
}

/* Core Layout */
body {
  background: radial-gradient(circle at top left, #1e293b, var(--slate-dark));
  color: #f1f5f9;
  font-family: 'Inter', sans-serif;
  display: flex;
  flex-direction: column;
}

/* Desktop-specific layout rules */
@media (min-width: 1024px) {
  body {
    height: 100vh;
    overflow: hidden;
  }
}

/* Mobile/Tablet-specific layout rules */
@media (max-width: 1023px) {
  body {
    min-height: 100vh;
    overflow-y: auto;
  }
  
  /* Ensure the Master Studio Output preview panel has sufficient height on mobile */
  #sd {
    min-height: 380px;
  }
}

/* Glassmorphism Panel */
.glass {
  background: rgba(255, 255, 255, 0.02);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 24px;
}

/* Decorative Background Grid */
.bg-grid {
  background-image: 
    linear-gradient(45deg, rgba(255, 255, 255, 0.03) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(255, 255, 255, 0.03) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(255, 255, 255, 0.03) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(255, 255, 255, 0.03) 75%);
  background-size: 20px 20px;
}

/* White Background Mode overrides */
.bg-solid-white {
  background-color: #ffffff !important;
  background-image: none !important;
}

.bg-solid-white p,
.bg-solid-white span {
  color: #000000 !important;
}

/* Interactive elements */
.tab-btn.active {
  background: var(--teal);
  color: var(--slate-dark);
  font-weight: 900;
  box-shadow: 0 0 25px rgba(45, 212, 191, 0.4);
}

.variant-card {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: 2px solid transparent;
  cursor: pointer;
  overflow: hidden;
  background: #000000;
}

.variant-card.active {
  border-color: var(--teal);
  background: rgba(45, 212, 191, 0.1);
}

/* Loading Animations */
.loader {
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-top: 2px solid var(--teal);
  border-radius: 50%;
  width: 24px;
  height: 24px;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Drawing Canvas configuration */
canvas {
  touch-action: none;
  cursor: crosshair;
}

#pc {
  width: 100%;
  background: rgba(0, 0, 0, 0.3);
  height: 8px;
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 15px;
  display: none;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

#pb {
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, #2dd4bf, #0d9488);
  transition: width 0.4s ease;
}

/* Modal Popup Styles */
.modal-backdrop {
  background: rgba(2, 6, 23, 0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  opacity: 0;
  transition: opacity 0.25s ease;
}

.modal-content {
  background: rgba(15, 23, 42, 0.8) !important;
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  transform: scale(0.95);
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Modal state classes */
.modal-backdrop.show {
  opacity: 1;
}

.modal-backdrop.show .modal-content {
  transform: scale(1);
}
