@import "../../style.css";

body {
    margin: 0;
}

.app {
    max-width: 1160px;
    margin: 48px auto;
    padding: 0 var(--space-3) var(--space-5);
}

.header {
    margin-bottom: var(--space-4);
}

.header .eyebrow {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border: 1px solid var(--border);
    border-radius: 999px;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
    background: rgba(255, 255, 255, 0.03);
}

.header h1 {
    margin: var(--space-2) 0 var(--space-2);
    font-size: 32px;
    letter-spacing: 0.02em;
}

.header p {
    margin: 0;
    color: var(--muted);
}

.panel {
    position: relative;
    background: linear-gradient(140deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0));
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: var(--space-4);
    margin-bottom: var(--space-4);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.controls::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(120% 120% at 10% 10%, rgba(56, 189, 248, 0.08), transparent 45%),
        radial-gradient(120% 120% at 90% 20%, rgba(244, 114, 182, 0.06), transparent 55%);
    pointer-events: none;
}

.rule-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: var(--space-3);
    position: relative;
    z-index: 1;
}

.rule-card {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: calc(var(--radius) - 4px);
    padding: var(--space-3);
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    min-height: 220px;
}

.rule-card h2 {
    margin: 0;
    font-size: 16px;
    letter-spacing: 0.02em;
}

.rule-card p {
    margin: 0;
    font-size: 13px;
    color: var(--muted);
}

.segmented {
    display: inline-flex;
    border: 1px solid rgba(148, 163, 184, 0.4);
    border-radius: 999px;
    overflow: hidden;
    background: rgba(15, 23, 42, 0.5);
}

.segmented-button {
    border: 0;
    background: transparent;
    color: var(--muted);
    padding: 8px 16px;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
}

.segmented-button.is-active {
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.25), rgba(34, 211, 238, 0.3));
    color: #e6faff;
    font-weight: 600;
}

.toggle-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: var(--space-2);
}

.toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--text);
}

.toggle input {
    accent-color: var(--accent);
}

.preset-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
}

.pill-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 18px;
    border-radius: 999px;
    border: 1px solid rgba(56, 189, 248, 0.6);
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.25), rgba(34, 211, 238, 0.3));
    color: #e6faff;
    font-weight: 600;
    letter-spacing: 0.01em;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.pill-button:hover {
    transform: translateY(-1px);
    border-color: rgba(34, 211, 238, 0.8);
    box-shadow: 0 8px 24px rgba(34, 211, 238, 0.24);
}

.ghost-button {
    padding: 10px 16px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.03);
    color: var(--text);
    font-weight: 600;
    cursor: pointer;
    transition: border-color 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
}

.ghost-button:hover {
    border-color: rgba(56, 189, 248, 0.5);
    transform: translateY(-1px);
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.45);
}

.ghost-button:focus-visible,
.pill-button:focus-visible,
.segmented-button:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
}

.target-indicator {
    margin-top: auto;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
}

.helper {
    font-size: 12px;
    color: var(--muted);
}

.panes {
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.8), rgba(15, 23, 42, 0.3));
}

.panes::after {
    content: "";
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.02) 0, rgba(255, 255, 255, 0.02) 1px, transparent 1px, transparent 72px);
    opacity: 0.4;
    pointer-events: none;
}

.sync-banner {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
    border-radius: 999px;
    border: 1px solid rgba(56, 189, 248, 0.4);
    background: rgba(56, 189, 248, 0.1);
    color: #e0f2fe;
    font-size: 13px;
    margin-bottom: var(--space-3);
}

.sync-dot {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: var(--accent);
    box-shadow: 0 0 12px rgba(56, 189, 248, 0.6);
}

.pane-grid {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--space-3);
}

.pane {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: calc(var(--radius) - 4px);
    padding: var(--space-3);
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    min-height: 320px;
    box-shadow: inset 0 0 0 1px rgba(56, 189, 248, 0.08);
}

.pane-header {
    display: flex;
    justify-content: space-between;
    gap: var(--space-2);
    align-items: flex-start;
}

.pane-header h2 {
    margin: 0 0 4px;
    font-size: 18px;
}

.pane-header p {
    margin: 0;
    font-size: 13px;
    color: var(--muted);
}

.pane-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 12px;
    color: var(--muted);
}

.pane-meta span {
    padding: 4px 10px;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.2);
    background: rgba(255, 255, 255, 0.03);
}

textarea {
    width: 100%;
    min-height: 210px;
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    resize: vertical;
    font-size: 14px;
    line-height: 1.5;
    font-family: var(--font-mono);
    background: var(--bg-alt);
    color: var(--text);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

textarea:focus {
    outline: none;
    border-color: rgba(56, 189, 248, 0.7);
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.2);
    background: #0e192c;
}

.pane-actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    justify-content: flex-end;
    margin-top: auto;
}

.status-panel {
    padding: var(--space-3) var(--space-4);
}

.status {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--muted);
    font-size: 14px;
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.6);
    box-shadow: 0 0 0 rgba(56, 189, 248, 0);
    transition: background 0.2s ease;
}

.status.is-active .status-dot {
    background: var(--accent);
    animation: pulse 1.4s ease;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(56, 189, 248, 0.6);
    }
    100% {
        box-shadow: 0 0 0 12px rgba(56, 189, 248, 0);
    }
}

@media (max-width: 840px) {
    .app {
        margin: 32px auto;
        padding: 0 var(--space-3) var(--space-4);
    }

    .panel {
        padding: var(--space-3);
    }

    .pane {
        min-height: 280px;
    }
}

@media (max-width: 600px) {
    .pane-header {
        flex-direction: column;
    }

    .sync-banner {
        width: 100%;
        justify-content: center;
    }
}
