/* ==========================================================================
   yt-dlp Cheatsheet Page Custom Styles
   ========================================================================== */

/* Search Section Styling */
.cheatsheet-search-wrapper {
    position: relative;
    max-width: 600px;
    margin: 1.5rem auto 2.5rem auto;
}

.cheatsheet-search-input {
    width: 100%;
    padding: 0.85rem 1.25rem 0.85rem 3rem;
    font-size: 1.1rem;
    border-radius: var(--radius-lg);
    border: 2px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-main);
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-fast);
}

.cheatsheet-search-input:focus {
    outline: none;
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.cheatsheet-search-icon {
    position: absolute;
    left: 1.2rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 1.2rem;
    pointer-events: none;
}

/* ==========================================================================
   Hero One-Liner Quick Cards
   ========================================================================== */
.hero-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 2.5rem;
}

.hero-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.1rem 1rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
}

.hero-card::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.hero-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    border-color: var(--secondary-color);
}

.hero-card:hover::after {
    transform: scaleX(1);
}

.hero-card.copied {
    border-color: #2e7d32;
    background-color: rgba(46, 125, 50, 0.06);
}

.hero-card-icon {
    font-size: 2rem;
    margin-bottom: 0.4rem;
    line-height: 1;
}

.hero-card-label {
    font-weight: 600;
    font-size: 0.92rem;
    color: var(--text-main);
    margin-bottom: 0.35rem;
}

.hero-card-cmd {
    font-family: 'Consolas', 'Courier New', Courier, monospace;
    font-size: 0.78rem;
    color: var(--text-muted);
    background-color: rgba(0, 0, 0, 0.03);
    padding: 0.2rem 0.5rem;
    border-radius: var(--radius-sm);
    display: inline-block;
    word-break: break-all;
}

[data-bs-theme="dark"] .hero-card-cmd {
    background-color: rgba(255, 255, 255, 0.04);
}

/* Category Quick Navigation */
.cheatsheet-nav {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    justify-content: center;
    margin-bottom: 2.5rem;
}

.cheatsheet-nav-btn {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 0.5rem 1.25rem;
    border-radius: 20px;
    font-weight: 500;
    font-size: 0.95rem;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: all var(--transition-fast);
    box-shadow: var(--shadow-sm);
}

.cheatsheet-nav-btn:hover {
    background: var(--secondary-color);
    color: white;
    border-color: var(--secondary-color);
    transform: translateY(-1px);
}

.cheatsheet-section {
    margin-bottom: 3.5rem;
    scroll-margin-top: 80px; /* Offset for sticky navbar */
}

.cheatsheet-section-title {
    font-size: 1.45rem;
    font-weight: 600;
    margin-bottom: 1.25rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--border-color);
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Table Style Override */
.cheatsheet-table {
    width: 100%;
    margin-bottom: 0;
    border-collapse: collapse;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.cheatsheet-table th {
    background-color: rgba(0, 0, 0, 0.03);
    color: var(--text-main);
    font-weight: 600;
    padding: 1rem;
    border-bottom: 2px solid var(--border-color);
    text-align: left;
}

[data-bs-theme="dark"] .cheatsheet-table th {
    background-color: rgba(255, 255, 255, 0.03);
}

.cheatsheet-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
    color: var(--text-main);
}

.cheatsheet-table tr:last-child td {
    border-bottom: none;
}

/* Codeblock formatting */
.cmd-code {
    font-family: 'Consolas', 'Courier New', Courier, monospace;
    font-size: 0.925rem;
    background-color: rgba(0, 0, 0, 0.04);
    color: #e83e8c;
    padding: 0.35rem 0.65rem;
    border-radius: var(--radius-sm);
    word-break: break-all;
    display: inline-block;
}

[data-bs-theme="dark"] .cmd-code {
    background-color: rgba(255, 255, 255, 0.06);
    color: #f472b6;
}

/* Action Buttons */
.cheatsheet-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: nowrap;
}

.btn-cheatsheet {
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
    font-weight: 500;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
    display: inline-flex;
    align-items: center;
    gap: 4px;
    border: 1px solid var(--border-color);
    background-color: var(--bg-card);
    color: var(--text-main);
}

.btn-cheatsheet:hover {
    background-color: rgba(0, 0, 0, 0.05);
    border-color: var(--text-muted);
}

[data-bs-theme="dark"] .btn-cheatsheet:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

.btn-cheatsheet-run {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.btn-cheatsheet-run:hover {
    background-color: var(--primary-hover);
    border-color: var(--primary-hover);
    color: white;
    transform: translateY(-1px);
}

.btn-cheatsheet-copy.copied {
    background-color: #2e7d32 !important;
    color: white !important;
    border-color: #2e7d32 !important;
}

/* ==========================================================================
   Pro Tip / Cross-Link Callout Box
   ========================================================================== */
.pro-tip {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
    margin-top: 1rem;
    padding: 1rem 1.25rem;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.04), rgba(139, 92, 246, 0.04));
    border-left: 4px solid var(--secondary-color);
    color: var(--text-main);
    font-size: 0.95rem;
    line-height: 1.55;
}

[data-bs-theme="dark"] .pro-tip {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.08), rgba(139, 92, 246, 0.08));
}

.pro-tip-icon {
    font-size: 1.35rem;
    flex-shrink: 0;
    line-height: 1;
    margin-top: 0.1rem;
}

.pro-tip-content {
    flex: 1;
}

.pro-tip-content a {
    color: var(--secondary-color);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.pro-tip-content a:hover {
    color: var(--primary-color);
}

.pro-tip-content code {
    background-color: rgba(0, 0, 0, 0.06);
    color: #e83e8c;
    padding: 0.15rem 0.4rem;
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
}

[data-bs-theme="dark"] .pro-tip-content code {
    background-color: rgba(255, 255, 255, 0.08);
    color: #f472b6;
}

/* Accordion FAQ Styling */
.faq-accordion .accordion-item {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    margin-bottom: 0.75rem;
    border-radius: var(--radius-md) !important;
    overflow: hidden;
}

.faq-accordion .accordion-button {
    background-color: var(--bg-card);
    color: var(--text-main);
    font-weight: 600;
    padding: 1.15rem 1.25rem;
    box-shadow: none !important;
}

.faq-accordion .accordion-button:not(.collapsed) {
    background-color: rgba(0, 0, 0, 0.02);
    color: var(--secondary-color);
    border-bottom: 1px solid var(--border-color);
}

[data-bs-theme="dark"] .faq-accordion .accordion-button:not(.collapsed) {
    background-color: rgba(255, 255, 255, 0.02);
}

.faq-accordion .accordion-body {
    background-color: var(--bg-card);
    color: var(--text-muted);
    line-height: 1.6;
    padding: 1.25rem;
}

.faq-accordion .accordion-body a {
    color: var(--secondary-color);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.faq-accordion .accordion-body a:hover {
    color: var(--primary-color);
}

/* ==========================================================================
   Back to Top Button
   ========================================================================== */
.btn-back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-main);
    font-size: 1.1rem;
    cursor: pointer;
    box-shadow: var(--shadow-md);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transform: translateY(12px);
    transition: all 0.3s ease;
    z-index: 1050;
}

.btn-back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.btn-back-to-top:hover {
    background: var(--secondary-color);
    color: white;
    border-color: var(--secondary-color);
    transform: translateY(-2px);
}

/* ==========================================================================
   Mobile Responsive - Table to Card Layout
   ========================================================================== */
@media (max-width: 991.98px) {
    .hero-cards {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }

    .responsive-table thead {
        display: none;
    }
    
    .responsive-table tr {
        display: block;
        margin-bottom: 1.25rem;
        border: 1px solid var(--border-color);
        border-radius: var(--radius-md);
        padding: 1rem;
        background: var(--bg-card);
        box-shadow: var(--shadow-sm);
    }
    
    .responsive-table td {
        display: block;
        text-align: right;
        padding: 0.65rem 0;
        border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    }
    
    [data-bs-theme="dark"] .responsive-table td {
        border-bottom-color: rgba(255, 255, 255, 0.05);
    }
    
    .responsive-table td:last-child {
        border-bottom: none;
        padding-bottom: 0;
    }
    
    .responsive-table td::before {
        content: attr(data-label);
        float: left;
        font-weight: 600;
        color: var(--text-main);
        padding-right: 10px;
    }
    
    .responsive-table td .cmd-code {
        text-align: left;
        max-width: 100%;
    }
    
    .cheatsheet-actions {
        justify-content: flex-end;
    }
}

@media (max-width: 575.98px) {
    .hero-cards {
        grid-template-columns: 1fr 1fr;
        gap: 0.6rem;
    }

    .hero-card {
        padding: 0.85rem 0.6rem;
    }

    .hero-card-icon {
        font-size: 1.5rem;
    }

    .hero-card-label {
        font-size: 0.82rem;
    }

    .hero-card-cmd {
        font-size: 0.7rem;
    }

    .btn-back-to-top {
        bottom: 1.2rem;
        right: 1.2rem;
        width: 38px;
        height: 38px;
        font-size: 1rem;
    }
}

/* Search Highlights */
.cheatsheet-highlight {
    background-color: rgba(255, 193, 7, 0.35);
    color: inherit;
    padding: 0 2px;
    border-radius: 3px;
}

/* CLI Only Lock Buttons */
.btn-cheatsheet-cli-only {
    background-color: var(--border-color) !important;
    color: var(--text-muted) !important;
    border-color: var(--border-color) !important;
    cursor: not-allowed;
    opacity: 0.65;
}

.btn-cheatsheet-cli-only:hover {
    background-color: var(--border-color) !important;
    color: var(--text-muted) !important;
}

