/* ==========================================================================
   PSDreviews — CSS Gradient Maker
   ========================================================================== */

.gm-wrap {
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 4px 32px rgba(13, 14, 20, 0.08), 0 1px 4px rgba(0,0,0,0.04);
    overflow: hidden;
}

/* ── Type tabs ───────────────────────────────────────────────────────────── */

.gm-tabs {
    display: flex;
    background: #f8f8fb;
    border-bottom: 2px solid #e0e4ed;
    padding: 0 1.5rem;
}

.gm-tab {
    padding: 0.85rem 1.4rem;
    font-size: 0.88rem;
    font-weight: 700;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    cursor: pointer;
    color: #5a6070;
    transition: color 0.2s, border-color 0.2s, background 0.2s;
    white-space: nowrap;
}

.gm-tab:hover        { color: #0d0e14; background: #fff2f3; }
.gm-tab--active      { color: #0d0e14; border-bottom-color: #c8001c; background: #fff; }

/* ── Preview strip ───────────────────────────────────────────────────────── */

.gm-preview {
    width: 100%;
    height: 210px;
    display: block;
    background: linear-gradient(135deg, #006ab8 0%, #c8001c 100%);
    transition: background 0.25s ease;
    position: relative;
    cursor: crosshair;
}

.gm-preview-label {
    position: absolute;
    bottom: 0.65rem;
    right: 0.85rem;
    font-size: 0.72rem;
    font-weight: 700;
    color: rgba(255,255,255,0.75);
    text-transform: uppercase;
    letter-spacing: 0.07em;
    text-shadow: 0 1px 3px rgba(0,0,0,0.4);
    user-select: none;
    pointer-events: none;
}

/* ── Main controls area ──────────────────────────────────────────────────── */

.gm-body {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 0;
    min-height: 260px;
}

/* ── Left panel: gradient-type controls ──────────────────────────────────── */

.gm-left {
    padding: 1.5rem;
    border-right: 1.5px solid #eef0fb;
    display: flex;
    flex-direction: column;
    gap: 1.1rem;
}

.gm-ctrl-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.gm-ctrl-label {
    font-size: 0.75rem;
    font-weight: 800;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.07em;
}

/* Quick direction buttons */
.gm-dir-btns {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.35rem;
}

.gm-dir-btn {
    padding: 0.38rem 0;
    font-size: 1rem;
    background: #f8f8fb;
    border: 1.5px solid #e0e4ed;
    border-radius: 8px;
    cursor: pointer;
    color: #555;
    transition: background 0.15s, border-color 0.15s;
    text-align: center;
    line-height: 1;
}

.gm-dir-btn:hover    { background: #fff2f3; border-color: #c8001c; color: #c8001c; }
.gm-dir-btn--active  { background: #0d0e14; border-color: #0d0e14; color: #fff; }

/* Angle slider row */
.gm-angle-row {
    display: grid;
    grid-template-columns: 1fr 52px;
    gap: 0.5rem;
    align-items: center;
}

.gm-angle-val {
    font-family: "Fira Code", "Courier New", monospace;
    font-size: 0.82rem;
    font-weight: 700;
    color: #1a1a2e;
    text-align: right;
}

/* Radial: shape toggle */
.gm-shape-btns {
    display: flex;
    gap: 0.4rem;
}

.gm-shape-btn {
    flex: 1;
    padding: 0.42rem;
    font-size: 0.8rem;
    font-weight: 700;
    background: #f8f8fb;
    border: 1.5px solid #e0e4ed;
    border-radius: 8px;
    cursor: pointer;
    color: #555;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
    text-align: center;
}

.gm-shape-btn:hover   { background: #fff2f3; border-color: #c8001c; color: #c8001c; }
.gm-shape-btn--active { background: #0d0e14; border-color: #0d0e14; color: #fff; }

/* Radial: position grid */
.gm-pos-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.3rem;
}

.gm-pos-btn {
    padding: 0.32rem;
    font-size: 0.65rem;
    font-weight: 700;
    background: #f8f8fb;
    border: 1.5px solid #e0e4ed;
    border-radius: 6px;
    cursor: pointer;
    color: #666;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
    text-align: center;
    text-transform: capitalize;
    white-space: nowrap;
}

.gm-pos-btn:hover   { background: #fff2f3; border-color: #c8001c; color: #c8001c; }
.gm-pos-btn--active { background: #0d0e14; border-color: #0d0e14; color: #fff; }

/* ── Right panel: color stops ────────────────────────────────────────────── */

.gm-right {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.gm-stops-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.gm-stops-title {
    font-size: 0.75rem;
    font-weight: 800;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.07em;
}

.gm-add-stop-btn {
    padding: 0.28rem 0.75rem;
    font-size: 0.78rem;
    font-weight: 700;
    background: #fff;
    color: #006ab8;
    border: 1.5px dashed #b8d9f4;
    border-radius: 20px;
    cursor: pointer;
    transition: background 0.18s, border-color 0.18s;
}

.gm-add-stop-btn:hover    { background: #eff7ff; border-color: #006ab8; }
.gm-add-stop-btn:disabled { opacity: 0.4; cursor: not-allowed; }

.gm-stops-list {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

/* One stop row */
.gm-stop {
    display: grid;
    grid-template-columns: 32px 1fr 48px 28px;
    align-items: center;
    gap: 0.5rem;
    background: #f8f8fb;
    border: 1.5px solid #e0e4ed;
    border-radius: 10px;
    padding: 0.5rem 0.65rem;
    transition: border-color 0.2s;
}

.gm-stop:hover { border-color: #c8d4e0; }

.gm-stop-color {
    -webkit-appearance: none;
    width: 32px;
    height: 30px;
    border: 2px solid #d0d5e8;
    border-radius: 7px;
    cursor: pointer;
    padding: 2px;
    background: #fff;
    flex-shrink: 0;
    transition: border-color 0.2s;
}

.gm-stop-color:hover                            { border-color: #0d0e14; }
.gm-stop-color::-webkit-color-swatch-wrapper    { padding: 0; }
.gm-stop-color::-webkit-color-swatch           { border: none; border-radius: 4px; }
.gm-stop-color::-moz-color-swatch             { border: none; border-radius: 4px; }

.gm-stop-pos-val {
    font-family: "Fira Code", "Courier New", monospace;
    font-size: 0.75rem;
    font-weight: 700;
    color: #1a1a2e;
    text-align: right;
    white-space: nowrap;
}

.gm-stop-remove {
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: 1.5px solid #d0d5e8;
    border-radius: 6px;
    font-size: 0.7rem;
    color: #aaa;
    cursor: pointer;
    transition: color 0.18s, border-color 0.18s, background 0.18s;
    padding: 0;
    line-height: 1;
    flex-shrink: 0;
}

.gm-stop-remove:hover    { color: #ef4444; border-color: #ef4444; background: #fee2e2; }
.gm-stop-remove:disabled { opacity: 0.3; cursor: not-allowed; }

/* ── Presets strip ───────────────────────────────────────────────────────── */

.gm-presets-strip {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.85rem 1.5rem;
    border-top: 1.5px solid #eef0fb;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.gm-presets-strip::-webkit-scrollbar { display: none; }

.gm-presets-label {
    font-size: 0.72rem;
    font-weight: 800;
    color: #aaa;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    white-space: nowrap;
    flex-shrink: 0;
    margin-right: 0.25rem;
}

.gm-preset-btn {
    padding: 0;
    border: 2.5px solid #e0e4ed;
    border-radius: 8px;
    cursor: pointer;
    flex-shrink: 0;
    overflow: hidden;
    width: 52px;
    height: 34px;
    transition: border-color 0.18s, transform 0.15s;
    background: none;
    position: relative;
}

.gm-preset-btn:hover      { border-color: #0d0e14; transform: translateY(-2px); }
.gm-preset-btn--active    { border-color: #c8001c; border-width: 2.5px; }

.gm-preset-swatch {
    display: block;
    width: 100%;
    height: 100%;
}

.gm-preset-name {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    font-size: 0.55rem;
    font-weight: 800;
    text-align: center;
    padding: 0.1rem 0.2rem;
    background: rgba(0,0,0,0.45);
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

/* ── CSS output ──────────────────────────────────────────────────────────── */

.gm-output {
    padding: 1.25rem 1.5rem 1.5rem;
    border-top: 1.5px solid #eef0fb;
}

.gm-output-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.6rem;
}

.gm-output-label {
    font-size: 0.8rem;
    font-weight: 800;
    color: #1a1a2e;
    text-transform: uppercase;
    letter-spacing: 0.07em;
}

.gm-copy-row {
    display: flex;
    gap: 0.65rem;
    flex-wrap: wrap;
    margin-top: 0.85rem;
}

/* ── Responsive — Tablet ─────────────────────────────────────────────────── */

@media (max-width: 760px) {
    .gm-body {
        grid-template-columns: 1fr;
    }

    .gm-left {
        border-right: none;
        border-bottom: 1.5px solid #eef0fb;
        padding: 1.25rem;
    }

    .gm-right { padding: 1.25rem; }
    .gm-output { padding: 1.25rem; }
    .gm-preview { height: 170px; }
}

/* ── Responsive — Small phone ────────────────────────────────────────────── */

@media (max-width: 480px) {
    .gm-tabs { padding: 0 0.75rem; overflow-x: auto; scrollbar-width: none; }
    .gm-tabs::-webkit-scrollbar { display: none; }
    .gm-tab  { padding: 0.7rem 0.9rem; font-size: 0.8rem; flex-shrink: 0; }

    .gm-preview { height: 140px; }

    .gm-dir-btns { grid-template-columns: repeat(4, 1fr); }

    .gm-stop { grid-template-columns: 28px 1fr 42px 24px; }

    .gm-copy-row              { flex-direction: column; }
    .gm-copy-row .psdt-copy-btn { width: 100%; justify-content: center; }

    .gm-preset-btn { width: 44px; height: 30px; }
}
