:root {
  --bg: #f8fafc;
  --panel: #ffffff;
  --border: #e2e8f0;
  --text: #1e293b;
  --accent: #3b82f6;
}

main {
    display: grid;
    grid-template-columns: 380px 1fr;
    min-height: calc(100vh - 150px);
    align-items: start;
}

.controls {
    padding-right: 24px;
	border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.section {
    background: #ffffff;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05), 0 1px 2px rgba(0,0,0,0.1);
    border: 1px solid #e2e8f0;
    margin-bottom: 0;
}

.section h3 {
    font-size: 1rem;
    color: #64748b;
    margin-top: 0;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.section input[type="text"], .section select {
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.section input[type="text"]:focus, .section select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}
.section label {
  display: block;
  font-size: 0.8rem;
  margin-bottom: 5px;
  font-weight: 600;
  color: #475569;
}
.section input[type="text"],
.section select {
  width: 100%;
  padding: 8px;
  border-radius: 6px;
  border: 1px solid var(--border);
  margin-bottom: 10px;
  font-size: 0.85rem;
}
.section input[type="range"] {
  width: 100%;
  cursor: pointer;
  margin-bottom: 10px;
}

.toggle-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 10px;
}

.toggle-group label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    font-weight: 500;
    font-size: 0.85rem;
}

.toggle-group input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 34px;
    height: 18px;
    background: #cbd5e1;
    border-radius: 20px;
    position: relative;
    cursor: pointer;
    transition: background 0.3s;
}

.toggle-group input[type="checkbox"]::before {
    content: "";
    position: absolute;
    width: 14px;
    height: 14px;
    background: white;
    border-radius: 50%;
    top: 2px;
    left: 2px;
    transition: transform 0.3s;
}

.toggle-group input[type="checkbox"]:checked {
    background: #3b82f6;
}

.toggle-group input[type="checkbox"]:checked::before {
    transform: translateX(16px);
}

.color-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; margin-bottom: 10px; }
.color-item { display: flex; flex-direction: column; }
.color-item input { width: 100%; height: 30px; border: 1px solid var(--border); padding: 2px; cursor: pointer; background: #fff; }

.preset-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 5px;
  margin-bottom: 10px;
}
.preset-btn {
  border: none;
  padding: 8px 4px;
  border-radius: 4px;
  color: white;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: bold;
}
.toggle-group {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  font-size: 0.8rem;
}
#genBtn {
  width: 100%;
  padding: 10px 14px;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 8px;
  font-weight: 700;
  cursor: pointer;
  margin-top: 10px;
  margin-bottom: 20px;
}
.preview-pane {
    position: sticky;
    top: 80px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    min-height: 400px;
    margin: 0 0 20px 20px;
    border-radius: 12px;
	background: radial-gradient(circle at center, #ffffff 0%, #cbd5e1 100%);
    box-shadow: inset 0 0 100px rgba(0,0,0,0.05);
    border: 1px solid #94a3b8;	
}

#livePreview {
    transition: all 0.3s ease;
    filter: drop-shadow(0 20px 25px rgba(0, 0, 0, 0.15));
    transform: translateY(-5px);
}

@media (max-width: 850px) {
    main {
        grid-template-columns: 1fr;
    }
    
    .preview-pane {
        position: relative;
        top: 0;
        margin: 10px;
        order: -1;
    }
    
    .controls {
        padding: 15px;
    }
}

.toast-container {
  position: fixed;
  z-index: 9999;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
  width: 100%;
  max-width: 450px;
}
[data-position="tc"] {
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  align-items: center;
}
[data-position="bc"] {
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  align-items: center;
  flex-direction: column-reverse;
}
[data-position="tr"] {
  top: 0;
  right: 0;
  align-items: flex-end;
}
[data-position="tl"] {
  top: 0;
  left: 0;
  align-items: flex-start;
}
[data-position="br"] {
  bottom: 0;
  right: 0;
  align-items: flex-end;
  flex-direction: column-reverse;
}
[data-position="bl"] {
  bottom: 0;
  left: 0;
  align-items: flex-start;
  flex-direction: column-reverse;
}

.toast {
  pointer-events: auto;
  min-width: 320px;
  display: flex;
  gap: 12px;
  position: relative;
  overflow: hidden;
  background: #fff;
}
.toast-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.toast-content {
  flex: 1;
}
.toast-title {
  display: block;
  font-weight: 800;
  margin-bottom: 2px;
}
.toast-msg {
  font-size: 0.85rem;
  opacity: 0.9;
}
.toast-close {
  background: none;
  border: none;
  color: inherit;
  cursor: pointer;
  font-size: 1.2rem;
  opacity: 0.5;
  margin-left: auto;
  padding: 0;
  line-height: 1;
}
.toast-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 5px;
  width: 100%;
  background: var(--toast-accent-color);
  opacity: 0.4;
  transform-origin: left;
  transform: scaleX(1);
  z-index: 5;
}

#livePreview .toast-progress {
    width: 60% !important; 
}

.style-solid {
  color: white !important;
}
.style-solid .toast-progress {
  background: rgba(255, 255, 255, 0.7);
  opacity: 1;
}
.style-accent {
  border: 1px solid var(--toast-accent-color);
  border-left: 6px solid var(--toast-accent-color);
}
.style-bordered {
  border: 2px solid var(--toast-accent-color);
}

@keyframes slideInRight {
  from {
    transform: translateX(120%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}
@keyframes slideOutRight {
  to {
    transform: translateX(120%);
    opacity: 0;
  }
}
@keyframes slideInLeft {
  from {
    transform: translateX(-120%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}
@keyframes slideOutLeft {
  to {
    transform: translateX(-120%);
    opacity: 0;
  }
}
@keyframes slideInUp {
  from {
    transform: translateY(100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}
@keyframes slideOutDown {
  to {
    transform: translateY(100%);
    opacity: 0;
  }
}
@keyframes slideInDown {
  from {
    transform: translateY(-100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}
@keyframes slideOutUp {
  to {
    transform: translateY(-100%);
    opacity: 0;
  }
}
@keyframes shake {
  0%,
  100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-8px);
  }
  75% {
    transform: translateX(8px);
  }
}
@keyframes zoomIn {
  from {
    transform: scale(0.8);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin: 20px 0;
    background: #ffffff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    border: 1px solid #e2e8f0;
}

thead th {
    background-color: #f8fafc;
    color: #64748b;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 12px 20px;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
}

tbody td {
    padding: 16px 20px;
    font-size: 0.9rem;
    line-height: 1.5;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: top;
}

tbody tr:nth-child(even) {
    background-color: #fcfdfe;
}

tbody tr:hover {
    background-color: #f1f5f9;
    transition: background-color 0.2s ease;
}

tbody td:first-child {
    font-weight: 600;
    color: #334155;
    width: 30%;
}

tbody tr:last-child td {
    border-bottom: none;
}