/* ==========================================================================
   RawLab Shortcuts Cards — v2.0.0
   Design system: DESIGN.md (Inter, #2563EB accent, calculator series)
   ========================================================================== */

.tfsc-wrap {
    --blue: #2563eb;
    --blue-hover: #1d4ed8;
    --blue-light: #eff6ff;
    --blue-mid: #bfdbfe;
    --blue-border: #93c5fd;

    --text: #111827;
    --text-muted: #6b7280;
    --text-label: #374151;
    --bg: #ffffff;
    --bg-sidebar: #f9fafb;
    --border: #e5e7eb;
    --border-input: #d1d5db;

    --radius: 8px;
    --radius-sm: 6px;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    --shadow-card: 0 2px 8px rgba(0, 0, 0, 0.07);

    font-family:
        "Inter",
        -apple-system,
        BlinkMacSystemFont,
        sans-serif;
    color: var(--text);
    margin: 1.5rem 0;
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* --------------------------------------------------------------------------
   Toolbar: search + platform switcher
   -------------------------------------------------------------------------- */

.tfsc-toolbar {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

/* Search input */

.tfsc-search {
    flex: 1 1 280px;
    max-width: 520px;
    padding: 9px 12px;
    border: 1px solid var(--border-input);
    border-radius: var(--radius-sm);
    background: var(--bg);
    font-family: inherit;
    font-size: 14px;
    color: var(--text);
    box-shadow: var(--shadow);
    outline: none;
    transition:
        border-color 0.15s,
        box-shadow 0.15s;
}

.tfsc-search::placeholder {
    color: var(--text-muted);
}

.tfsc-search:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Segmented control (platform switcher) */

.tfsc-seg {
    display: flex;
    gap: 0;
    background: var(--bg-sidebar);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 3px;
}

.tfsc-segbtn {
    padding: 7px 14px;
    border: none;
    border-radius: 4px;
    background: transparent;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.15s;
    line-height: 1;
}

.tfsc-segbtn:hover {
    color: var(--text-label);
    background: var(--bg);
}

.tfsc-segbtn.is-active {
    background: var(--bg);
    color: var(--blue);
    box-shadow: var(--shadow);
}

/* --------------------------------------------------------------------------
   TOC (sekcje — horizontal scroll pills)
   -------------------------------------------------------------------------- */

.tfsc-toc {
    display: flex;
    flex-wrap: nowrap;
    gap: 6px;
    margin: 0 0 18px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.tfsc-toc::-webkit-scrollbar {
    display: none;
}

.tfsc-toc a {
    display: inline-block;
    flex-shrink: 0;
    padding: 5px 12px;
    border: 1px solid var(--border-input);
    border-radius: 100px;
    background: var(--bg);
    font-size: 12px;
    font-weight: 600;
    color: var(--text-label);
    text-decoration: none;
    transition: all 0.15s;
    box-shadow: var(--shadow);
    white-space: nowrap;
}

.tfsc-toc a:hover {
    border-color: var(--blue);
    background: var(--blue-light);
    color: var(--blue);
}

/* --------------------------------------------------------------------------
   Grid
   -------------------------------------------------------------------------- */

.tfsc-grid {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* --------------------------------------------------------------------------
   Card (sekcja)
   -------------------------------------------------------------------------- */

.tfsc-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-card);
    overflow: hidden;
}

.tfsc-cardhead {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 14px 18px;
    background: var(--bg-sidebar);
    border-bottom: 1px solid var(--border);
}

.tfsc-cardhead h3 {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
    line-height: 1.3;
}

.tfsc-count {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 22px;
    padding: 0 8px;
    border-radius: 100px;
    background: var(--blue-light);
    color: var(--blue);
    font-size: 11px;
    font-weight: 700;
}

/* --------------------------------------------------------------------------
   Shortcut list
   -------------------------------------------------------------------------- */

.tfsc-list {
    padding: 0;
    margin: 0;
}

.tfsc-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 10px 18px;
    border-bottom: 1px solid var(--border);
    transition: background-color 0.12s;
}

.tfsc-item:last-child {
    border-bottom: none;
}

.tfsc-item:hover {
    background: var(--bg-sidebar);
}

/* Action label */

.tfsc-action {
    flex: 1 1 0%;
    min-width: 0;
    font-size: 13px;
    font-weight: 400;
    color: var(--text-label);
    line-height: 1.5;
}

/* --------------------------------------------------------------------------
   Keyboard keys
   -------------------------------------------------------------------------- */

.tfsc-kbd {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    flex-shrink: 0;
}

.tfsc-key {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 28px;
    padding: 0 8px;
    border: 1px solid var(--border-input);
    border-radius: 5px;
    background: linear-gradient(180deg, #ffffff 0%, #f9fafb 100%);
    box-shadow: 0 2px 0 0 #d1d5db;
    font-family:
        "Inter",
        -apple-system,
        BlinkMacSystemFont,
        sans-serif;
    font-size: 12px;
    font-weight: 600;
    color: var(--text);
    line-height: 1;
    white-space: nowrap;
    letter-spacing: 0.02em;
}

.tfsc-plus {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    opacity: 0.5;
    line-height: 1;
    user-select: none;
}

/* --------------------------------------------------------------------------
   Empty state (po wyszukiwaniu)
   -------------------------------------------------------------------------- */

.tfsc-card[style*="display: none"] {
    /* handled by JS */
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */

@media (max-width: 750px) {
    .tfsc-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .tfsc-search {
        max-width: none;
        flex-basis: auto;
    }

    .tfsc-seg {
        justify-content: center;
    }

    .tfsc-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        padding: 12px 14px;
    }

    .tfsc-kbd {
        flex-wrap: wrap;
    }

    .tfsc-cardhead {
        padding: 12px 14px;
    }
}

/* --------------------------------------------------------------------------
   Hub (strona-hub z kartami narzędzi)
   -------------------------------------------------------------------------- */

.tfsc-hub-intro {
    margin-bottom: 28px;
    font-size: 15px;
    line-height: 1.7;
    color: var(--text-label);
}

.tfsc-hub-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.tfsc-hub-card {
    display: flex;
    flex-direction: column;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-card);
    padding: 24px;
    text-decoration: none;
    color: var(--text);
    transition:
        border-color 0.15s,
        box-shadow 0.15s;
}

.tfsc-hub-card:hover {
    border-color: var(--blue);
    box-shadow: 0 4px 16px rgba(37, 99, 235, 0.12);
    text-decoration: none;
    color: var(--text);
}

.tfsc-hub-card-icon {
    width: 48px;
    height: 48px;
    margin-bottom: 14px;
    border-radius: 10px;
    object-fit: contain;
}

.tfsc-hub-card-title {
    font-size: 17px;
    font-weight: 700;
    color: var(--text);
    margin: 0 0 6px;
    line-height: 1.3;
}

.tfsc-hub-card-desc {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.6;
    margin: 0 0 16px;
    flex: 1;
}

.tfsc-hub-card-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.tfsc-hub-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    font-weight: 600;
    color: var(--blue);
    background: var(--blue-light);
    padding: 4px 10px;
    border-radius: 100px;
}

.tfsc-hub-arrow {
    font-size: 13px;
    font-weight: 600;
    color: var(--blue);
}

.tfsc-hub-card.is-soon {
    opacity: 0.55;
    pointer-events: none;
}

.tfsc-hub-card.is-soon .tfsc-hub-badge {
    color: var(--text-muted);
    background: #f3f4f6;
}

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