/* ========================================
   Examples Menu - Modal Overlay
   ======================================== */

.examples-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    z-index: 9998;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.examples-menu-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

/* ========================================
   Examples Menu Container
   ======================================== */

.examples-menu {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 900px;
    max-height: 85vh;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    opacity: 1;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.examples-menu.hidden {
    opacity: 0;
    transform: translate(-50%, -48%);
    pointer-events: none;
}

/* ========================================
   Menu Header
   ======================================== */

.examples-menu-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    background-color: var(--bg-primary);
    border-radius: 8px 8px 0 0;
}

.examples-menu-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.examples-menu-title i {
    font-size: 20px;
    color: var(--accent-primary);
}

.examples-menu-title h2 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    letter-spacing: 0.02em;
}

.btn-close-examples {
    background-color: transparent;
    color: #858585;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.08s ease;
    font-size: 18px;
}

.btn-close-examples:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: #CCCCCC;
}

.btn-close-examples:active {
    background-color: rgba(255, 255, 255, 0.05);
}

/* ========================================
   Search Bar
   ======================================== */

.examples-menu-search-container {
    position: relative;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
}

.examples-menu-search-container i {
    position: absolute;
    left: 32px;
    top: 50%;
    transform: translateY(-50%);
    color: #858585;
    font-size: 14px;
    pointer-events: none;
}

.examples-menu-search {
    width: 100%;
    padding: 10px 12px 10px 36px;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 14px;
    outline: none;
    transition: all 0.15s ease;
}

.examples-menu-search:focus {
    border-color: var(--accent-primary);
    background-color: #252526;
}

.examples-menu-search::placeholder {
    color: #858585;
}

/* ========================================
   Filter Buttons
   ======================================== */

.examples-menu-filters {
    display: flex;
    gap: 8px;
    padding: 12px 20px;
    border-bottom: 1px solid var(--border-color);
    background-color: #252526;
}

.filter-btn {
    background-color: transparent;
    color: #CCCCCC;
    border: 1px solid #3C3C3C;
    padding: 6px 14px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.filter-btn i {
    font-size: 12px;
}

.filter-btn:hover {
    background-color: rgba(255, 255, 255, 0.05);
    border-color: #4C4C4C;
    color: #FFFFFF;
}

.filter-btn.active {
    background-color: var(--accent-primary);
    border-color: var(--accent-primary);
    color: #FFFFFF;
}

.filter-btn.active:hover {
    background-color: #1177BB;
    border-color: #1177BB;
}

/* ========================================
   Examples Content Area
   ======================================== */

.examples-menu-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    gap: 16px;
    align-content: start;
}

/* Custom scrollbar */
.examples-menu-content::-webkit-scrollbar {
    width: 12px;
}

.examples-menu-content::-webkit-scrollbar-track {
    background: var(--bg-primary);
    border-radius: 0 0 8px 0;
}

.examples-menu-content::-webkit-scrollbar-thumb {
    background: #3C3C3C;
    border-radius: 6px;
    border: 2px solid var(--bg-primary);
}

.examples-menu-content::-webkit-scrollbar-thumb:hover {
    background: #4C4C4C;
}

/* ========================================
   Example Cards
   ======================================== */

.example-card {
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: all 0.2s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.example-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent-primary), var(--node-composite));
    opacity: 0;
    transition: opacity 0.2s ease;
}

.example-card:hover {
    border-color: var(--accent-primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.example-card:hover::before {
    opacity: 1;
}

/* Card Header */
.example-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.example-card-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    line-height: 1.3;
    flex: 1;
}

.example-card-difficulty {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    padding: 4px 8px;
    border-radius: 3px;
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
    letter-spacing: 0.5px;
}

.example-card-difficulty i {
    font-size: 10px;
}

.difficulty-beginner {
    background-color: rgba(46, 204, 113, 0.15);
    border: 1px solid rgba(46, 204, 113, 0.3);
    color: #2ecc71;
}

.difficulty-intermediate {
    background-color: rgba(241, 196, 15, 0.15);
    border: 1px solid rgba(241, 196, 15, 0.3);
    color: #f1c40f;
}

.difficulty-advanced {
    background-color: rgba(231, 76, 60, 0.15);
    border: 1px solid rgba(231, 76, 60, 0.3);
    color: #e74c3c;
}

/* Card Description */
.example-card-description {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin: 0;
    flex: 1;
}

/* Card Tags */
.example-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.example-tag {
    font-size: 11px;
    color: #858585;
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid #3C3C3C;
    padding: 3px 8px;
    border-radius: 3px;
    font-weight: 500;
}

/* Card Load Button */
.example-card-load-btn {
    width: 100%;
    background-color: var(--accent-primary);
    color: #FFFFFF;
    border: none;
    padding: 10px 16px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.15s ease;
    margin-top: 4px;
}

.example-card-load-btn:hover {
    background-color: #1177BB;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 122, 204, 0.3);
}

.example-card-load-btn:active {
    transform: translateY(0);
    box-shadow: none;
}

.example-card-load-btn i {
    font-size: 12px;
}

/* ========================================
   Empty State
   ======================================== */

.examples-menu-empty {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: var(--text-muted);
    text-align: center;
}

.examples-menu-empty i {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.examples-menu-empty p {
    font-size: 14px;
    margin: 0;
}

/* ========================================
   Responsive Design
   ======================================== */

@media (max-width: 768px) {
    .examples-menu {
        width: 95%;
        max-height: 90vh;
    }

    .examples-menu-content {
        grid-template-columns: 1fr;
        padding: 16px;
    }

    .examples-menu-filters {
        overflow-x: auto;
        scrollbar-width: none;
    }

    .examples-menu-filters::-webkit-scrollbar {
        display: none;
    }
}

@media (min-width: 1400px) {
    .examples-menu {
        max-width: 1200px;
    }

    .examples-menu-content {
        grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    }
}
