/* ===== RESET & BASE ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-primary: #1a1d29;
    --bg-secondary: #22252f;
    --bg-hover: #2a2d3a;
    --text-primary: #e4e6eb;
    --text-secondary: #b0b3b8;
    --border-color: #3a3d4a;
    --accent: #5b9bd5;
    --accent-hover: #4a8bc4;
    --success: #4caf50;
    --warning: #ff9800;
    --danger: #f44336;
}

/* ===== LIGHT THEME ===== */
[data-theme="light"] {
    --bg-primary: #f5f5f5;
    --bg-secondary: #ffffff;
    --bg-hover: #e8e8e8;
    --text-primary: #1a1d29;
    --text-secondary: #5a5d6a;
    --border-color: #d0d0d0;
    --accent: #4a8bc4;
    --accent-hover: #3a7ab3;
}

/* ===== CUSTOM SCROLLBAR ===== */
/* Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--bg-hover) var(--bg-primary);
}

/* Chrome, Edge, Safari */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background-color: var(--bg-hover);
    border-radius: 5px;
    border: 2px solid var(--bg-primary);
}

::-webkit-scrollbar-thumb:hover {
    background-color: var(--text-secondary);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    transition: background 0.3s ease, color 0.3s ease;
}

/* ===== HEADER ===== */
.app-header {
    background: var(--bg-secondary);
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--border-color);
    transition: background 0.3s ease, border-color 0.3s ease;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1400px;
    margin: 0 auto;
}

.app-header h1 {
    font-size: 1.8rem;
    margin-bottom: 0.25rem;
}

.app-header p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.theme-toggle {
    background: var(--bg-hover);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.75rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.2rem;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
}

.theme-toggle:hover {
    background: var(--accent);
    color: white;
    transform: scale(1.05);
}

.theme-toggle:active {
    transform: scale(0.95);
}

.language-toggle {
    background: var(--bg-hover);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.3s ease;
    min-height: 44px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    user-select: none;
}

.language-toggle:hover {
    background: var(--bg-secondary);
    border-color: var(--accent);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.language-toggle .separator {
    color: var(--border-color);
    font-weight: 400;
}

.language-toggle span {
    transition: color 0.3s ease;
}

.language-toggle span.active {
    color: var(--accent);
    font-weight: 800;
}

/* ===== CONTAINER ===== */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

/* ===== FILTERS ===== */
.filters {
    background: var(--bg-secondary);
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

.search-box {
    position: relative;
    margin-bottom: 1rem;
}

.search-box i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    transition: all 0.3s ease;
}

.search-box input:focus+i,
.search-box:has(input:focus) i {
    color: var(--accent);
    transform: translateY(-50%) scale(1.1);
}

.search-box input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.75rem;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 1rem;
    transition: all 0.3s ease;
}

.search-box input:focus {
    outline: none;
    border-color: var(--accent);
    background: var(--bg-secondary);
    box-shadow: 0 0 0 3px rgba(91, 155, 213, 0.1),
        0 4px 12px rgba(91, 155, 213, 0.15);
    transform: translateY(-1px);
}

.search-box input::placeholder {
    color: var(--text-secondary);
    opacity: 0.6;
    transition: opacity 0.3s ease;
}

.search-box input:focus::placeholder {
    opacity: 0.4;
}

/* ===== FILTER REDESIGN (Mobile First) ===== */
.filter-bar {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    align-items: center;
}

.filter-bar .search-box {
    flex: 1;
    margin-bottom: 0;
    /* Align with button */
}

/* Clear Search Button */
.search-box {
    position: relative;
    /* Ensure container is relative for absolute positioning */
}

.clear-search-btn {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0;
    display: flex;
    /* Flex is often more reliable for SVG centering than grid place-items in some contexts */
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
    width: 28px;
    height: 28px;
}

.clear-search-btn svg {
    width: 14px;
    height: 14px;
    display: block;
}

.clear-search-btn:hover {
    background: var(--bg-hover);
    color: var(--accent);
}

.filter-toggle-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    height: 100%;
}

.filter-toggle-btn:hover,
.filter-toggle-btn[aria-expanded="true"] {
    background: var(--bg-secondary);
    border-color: var(--accent);
    color: var(--accent);
}

.filter-count {
    background: var(--accent);
    color: white;
    font-size: 0.75rem;
    padding: 0.1rem 0.4rem;
    border-radius: 10px;
    font-weight: bold;
    min-width: 1.2em;
    text-align: center;
}

/* Collapsible Panel */
.filter-panel {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    animation: slideDown 0.3s ease-out;
}

.filter-panel[hidden] {
    display: none;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.filter-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    align-items: center;
    border-top: 1px solid var(--border-color);
    padding-top: 1rem;
}

/* Active Chips */
.active-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.8rem;
    background: rgba(91, 155, 213, 0.15);
    color: var(--accent);
    border: 1px solid rgba(91, 155, 213, 0.3);
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.2s ease;
    cursor: default;
}

.filter-chip button {
    background: none;
    border: none;
    color: var(--accent);
    cursor: pointer;
    padding: 0;
    font-size: 0.9em;
    opacity: 0.7;
    transition: opacity 0.2s;
    display: flex;
    align-items: center;
}

.filter-chip button:hover {
    opacity: 1;
}

/* ===== SELECT WRAPPER FOR CUSTOM ICONS ===== */
.select-wrapper {
    position: relative;
    width: 100%;
    /* Full width in grid/flex */
}

.select-wrapper::after {
    content: '\f078';
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    pointer-events: none;
    font-size: 0.75rem;
    transition: color 0.2s ease;
}

.select-wrapper:hover::after {
    color: var(--accent);
}

select {
    width: 100%;
    min-width: 180px;
    padding: 0.75rem 2.5rem 0.75rem 1rem;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s ease;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
}

select:hover {
    border-color: var(--accent);
    background: var(--bg-secondary);
}

select:focus {
    outline: none;
    border-color: var(--accent);
    background: var(--bg-secondary);
    box-shadow: 0 0 0 3px rgba(91, 155, 213, 0.08);
}

.favorites-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    cursor: pointer;
    user-select: none;
    transition: all 0.2s ease;
}

.favorites-toggle:hover {
    border-color: var(--accent);
    background: var(--bg-secondary);
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.favorites-toggle input {
    cursor: pointer;
}

.btn-reset {
    padding: 0.75rem 1.5rem;
    background: transparent;
    color: var(--accent);
    border: 1px solid var(--accent);
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
    font-weight: 500;
}

.btn-reset:hover {
    background: var(--accent);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(91, 155, 213, 0.3);
}

.btn-reset:active {
    transform: translateY(0);
}

.status-bar {
    margin-top: 1rem;
    margin-bottom: 1.5rem;
    padding: 0.75rem 1rem;
    border-top: 1px solid var(--border-color);
    background: var(--bg-hover);
    border-radius: 4px;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
}

/* ===== TABLE ===== */
.table-container {
    background: var(--bg-secondary);
    border-radius: 8px;
    overflow: auto;
    /* Enable both scrollbars */
    /* viewport height minus header (~80) + filters (~200) + footer/margin */
    max-height: calc(100vh - 350px);
    min-height: 400px;
    border: 1px solid var(--border-color);
    cursor: grab;
    /* Indicate draggable */

    /* Scrollbar Styling */
    scrollbar-width: thin;
    /* Firefox */
    scrollbar-color: var(--primary) var(--bg-secondary);
}

/* Custom Scrollbar Webkit */
.table-container::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

.table-container::-webkit-scrollbar-track {
    background: var(--bg-secondary);
    border-radius: 8px;
}

.table-container::-webkit-scrollbar-thumb {
    background-color: var(--primary);
    border-radius: 10px;
    border: 2px solid var(--bg-secondary);
}

.table-container::-webkit-scrollbar-thumb:hover {
    background-color: var(--primary-hover);
}

.table-container.active {
    cursor: grabbing;
}

table {
    width: max-content;
    /* Ensure table expands to fit content without squashing */
    min-width: 100%;
    /* But at least fill the container */
    border-collapse: separate;
    border-spacing: 0;
}

thead {
    background: var(--bg-hover);
}

th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    border-bottom: 2px solid var(--border-color);
    white-space: nowrap;
    position: sticky;
    top: 0;
    z-index: 10;
    /* Sticky Header */
    background: var(--bg-hover);
    /* Ensure opacity */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    /* Subtle shadow for depth */
}

/* Sticky Columns (1-2 Only) */
th:nth-child(-n+2),
td:nth-child(-n+2) {
    position: sticky;
    z-index: 5;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
}

/* Header needs higher z-index */
th:nth-child(-n+2) {
    z-index: 20;
    background: var(--bg-hover);
}

/* Offsets calculated in JS */
th:nth-child(1),
td:nth-child(1) {
    left: 0;
}

th:nth-child(2),
td:nth-child(2) {
    left: var(--col-w-1, 50px);
    box-shadow: 4px 0 10px -2px rgba(0, 0, 0, 0.1);
    /* Shadow on Action col */
}



/* Top-left corners need highest z-index */
th:nth-child(-n+2) {
    z-index: 20;
}

.col-star {
    width: 50px;
    text-align: center;
}

.col-difficulty {
    width: 60px;
    text-align: center;
}

tbody tr {
    border-bottom: 1px solid var(--border-color);
    transition: background 0.2s;
}

tbody tr:hover {
    background: var(--bg-hover);
}

td {
    padding: 1rem;
}

/* ===== MEDIA CONTAINER ===== */
.shortcut-media-container {
    height: 160px;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-primary);
    border-radius: 4px;
    overflow: hidden;
    transition: opacity 0.3s ease;
}

.shortcut-media-container svg {
    width: 100%;
    height: 100%;
    display: block;
}

.shortcut-media-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    display: block;
}

/* Shortcut column - prevent text wrapping */
th:nth-child(4),
td:nth-child(4) {
    white-space: nowrap;
    min-width: 120px;
    width: auto;
}

/* Category column - prevent icon and text from wrapping */
th:nth-child(3),
td:nth-child(3) {
    white-space: nowrap;
}

/* Ensure shortcut keys display inline */
td:nth-child(4) {
    display: table-cell;
    vertical-align: middle;
}

/* Details column */
th:nth-child(6),
td:nth-child(6) {
    min-width: 250px;
    white-space: normal;
    /* Allow text wrapping in details */
}

/* Tags column */
th:nth-child(7),
td:nth-child(7) {
    min-width: 200px;
    /* Give it space */
    white-space: normal;
    /* Allow tags to wrap */
}

/* ===== SORTABLE HEADERS ===== */
th.sortable {
    cursor: pointer;
    user-select: none;
    transition: background 0.2s;
}

th.sortable:hover {
    background: var(--bg-hover);
}

th.sortable.sorting::after {
    content: ' ↑';
    color: var(--accent);
}

th.sortable.sorting.desc::after {
    content: ' ↓';
    color: var(--accent);
}

/* ===== KEYBOARD NAVIGATION ===== */
tbody tr.keyboard-focus {
    outline: 2px solid var(--accent);
    outline-offset: -2px;
    background: var(--bg-hover);
}

/* ===== KBD STYLING ===== */
kbd.key {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    margin: 0 0.1rem;
    background: var(--bg-hover);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    box-shadow: 0 2px 0 rgba(0, 0, 0, 0.1);
    font-family: 'Courier New', Consolas, monospace;
    font-size: 0.85rem;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
}

[data-theme="light"] kbd.key {
    box-shadow: 0 2px 0 rgba(0, 0, 0, 0.05),
        0 1px 3px rgba(0, 0, 0, 0.1);
}

.shortcut-keys {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    flex-wrap: wrap;
}

.key-separator {
    color: var(--text-secondary);
    font-size: 0.8rem;
    margin: 0 0.1rem;
}

.star-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 1.2rem;
    transition: color 0.2s;
}

.star-btn.active {
    color: gold;
}

.star-btn:hover {
    color: gold;
}

.difficulty-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 500;
}

.difficulty-beginner {
    background: rgba(76, 175, 80, 0.2);
    color: #4caf50;
}

.difficulty-intermediate {
    background: rgba(255, 152, 0, 0.2);
    color: #ff9800;
}

.difficulty-advanced {
    background: rgba(244, 67, 54, 0.2);
    color: #f44336;
}

.category-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: var(--bg-hover);
    border-radius: 4px;
    font-size: 0.9rem;
}

/* ===== FOOTER ===== */
.app-footer {
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .header-content {
        flex-direction: row;
        gap: 1rem;
    }

    .app-header h1 {
        font-size: 1.5rem;
    }

    .app-header p {
        font-size: 0.85rem;
    }

    .container {
        padding: 1rem;
    }

    /* Filter Mobile Layout */
    .filter-bar {
        gap: 0.5rem;
    }

    .filter-grid {
        grid-template-columns: 1fr;
        /* Stack on mobile */
    }

    .filter-toggle-btn span:not(.filter-count) {
        display: none;
        /* Icon only on very small screens if needed, but text is good */
    }

    .table-container {
        overflow-x: auto;
    }

    table {
        min-width: 600px;
    }
}

/* ===== EMPTY STATE ===== */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-secondary);
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* ===== TAG BADGES ===== */
.tag-badge {
    display: inline-block;
    padding: 0.25rem 0.6rem;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 500;
    margin: 0.15rem;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.tag-badge:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Tag Categories - Color Coded */
.tag-badge.tag-essential {
    background: rgba(244, 67, 54, 0.15);
    color: #ff6b6b;
    border-color: rgba(244, 67, 54, 0.3);
}

.tag-badge.tag-frequently_used {
    background: rgba(91, 155, 213, 0.15);
    color: #5b9bd5;
    border-color: rgba(91, 155, 213, 0.3);
}

.tag-badge.tag-beginner-friendly {
    background: rgba(76, 175, 80, 0.15);
    color: #66bb6a;
    border-color: rgba(76, 175, 80, 0.3);
}

.tag-badge.tag-advanced {
    background: rgba(156, 39, 176, 0.15);
    color: #ab47bc;
    border-color: rgba(156, 39, 176, 0.3);
}

.tag-badge.tag-topology,
.tag-badge.tag-geometry-creation {
    background: rgba(255, 152, 0, 0.15);
    color: #ffa726;
    border-color: rgba(255, 152, 0, 0.3);
}

.tag-badge.tag-selection,
.tag-badge.tag-navigation {
    background: rgba(0, 188, 212, 0.15);
    color: #26c6da;
    border-color: rgba(0, 188, 212, 0.3);
}

.tag-badge.tag-modeling,
.tag-badge.tag-transform {
    background: rgba(255, 193, 7, 0.15);
    color: #ffd54f;
    border-color: rgba(255, 193, 7, 0.3);
}

.tag-badge.tag-productivity,
.tag-badge.tag-useful {
    background: rgba(103, 58, 183, 0.15);
    color: #9575cd;
    border-color: rgba(103, 58, 183, 0.3);
}

.tag-badge.tag-precision,
.tag-badge.tag-edge-flow {
    background: rgba(33, 150, 243, 0.15);
    color: #42a5f5;
    border-color: rgba(33, 150, 243, 0.3);
}

.tag-badge.tag-symmetry,
.tag-badge.tag-organic {
    background: rgba(233, 30, 99, 0.15);
    color: #ec407a;
    border-color: rgba(233, 30, 99, 0.3);
}

.tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    margin-top: 0.5rem;
}

/* ===== EXPANDABLE ROWS ===== */
tr.expandable {
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

tr.expandable:hover {
    background: var(--bg-hover);
}

/* Tooltip above chevron icon */
/* Detail icon hover effect */
.detail-icon:hover {
    color: var(--accent) !important;
}



tr.expanded-row {
    background: var(--bg-primary);
}

tr.expanded-row td {
    padding: 1.5rem 1rem;
}

tr.expanded-row:hover {
    background: var(--bg-primary);
}

.expand-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    margin-right: 1rem;
    color: var(--text-secondary);
    opacity: 0.7;
    flex-shrink: 0;
    position: relative;
}

.expand-icon i {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.expandable:hover .expand-icon {
    color: var(--accent);
    opacity: 1;
}

.expandable.expanded .expand-icon i {
    transform: rotate(180deg);
}

.expandable.expanded .expand-icon {
    color: var(--accent);
    opacity: 1;
}

.expanded-content {
    animation: slideDown 0.2s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.enhanced-info {
    display: grid;
    gap: 1.5rem;
    padding: 1rem;
    background: var(--bg-secondary);
    border-radius: 6px;
    border-left: 3px solid var(--accent);
}

.info-section {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.info-section-title {
    font-weight: 600;
    color: var(--accent);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.info-section-content {
    color: var(--text-secondary);
    line-height: 1.6;
}

.use-cases-list {
    list-style: none;
    padding: 0;
}

.use-cases-list li {
    padding: 0.4rem 0;
    padding-left: 1.5rem;
    position: relative;
}

.use-cases-list li:before {
    content: "→";
    position: absolute;
    left: 0;
    color: var(--accent);
    font-weight: bold;
}

/* Info Button */
.info-btn {
    background: none;
    border: none;
    color: var(--accent);
    cursor: pointer;
    font-size: 1.1rem;
    padding: 0.25rem;
    transition: all 0.2s ease;
    opacity: 0.7;
}

.info-btn:hover {
    opacity: 1;
    transform: scale(1.1);
}

/* Light theme adjustments */
[data-theme="light"] .tag-badge {
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .enhanced-info {
    border-left-color: var(--accent);
    background: #f8f9fa;
}

/* ===== CARD VIEW ===== */
.cards-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    padding-bottom: 2rem;
}

.shortcut-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    position: relative;
    height: 100%;
    cursor: pointer;
}

.shortcut-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.2);
    border-color: var(--accent);
}

/* 1. KEY HEADER (TOP) */
.shortcut-card__header {
    background: var(--bg-hover);
    padding: 1.5rem 1rem;
    display: flex;
    justify-content: center;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    position: relative;
    min-height: 80px;
}

.shortcut-card__keys {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
}

.shortcut-card__keys kbd {
    font-size: 1.4rem;
    padding: 0.4rem 0.8rem;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 0 rgba(0, 0, 0, 0.2);
}

.shortcut-card__favorite {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.2rem;
    cursor: pointer;
    z-index: 2;
    /* above header */
    padding: 0.5rem;
    transition: transform 0.2s;
}

.shortcut-card__favorite:hover {
    transform: scale(1.1);
}

.shortcut-card__favorite.active {
    color: gold;
}

/* 2. MEDIA (MIDDLE) */
.shortcut-card__media {
    background: var(--bg-primary);
    padding: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-grow: 1;
    min-height: 160px;
    border-bottom: 1px solid var(--border-color);
}

.shortcut-media-container {
    width: 100%;
    height: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 3. CONTENT (BOTTOM) */
.shortcut-card__content {
    padding: 1rem;
    background: var(--bg-secondary);
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.shortcut-card__title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.4;
    text-align: center;
}

.shortcut-card__notes {
    font-size: 0.9rem;
    color: var(--text-secondary);
    text-align: center;
    line-height: 1.5;
}

.shortcut-card__footer {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    justify-content: center;
    margin-top: auto;
}

.category-badge {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 0.8rem;
    padding: 2px 8px;
    border-radius: 4px;
}

.difficulty-badge {
    font-size: 0.8rem;
    padding: 2px 8px;
    border-radius: 12px;
}

/* TIPS SECTION */
.shortcut-card__tips {
    margin-top: 1rem;
    padding: 0.75rem;
    background: var(--bg-primary);
    border-radius: 4px;
    border-left: 3px solid var(--accent);
    text-align: left;
}

.shortcut-card__tips-title {
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
    color: var(--accent);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.shortcut-card__tips-content {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

gap: 0.5rem;
}

.shortcut-card__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.shortcut-card__favorite {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 1.1rem;
    padding: 0.25rem;
    transition: color 0.2s;
    margin-left: auto;
    /* Push to right */
}

.shortcut-card__favorite:hover,
.shortcut-card__favorite.active {
    color: gold;
}

.shortcut-card__action {
    padding: 1.25rem 1rem 0.5rem 1rem;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    text-align: center;
    line-height: 1.4;
}

.shortcut-card__shortcut {
    padding: 0.5rem 1rem 1.5rem 1rem;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.shortcut-card__media {
    background: var(--bg-primary);
    padding: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-top: 1px solid var(--border-color);
    margin-top: auto;
    /* Push to bottom */
}

.shortcut-card__media .shortcut-media-container {
    width: 100%;
    height: 180px;
    /* Consitent height */
}

/* Ensure images fit nicely */
.shortcut-card__media img {
    max-height: 100%;
    max-width: 100%;
    object-fit: contain;
}

box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}