/*
 * Terminal Commands Playbook - Transparency-Focused Styling
 * Pure Black Neumorphic Design - Education-First Interface
 * Designed for fast, searchable, trustworthy command reference
 */

/* ===== PAGE LAYOUT ===== */
.playbook-page {
    background: #0a0a0a;
    color: #e0e0e0;
    min-height: 100vh;
    padding-bottom: 3rem;
}

/* ===== HERO SECTION ===== */
.playbook-hero {
    position: relative;
    padding: 5rem 2rem 4rem;
    text-align: center;
    background: linear-gradient(135deg, #000000 0%, #0f0f0f 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.playbook-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: radial-gradient(white 1px, transparent 1px);
    background-size: 100px 100px;
    opacity: 0.02;
    pointer-events: none;
}

.playbook-hero-content {
    position: relative;
    z-index: 1;
    max-width: 950px;
    margin: 0 auto;
}

.playbook-title {
    font-size: clamp(2rem, 4vw, 3.2rem);
    font-weight: 800;
    margin-bottom: 1rem;
    color: #ffffff;
    letter-spacing: -0.5px;
}

.playbook-title-accent {
    background: linear-gradient(135deg, #2196F3, #1976D2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.playbook-subtitle {
    font-size: 1.05rem;
    color: #a0a0a0;
    margin: 1rem auto;
    max-width: 800px;
    line-height: 1.6;
}

.playbook-tagline {
    font-size: 0.95rem;
    color: #707070;
    font-style: italic;
    margin-top: 1rem;
}

/* ===== EDUCATIONAL NOTE ===== */
#transparency-note {
    display: block;
    background: linear-gradient(135deg, rgba(33, 150, 243, 0.1), rgba(25, 118, 210, 0.1));
    border: 1px solid rgba(33, 150, 243, 0.3);
    border-left: 4px solid #2196F3;
    padding: 1.5rem;
    margin: 2rem auto;
    border-radius: 8px;
    max-width: 900px;
    color: #90CAF9;
    font-size: 0.95rem;
    line-height: 1.6;
}

#transparency-note strong {
    color: #64B5F6;
}

/* ===== SEARCH & FILTER SECTION ===== */
.playbook-controls {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
    padding: 2rem;
    background: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.search-wrapper {
    flex: 1;
    min-width: 200px;
    max-width: 400px;
    position: relative;
}

#command-search {
    width: 100%;
    padding: 0.85rem 1rem 0.85rem 2.5rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    color: #e0e0e0;
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

#command-search:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(33, 150, 243, 0.3);
    box-shadow: 0 0 12px rgba(33, 150, 243, 0.1);
}

#command-search::placeholder {
    color: #707070;
}

.search-icon {
    position: absolute;
    left: 0.8rem;
    top: 50%;
    transform: translateY(-50%);
    color: #707070;
    font-size: 0.95rem;
}

.filter-group {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.filter-group label {
    font-size: 0.85rem;
    color: #a0a0a0;
    white-space: nowrap;
}

.filter-select {
    padding: 0.7rem 0.9rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #e0e0e0;
    border-radius: 6px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-select:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
}

.filter-select:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(33, 150, 243, 0.3);
    box-shadow: 0 0 8px rgba(33, 150, 243, 0.1);
}

/* ===== COMMANDS CONTAINER ===== */
#commands-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* ===== NO RESULTS MESSAGE ===== */
.no-results-message {
    text-align: center;
    padding: 3rem 2rem;
    color: #707070;
    font-size: 1.1rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px dashed rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    margin: 2rem 0;
}

/* ===== CATEGORY SECTION ===== */
.command-category {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.command-category:hover {
    border-color: rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.04);
}

.category-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.02));
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    cursor: pointer;
    user-select: none;
}

.category-title {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
}

.category-icon {
    font-size: 1.8rem;
    flex-shrink: 0;
}

.category-header h2 {
    font-size: 1.3rem;
    font-weight: 700;
    margin: 0;
    color: #ffffff;
}

.category-description {
    font-size: 0.85rem;
    color: #a0a0a0;
    margin: 0.4rem 0 0;
}

.toggle-category-btn {
    background: none;
    border: none;
    color: #a0a0a0;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0.5rem;
    flex-shrink: 0;
}

.toggle-category-btn:hover {
    color: #e0e0e0;
}

.toggle-icon {
    display: inline-block;
    transition: transform 0.3s ease;
}

/* ===== COMMANDS LIST ===== */
.commands-list {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
    transition: max-height 0.3s ease;
}

.commands-list.collapsed {
    max-height: 0;
    padding: 0;
    overflow: hidden;
}

/* ===== COMMAND CARD ===== */
.command-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    padding: 1.3rem;
    transition: all 0.3s ease;
}

.command-card:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.12);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transform: translateY(-2px);
}

.command-header {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    align-items: flex-start;
}

.command-title-section {
    flex: 1;
}

.command-title {
    margin: 0 0 0.4rem 0;
    font-size: 1.1rem;
    font-weight: 700;
    color: #ffffff;
}

.command-desc {
    margin: 0;
    font-size: 0.9rem;
    color: #b0b0b0;
    line-height: 1.4;
}

.badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.6rem;
}

.badge {
    display: inline-block;
    padding: 0.3rem 0.8rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.platform-badge {
    background: rgba(76, 175, 80, 0.15);
    color: #81C784;
    border: 1px solid rgba(76, 175, 80, 0.3);
}

.difficulty-badge {
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.safety-badge {
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.favorite-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #707070;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0.5rem;
    flex-shrink: 0;
}

.favorite-btn:hover {
    color: #FFD700;
    transform: scale(1.1);
}

.favorite-btn.active {
    color: #FFD700;
}

/* ===== COMMAND CONTENT ===== */
.command-content {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.command-code-section {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    padding: 1rem;
    overflow: hidden;
}

.command-code-section.alternate {
    background: rgba(25, 118, 210, 0.08);
    border-color: rgba(33, 150, 243, 0.2);
}

.code-label {
    font-size: 0.8rem;
    font-weight: 700;
    color: #64B5F6;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.6rem;
}

.code-block {
    display: flex;
    gap: 0.8rem;
    align-items: center;
    justify-content: space-between;
}

.code-block code {
    flex: 1;
    background: transparent;
    color: #81C784;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.9rem;
    word-break: break-all;
    white-space: pre-wrap;
    line-height: 1.4;
    padding: 0;
    margin: 0;
}

.copy-btn {
    background: rgba(33, 150, 243, 0.2);
    border: 1px solid rgba(33, 150, 243, 0.3);
    color: #64B5F6;
    padding: 0.5rem 0.9rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    flex-shrink: 0;
}

.copy-btn:hover {
    background: rgba(33, 150, 243, 0.3);
    border-color: rgba(33, 150, 243, 0.5);
    transform: translateY(-1px);
}

.copy-btn:active {
    transform: translateY(0);
}

/* ===== EXPANDABLE DETAILS ===== */
.expandable-section {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    overflow: hidden;
}

.expand-btn {
    width: 100%;
    background: transparent;
    border: none;
    color: #90CAF9;
    padding: 0.8rem 1rem;
    text-align: left;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.expand-btn:hover {
    background: rgba(33, 150, 243, 0.1);
}

.details {
    padding: 0 1rem 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        max-height: 0;
    }
    to {
        opacity: 1;
        max-height: 1000px;
    }
}

.detail-row {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.detail-row:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.detail-label {
    font-size: 0.8rem;
    font-weight: 700;
    color: #64B5F6;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.detail-value {
    font-size: 0.9rem;
    color: #c0c0c0;
    line-height: 1.5;
}

.example-code {
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #81C784;
    padding: 0.8rem;
    border-radius: 4px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.85rem;
    line-height: 1.4;
    overflow-x: auto;
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 768px) {
    .playbook-hero {
        padding: 3rem 1.5rem 2.5rem;
    }

    .playbook-title {
        font-size: 1.8rem;
    }

    .playbook-controls {
        flex-direction: column;
        gap: 0.8rem;
        padding: 1.5rem;
    }

    .search-wrapper {
        max-width: 100%;
    }

    .filter-group {
        width: 100%;
    }

    .filter-select {
        flex: 1;
    }

    .command-card {
        padding: 1rem;
    }

    .command-header {
        flex-direction: column;
    }

    .favorite-btn {
        font-size: 1.3rem;
    }

    .code-block {
        flex-direction: column;
        align-items: stretch;
    }

    .copy-btn {
        width: 100%;
        text-align: center;
    }

    .badges {
        margin-top: 0.5rem;
    }

    .badge {
        font-size: 0.7rem;
        padding: 0.25rem 0.6rem;
    }

    #commands-container {
        padding: 1rem;
    }

    .category-header {
        padding: 1rem;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .toggle-category-btn {
        position: absolute;
        right: 1rem;
        top: 1rem;
    }

    .commands-list {
        padding: 1rem;
        gap: 1rem;
    }
}

@media (max-width: 480px) {
    .playbook-title {
        font-size: 1.5rem;
    }

    .playbook-subtitle {
        font-size: 0.9rem;
    }

    .command-title {
        font-size: 1rem;
    }

    .command-desc {
        font-size: 0.85rem;
    }

    .code-label {
        font-size: 0.75rem;
    }

    .code-block code {
        font-size: 0.8rem;
    }

    .detail-label {
        font-size: 0.75rem;
    }

    .detail-value {
        font-size: 0.85rem;
    }

    .example-code {
        font-size: 0.8rem;
        padding: 0.6rem;
    }
}

/* ===== SCROLLBAR STYLING ===== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.02);
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* ===== PRINT STYLES ===== */
@media print {
    .playbook-controls {
        display: none;
    }

    .command-card {
        break-inside: avoid;
        page-break-inside: avoid;
    }

    .details {
        display: block;
    }
}
