/* ====================================================
   SVG Shape Generator — style.css
   Prefix: sg-
   ==================================================== */

.sg-container {
    max-width: 860px;
    margin: 0 auto;
}

/* ── Feature Banner ── */
.sg-feature-banner {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 28px;
    padding: 16px;
    background: linear-gradient(135deg, #eef2ff, #e0e7ff);
    border-radius: 12px;
}

.sg-feature-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 12px;
    line-height: 1.5;
}

.sg-feature-icon {
    font-size: 22px;
    flex-shrink: 0;
    line-height: 1.2;
}

.sg-feature-item strong {
    display: block;
    font-size: 12.5px;
    color: #3730a3;
}

.sg-feature-item p {
    margin: 2px 0 0;
    color: #6366f1;
    font-size: 11px;
}

/* ── Mode Tabs ── */
.sg-mode-tabs {
    display: flex;
    border-radius: 10px;
    overflow: hidden;
    border: 2px solid #e5e7eb;
    margin-bottom: 20px;
}

.sg-tab {
    flex: 1;
    padding: 13px 16px;
    font-size: 14.5px;
    font-weight: 700;
    background: #f9fafb;
    border: none;
    cursor: pointer;
    color: #6b7280;
    transition: background .2s, color .2s;
    text-align: center;
    font-family: inherit;
}

.sg-tab:hover {
    background: #f3f4f6;
}

.sg-tab-active {
    background: #6366f1;
    color: #fff;
}

.sg-tab-active:hover {
    background: #4f46e5;
}

/* ── Preview ── */
.sg-preview-wrap {
    margin-bottom: 20px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
}

.sg-preview-area {
    min-height: 280px;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    position: relative;
}

.sg-preview-area svg {
    display: block;
    width: 100%;
    height: auto;
}

.sg-preview-area path {
    transition: d 0.4s ease-out, fill 0.4s ease-out, opacity 0.4s ease-out;
}

.sg-preview-blob {
    align-items: center;
}

.sg-preview-bg-white {
    background: #fff;
}

.sg-preview-bg-dark {
    background: #1e1e2e;
}

.sg-preview-bg-checker {
    background-color: #fff;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16'%3E%3Crect width='8' height='8' fill='%23e5e7eb'/%3E%3Crect x='8' y='8' width='8' height='8' fill='%23e5e7eb'/%3E%3C/svg%3E");
    background-repeat: repeat;
}

.sg-preview-toolbar {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    gap: 4px;
    z-index: 5;
}

.sg-preview-bg-btn {
    width: 26px;
    height: 26px;
    border-radius: 6px;
    border: 2px solid #d1d5db;
    cursor: pointer;
    transition: border-color .15s;
}

.sg-preview-bg-btn:hover,
.sg-preview-bg-btn.active {
    border-color: #6366f1;
}

.sg-preview-bg-btn[data-bg="white"] {
    background: #fff;
}

.sg-preview-bg-btn[data-bg="dark"] {
    background: #1e1e2e;
}

.sg-preview-bg-btn[data-bg="checker"] {
    background-color: #fff;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8'%3E%3Crect width='4' height='4' fill='%23d1d5db'/%3E%3Crect x='4' y='4' width='4' height='4' fill='%23d1d5db'/%3E%3C/svg%3E");
    background-repeat: repeat;
}

/* ── Randomize Button ── */
.sg-btn-randomize {
    display: block;
    width: 100%;
    padding: 13px;
    background: #6366f1;
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    margin-bottom: 20px;
    transition: background .2s, transform .1s, box-shadow .2s;
    box-shadow: 0 2px 8px rgba(99, 102, 241, .25);
    font-family: inherit;
}

.sg-btn-randomize:hover {
    background: #4f46e5;
    box-shadow: 0 4px 14px rgba(79, 70, 229, .3);
}

.sg-btn-randomize:active {
    transform: scale(.97);
}

/* ── Controls ── */
.sg-controls-card {
    background: #fff;
    border: 1.5px solid #e5e7eb;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
}

.sg-controls-card h3 {
    font-size: 15px;
    font-weight: 700;
    color: #1f2937;
    margin: 0 0 16px;
    padding-bottom: 10px;
    border-bottom: 2px solid #eef2ff;
}

.sg-controls-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.sg-control-row {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.sg-control-row label {
    font-size: 13px;
    font-weight: 600;
    color: #4b5563;
}

.sg-slider-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
}

.sg-slider-wrap input[type="range"] {
    flex: 1;
    accent-color: #6366f1;
    height: 6px;
}

.sg-slider-value {
    font-size: 13px;
    font-weight: 700;
    color: #6366f1;
    min-width: 36px;
    text-align: right;
}

.sg-control-row input[type="number"] {
    padding: 8px 10px;
    border: 1.5px solid #d1d5db;
    border-radius: 8px;
    font-size: 13px;
    font-family: inherit;
    width: 100%;
    box-sizing: border-box;
}

.sg-control-row input[type="number"]:focus {
    outline: none;
    border-color: #6366f1;
}

.sg-control-row select {
    padding: 8px 10px;
    border: 1.5px solid #d1d5db;
    border-radius: 8px;
    font-size: 13px;
    font-family: inherit;
    background: #fff;
}

.sg-control-row select:focus {
    outline: none;
    border-color: #6366f1;
}

/* Color Inputs */
.sg-color-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sg-color-input {
    width: 44px;
    height: 36px;
    border: 2px solid #d1d5db;
    border-radius: 8px;
    cursor: pointer;
    padding: 2px;
    background: none;
}

.sg-color-input::-webkit-color-swatch-wrapper {
    padding: 0;
}

.sg-color-input::-webkit-color-swatch {
    border: none;
    border-radius: 5px;
}

.sg-color-hex {
    font-size: 13px;
    font-family: 'Consolas', 'Monaco', monospace;
    color: #6b7280;
    width: 65px;
}

.sg-color-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 12px;
}

.sg-btn-add-color {
    background: transparent;
    border: 1.5px dashed #818cf8;
    color: #4f46e5;
    border-radius: 6px;
    padding: 7px 12px;
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    width: fit-content;
    display: block;
    transition: background 0.15s, color 0.15s;
}

.sg-btn-add-color:hover {
    background: #eef2ff;
    color: #3730a3;
}

.sg-btn-remove-color {
    background: #fee2e2;
    color: #ef4444;
    border: none;
    border-radius: 4px;
    width: 24px;
    height: 24px;
    font-weight: bold;
    font-size: 14px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
}

.sg-btn-remove-color:hover {
    background: #fca5a5;
}

.sg-checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #4b5563;
    cursor: pointer;
}

.sg-checkbox-label input {
    accent-color: #6366f1;
}

/* Radio Group */
.sg-radio-group {
    display: flex;
    gap: 10px;
}

.sg-radio-group label {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
    color: #4b5563;
    cursor: pointer;
    font-weight: 400;
}

.sg-radio-group input {
    accent-color: #6366f1;
}

/* ── Code Output ── */
.sg-code-card {
    background: #fff;
    border: 1.5px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 20px;
}

.sg-code-tabs {
    display: flex;
    border-bottom: 2px solid #e5e7eb;
}

.sg-code-tab {
    flex: 1;
    padding: 10px 14px;
    font-size: 13px;
    font-weight: 600;
    background: #f9fafb;
    border: none;
    cursor: pointer;
    color: #6b7280;
    transition: background .15s, color .15s;
    font-family: inherit;
    text-align: center;
}

.sg-code-tab:hover {
    background: #f3f4f6;
}

.sg-code-tab-active {
    background: #1e1e2e;
    color: #cdd6f4;
}

.sg-code-block {
    background: #1e1e2e;
    color: #cdd6f4;
    padding: 16px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 12.5px;
    line-height: 1.6;
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-all;
    max-height: 260px;
    overflow-y: auto;
    margin: 0;
}

.sg-code-actions {
    display: flex;
    gap: 8px;
    padding: 12px 16px;
    border-top: 1px solid #e5e7eb;
    flex-wrap: wrap;
}

.sg-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 8px 14px;
    border: none;
    border-radius: 7px;
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s, transform .1s;
    font-family: inherit;
}

.sg-btn:active {
    transform: scale(.97);
}

.sg-btn-copy {
    background: #eef2ff;
    color: #4f46e5;
}

.sg-btn-copy:hover {
    background: #e0e7ff;
}

.sg-btn-copy.copied {
    background: #dcfce7;
    color: #16a34a;
}

.sg-btn-dl {
    background: #f3f4f6;
    color: #374151;
}

.sg-btn-dl:hover {
    background: #e5e7eb;
}

/* ── Responsive ── */
@media (max-width: 768px) {
    .sg-feature-banner {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .sg-controls-grid {
        grid-template-columns: 1fr;
    }

    .sg-code-actions {
        flex-direction: column;
    }

    .sg-btn {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .sg-feature-banner {
        grid-template-columns: 1fr;
    }
}