/* ==========================================================================
   PSDreviews Design Tools — Shared Frontend Styles
   Loaded on every page where a tool shortcode is present.
   ========================================================================== */

/* ── Tool wrapper ─────────────────────────────────────────────────────────── */

.psdt-tool-wrapper {
    box-sizing: border-box;
    /* Break out of the WordPress content column.
       Works for Classic Editor, Gutenberg, and most themes.
       If your theme has overflow:hidden on a parent, remove the
       position/left/transform lines and set a manual width instead. */
    width: calc(100vw - 2rem);
    max-width: 1160px;
    position: relative;
    left: 50%;
    transform: translateX(-50%);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen,
                 Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
    font-size: 16px;
    line-height: 1.5;
    color: #1a1a2e;
}

.psdt-tool-wrapper *,
.psdt-tool-wrapper *::before,
.psdt-tool-wrapper *::after {
    box-sizing: inherit;
}

/* Loading state */
.psdt-loading {
    padding: 2rem;
    text-align: center;
    color: #888;
    font-size: 0.9rem;
    animation: psdt-pulse 1.5s ease-in-out infinite;
}

@keyframes psdt-pulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.4; }
}

/* ── Coming Soon card ────────────────────────────────────────────────────── */

.psdt-coming-soon {
    border: 2px dashed #d0d5e8;
    border-radius: 16px;
    padding: 3rem 2rem;
    text-align: center;
    background: linear-gradient(135deg, #f8f9ff 0%, #eef0fb 100%);
}

.psdt-cs-inner {
    max-width: 480px;
    margin: 0 auto;
}

.psdt-cs-icon {
    display: block;
    font-size: 3rem;
    margin-bottom: 0.75rem;
    line-height: 1;
}

.psdt-cs-title {
    margin: 0 0 0.5rem;
    font-size: 1.35rem;
    font-weight: 700;
    color: #1a1a2e;
}

.psdt-cs-desc {
    margin: 0 0 1.25rem;
    color: #555;
    font-size: 0.95rem;
}

.psdt-cs-badge {
    display: inline-block;
    padding: 0.3rem 1rem;
    background: #c8001c;
    color: #fff;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

/* ── Utility: Copy button (reused across multiple tools) ─────────────────── */

.psdt-copy-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.55rem 1.1rem;
    background: #006ab8;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
}

.psdt-copy-btn:hover  { background: #005a9e; }
.psdt-copy-btn:active { transform: scale(0.97); }

.psdt-copy-btn.psdt-copied {
    background: #22c55e;
}

/* ── Utility: Code block output ─────────────────────────────────────────── */

.psdt-output-code {
    display: block;
    padding: 1rem 1.25rem;
    background: #1a1a2e;
    color: #a8d8a8;
    font-family: "Fira Code", "Cascadia Code", "Courier New", monospace;
    font-size: 0.85rem;
    border-radius: 10px;
    overflow-x: auto;
    white-space: pre;
    margin: 1rem 0;
    word-break: break-all;
}

/* ── Utility: Input / Label common styles ────────────────────────────────── */

.psdt-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: #444;
    margin-bottom: 0.35rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.psdt-input,
.psdt-select {
    width: 100%;
    padding: 0.6rem 0.85rem;
    border: 1.5px solid #d0d5e8;
    border-radius: 8px;
    font-size: 0.95rem;
    color: #1a1a2e;
    background: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
    appearance: none;
}

.psdt-input:focus,
.psdt-select:focus {
    outline: none;
    border-color: #c8001c;
    box-shadow: 0 0 0 3px rgba(200, 0, 28, 0.12);
}

/* ── Utility: Range slider ───────────────────────────────────────────────── */

.psdt-range {
    -webkit-appearance: none;
    width: 100%;
    height: 5px;
    border-radius: 999px;
    background: #d0d5e8;
    outline: none;
    cursor: pointer;
}

.psdt-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #c8001c;
    cursor: pointer;
    box-shadow: 0 1px 4px rgba(200, 0, 28, 0.35);
    transition: transform 0.15s;
}

.psdt-range::-webkit-slider-thumb:hover {
    transform: scale(1.15);
}

.psdt-range::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border: none;
    border-radius: 50%;
    background: #c8001c;
    cursor: pointer;
}

/* ── Utility: Color swatch ───────────────────────────────────────────────── */

.psdt-color-swatch {
    display: inline-block;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: 2px solid rgba(0,0,0,0.08);
    cursor: pointer;
    vertical-align: middle;
    flex-shrink: 0;
}

/* ── Utility: Section heading inside a tool ──────────────────────────────── */

.psdt-section-title {
    font-size: 1rem;
    font-weight: 700;
    color: #1a1a2e;
    margin: 1.5rem 0 0.75rem;
    padding-bottom: 0.4rem;
    border-bottom: 2px solid #eef0fb;
}

/* ── Utility: Two-column grid ────────────────────────────────────────────── */

.psdt-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

@media ( max-width: 600px ) {
    .psdt-grid-2 { grid-template-columns: 1fr; }
}

/* On mobile, remove the desktop content-column breakout and flow normally */
@media ( max-width: 640px ) {
    .psdt-tool-wrapper {
        width: 100%;
        max-width: 100%;
        left: 0;
        transform: none;
        position: static;
    }
}

/* ── Utility: Alert / notice ─────────────────────────────────────────────── */

.psdt-notice {
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    margin: 0.75rem 0;
}

.psdt-notice--info    { background: #eff6ff; color: #1d4ed8; border-left: 4px solid #3b82f6; }
.psdt-notice--success { background: #f0fdf4; color: #15803d; border-left: 4px solid #22c55e; }
.psdt-notice--warn    { background: #fffbeb; color: #92400e; border-left: 4px solid #f59e0b; }
