/* ============================================================
   UCT Shared Design System
   Used by all individual tool pages
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&display=swap');

:root {
    --uct-primary: #3b82f6;
    --uct-primary-hover: #2563eb;
    --uct-accent: #0f172a;
    /* --uct-bg: #f1f5f9; */
    --uct-card-bg: #ffffff;
    --uct-border: #e2e8f0;
    --uct-text: #1e293b;
    --uct-text-light: #64748b;
    --uct-success: #22c55e;
    --uct-danger: #ef4444;
    --uct-radius: 0.875rem;
    --uct-shadow: 0 1px 3px rgba(0, 0, 0, .08), 0 4px 12px rgba(0, 0, 0, .06);
    --uct-shadow-lg: 0 10px 40px rgba(0, 0, 0, .12);
    --sidebar-w: 300px;
}

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html,
body {
    height: 100%;
    font-family: 'Outfit', system-ui, sans-serif;
    background: var(--uct-bg);
    color: var(--uct-text);
    font-size: 15px;
    line-height: 1.6;
}

/* ── Top Nav Bar ─────────────────────────────────────────── */
.uct-nav {
    background: white;
    border-bottom: 1px solid var(--uct-border);
    padding: 0 2rem;
    height: 60px;
    display: flex;
    align-items: center;
    gap: 1rem;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 4px rgba(0, 0, 0, .06);
}

.uct-nav-brand {
    font-weight: 800;
    font-size: 1.1rem;
    background: linear-gradient(135deg, var(--uct-primary), var(--uct-accent));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-decoration: none;
    white-space: nowrap;
}

.uct-nav-sep {
    color: var(--uct-border);
    font-size: 1.2rem;
}

.uct-nav-tool {
    font-weight: 600;
    color: var(--uct-text);
    font-size: 0.95rem;
}

.uct-back-btn {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1.25rem;
    border-radius: 2rem;
    border: 1.5px solid var(--uct-border);
    background: white;
    color: var(--uct-text);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    text-decoration: none;
    transition: all .25s ease;
}

.uct-back-btn:hover {
    border-color: var(--uct-primary);
    color: var(--uct-primary);
    transform: translateX(-3px);
}

/* ── Page Layout ─────────────────────────────────────────── */
.uct-page {
    display: flex;
    height: calc(100vh - 60px);
    overflow: hidden;
}

/* ── Sidebar ─────────────────────────────────────────────── */
.uct-sidebar {
    width: var(--sidebar-w);
    flex-shrink: 0;
    background: white;
    border-right: 1px solid var(--uct-border);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    padding: 1.5rem;
    gap: 0;
}

.uct-sidebar-title {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: var(--uct-text-light);
    margin-bottom: 1.25rem;
    padding-bottom: .75rem;
    border-bottom: 2px solid var(--uct-border);
}

/* ── Main Area ───────────────────────────────────────────── */
.uct-main {
    flex: 1;
    overflow-y: auto;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    min-width: 0;
}

/* ── Input Groups ────────────────────────────────────────── */
.uct-group {
    display: flex;
    flex-direction: column;
    gap: .4rem;
    margin-bottom: 1.1rem;
}

.uct-group label {
    font-size: .85rem;
    font-weight: 600;
    color: var(--uct-text);
}

.uct-input,
.uct-select,
.uct-textarea {
    width: 100%;
    padding: .65rem .9rem;
    border: 1.5px solid var(--uct-border);
    border-radius: .6rem;
    font-family: inherit;
    font-size: .95rem;
    background: var(--uct-bg);
    color: var(--uct-text);
    transition: border-color .2s, box-shadow .2s;
    outline: none;
}

.uct-input:focus,
.uct-select:focus,
.uct-textarea:focus {
    border-color: var(--uct-primary);
    background: white;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, .12);
}

.uct-textarea {
    resize: vertical;
    min-height: 160px;
    font-family: 'Outfit', monospace;
    line-height: 1.7;
}

/* ── Buttons ─────────────────────────────────────────────── */
.uct-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    padding: .7rem 1.4rem;
    border-radius: .65rem;
    border: none;
    font-family: inherit;
    font-size: .95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all .25s ease;
    text-decoration: none;
    white-space: nowrap;
}

.uct-btn-primary {
    background: linear-gradient(135deg, var(--uct-primary), var(--uct-primary-hover));
    color: white;
    box-shadow: 0 4px 12px rgba(59, 130, 246, .3);
    width: 100%;
}

.uct-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(59, 130, 246, .4);
}

.uct-btn-secondary {
    background: white;
    color: var(--uct-text);
    border: 1.5px solid var(--uct-border);
    width: 100%;
    margin-top: .5rem;
}

.uct-btn-secondary:hover {
    border-color: var(--uct-primary);
    color: var(--uct-primary);
}

.uct-btn-ghost {
    background: transparent;
    color: var(--uct-text-light);
    border: 1.5px solid var(--uct-border);
    font-size: .85rem;
    padding: .45rem .9rem;
}

.uct-btn-ghost:hover {
    background: var(--uct-bg);
    color: var(--uct-text);
}

/* ── Divider ─────────────────────────────────────────────── */
.uct-divider {
    height: 1px;
    background: var(--uct-border);
    margin: 1rem 0;
}

/* ── Cards / Panels ──────────────────────────────────────── */
.uct-panel {
    background: white;
    border: 1px solid var(--uct-border);
    border-radius: var(--uct-radius);
    padding: 1.5rem;
    box-shadow: var(--uct-shadow);
}

.uct-panel-title {
    font-size: .8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--uct-text-light);
    margin-bottom: 1rem;
}

/* ── Split View (side-by-side) ───────────────────────────── */
.uct-split {
    display: flex;
    gap: 1.25rem;
    flex: 1;
    min-height: 0;
}

.uct-split>.uct-pane {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    background: white;
    border: 1px solid var(--uct-border);
    border-radius: var(--uct-radius);
    overflow: hidden;
}

.uct-pane-header {
    padding: .75rem 1rem;
    background: var(--uct-bg);
    border-bottom: 1px solid var(--uct-border);
    font-size: .8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--uct-text-light);
    display: flex;
    align-items: center;
    gap: .5rem;
}

.uct-pane-body {
    flex: 1;
    overflow: auto;
    padding: 1rem;
}

.uct-pane-body .uct-textarea {
    height: 100%;
    min-height: 300px;
    border: none;
    background: transparent;
    resize: none;
    padding: 0;
}

.uct-pane-body .uct-textarea:focus {
    box-shadow: none;
}

/* ── Drop Zone ───────────────────────────────────────────── */
.uct-drop-zone {
    border: 2px dashed var(--uct-border);
    border-radius: var(--uct-radius);
    padding: 3rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: all .25s ease;
    background: white;
}

.uct-drop-zone:hover,
.uct-drop-zone.dragover {
    border-color: var(--uct-primary);
    background: rgba(59, 130, 246, .04);
}

.uct-drop-zone i {
    font-size: 2.5rem;
    color: var(--uct-text-light);
    margin-bottom: .75rem;
    display: block;
    transition: transform .3s;
}

.uct-drop-zone:hover i {
    transform: translateY(-4px);
    color: var(--uct-primary);
}

.uct-drop-zone p {
    color: var(--uct-text-light);
    font-size: .95rem;
}

.uct-drop-zone small {
    color: #94a3b8;
    font-size: .8rem;
}

/* ── File List ───────────────────────────────────────────── */
.uct-file-list {
    display: flex;
    flex-direction: column;
    gap: .5rem;
    margin-top: 1rem;
}

.uct-file-item {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .65rem 1rem;
    background: var(--uct-bg);
    border-radius: .5rem;
    border: 1px solid var(--uct-border);
    font-size: .9rem;
}

.uct-file-item i {
    color: var(--uct-primary);
}

.uct-file-item span {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.uct-file-item small {
    color: var(--uct-text-light);
    white-space: nowrap;
}

/* ── Stats Grid ──────────────────────────────────────────── */
.uct-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1rem;
}

.uct-stat {
    background: white;
    border: 1px solid var(--uct-border);
    border-radius: var(--uct-radius);
    padding: 1.25rem 1rem;
    text-align: center;
    box-shadow: var(--uct-shadow);
}

.uct-stat-val {
    display: block;
    font-size: 2rem;
    font-weight: 800;
    color: var(--uct-primary);
    line-height: 1;
    margin-bottom: .35rem;
}

.uct-stat-label {
    font-size: .75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--uct-text-light);
}

/* ── Alerts ──────────────────────────────────────────────── */
.uct-alert {
    padding: .85rem 1.1rem;
    border-radius: .65rem;
    font-size: .9rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: .6rem;
}

.uct-alert-success {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #166534;
}

.uct-alert-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
}

.uct-alert-info {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #1e40af;
}

/* ── Progress Bar ────────────────────────────────────────── */
.uct-progress-wrap {
    background: var(--uct-border);
    border-radius: 999px;
    height: 8px;
    overflow: hidden;
}

.uct-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--uct-primary), #60a5fa);
    border-radius: 999px;
    transition: width .3s ease;
}

/* ── Filter Chips ────────────────────────────────────────── */
.uct-chips {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
}

.uct-chip {
    padding: .4rem .9rem;
    border-radius: 2rem;
    border: 1.5px solid var(--uct-border);
    background: white;
    font-size: .85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all .2s;
}

.uct-chip:hover,
.uct-chip.active {
    background: var(--uct-primary);
    border-color: var(--uct-primary);
    color: white;
}

/* ── Color Swatch ────────────────────────────────────────── */
.uct-swatch {
    width: 100%;
    height: 120px;
    border-radius: var(--uct-radius);
    border: 1px solid var(--uct-border);
    transition: background .2s;
}

/* ── Code Block ──────────────────────────────────────────── */
.uct-code {
    background: #0f172a;
    color: #e2e8f0;
    border-radius: var(--uct-radius);
    padding: 1.25rem;
    font-family: 'Courier New', monospace;
    font-size: .85rem;
    overflow: auto;
    white-space: pre-wrap;
    word-break: break-all;
}

/* ── Utilities ───────────────────────────────────────────── */
.hidden {
    display: none !important;
}

.mt-1 {
    margin-top: .5rem;
}

.mt-2 {
    margin-top: .75rem;
}

.mt-3 {
    margin-top: 1rem;
}

.mb-1 {
    margin-bottom: .5rem;
}

.mb-2 {
    margin-bottom: .75rem;
}

.text-muted {
    color: var(--uct-text-light);
    font-size: .85rem;
}

.text-center {
    text-align: center;
}

/* ── Animations ──────────────────────────────────────────── */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.uct-fade-in {
    animation: fadeIn .35s ease-out;
}

.uct-spinner {
    width: 28px;
    height: 28px;
    border: 3px solid var(--uct-border);
    border-top-color: var(--uct-primary);
    border-radius: 50%;
    animation: spin .7s linear infinite;
    margin: 0 auto;
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 768px) {
    .uct-page {
        flex-direction: column;
        height: auto;
        overflow: visible;
    }

    .uct-sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--uct-border);
    }

    .uct-split {
        flex-direction: column;
    }

    .uct-main {
        padding: 1rem;
    }
}