/* Scripts page: extends root style.css with script-library specific styles */

.content-section {
    padding-bottom: 0;
}

/* Search area below section header */
.scripts-search-wrap {
    margin-bottom: 2rem;
    display: flex;
    justify-content: center;
}

.search-box {
    width: 100%;
    max-width: 500px;
    position: relative;
}

.search-hint {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-top: 5px;
    font-size: 12px;
    color: var(--text-secondary);
    white-space: nowrap;
}

#search-input {
    padding: 12px 45px 12px 15px;
    width: 100%;
    border: 2px solid var(--border-color);
    border-radius: 25px;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 15px;
    transition: all 0.3s ease;
    font-family: inherit;
}

#search-input::placeholder {
    color: var(--text-secondary);
}

#search-input:focus {
    outline: 3px solid var(--primary-light);
    outline-offset: 2px;
    border-color: var(--primary-color);
    box-shadow: var(--shadow-md);
}

.search-box::after {
    content: '\f002';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    right: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    pointer-events: none;
}

/* Keyboard focus for nav Home link */
#home.keyboard-selected {
    outline: 4px solid var(--primary-color);
    outline-offset: 2px;
    box-shadow: var(--shadow-md);
}

#content-container {
    padding: 0;
    max-width: 1200px;
    margin: 0 auto;
}

.content-box {
    margin-bottom: 20px;
    padding: 0;
    border: none;
    border-radius: 12px;
    background-color: var(--bg-primary);
    transition: all 0.3s ease;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.content-box:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.content-box.keyboard-selected {
    outline: 4px solid var(--primary-color);
    outline-offset: 2px;
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.content-box:focus {
    outline: 3px solid var(--primary-color);
    outline-offset: 2px;
}

.content-box mark {
    background-color: var(--accent-color);
    color: var(--bg-primary);
    padding: 2px 4px;
    border-radius: 3px;
    font-weight: 600;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    padding: 20px 25px;
    background: var(--bg-tertiary);
    transition: all 0.3s ease;
    outline: none;
    border-bottom: 1px solid var(--border-color);
}

.header:focus {
    outline: 3px solid var(--primary-color);
    outline-offset: -3px;
}

.header:hover {
    background: var(--border-color);
}

.link {
    color: var(--text-primary);
    user-select: none;
    font-size: 1.2em;
    flex: 1;
    font-weight: 600;
    margin: 0;
    transition: color 0.3s ease;
}

.header:hover .link {
    color: var(--primary-color);
}

.copy-button {
    background: var(--gradient-primary);
    border: none;
    border-radius: 8px;
    padding: 10px 16px;
    cursor: pointer;
    color: #ffffff;
    font-size: 0.9em;
    transition: all 0.3s ease;
    margin-left: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-sm);
    outline: none;
}

.copy-button:focus {
    outline: 3px solid rgba(255, 255, 255, 0.5);
    outline-offset: 2px;
}

.copy-button.keyboard-selected {
    outline: 4px solid var(--primary-dark);
    outline-offset: 2px;
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.copy-button:hover {
    background: var(--gradient-primary);
    filter: brightness(1.1);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.copy-button.copied {
    background: var(--secondary-color);
    box-shadow: var(--shadow-sm);
}

.copy-button.copied:hover {
    filter: brightness(1.1);
}

.script-content {
    width: 100%;
    max-height: 0;
    border: none;
    display: block;
    margin: 0;
    overflow: hidden;
    transition: max-height 0.4s ease, opacity 0.3s ease, padding 0.3s ease;
    border-radius: 0;
    background-color: var(--bg-tertiary);
    opacity: 0;
    padding: 0;
}

.script-content.show {
    max-height: 600px;
    opacity: 1;
    padding: 0;
    overflow: auto;
    box-shadow: inset var(--shadow-sm);
    border-top: 1px solid var(--border-color);
}

.script-content pre {
    margin: 0;
    padding: 20px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.6;
    white-space: pre-wrap;
    word-wrap: break-word;
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
    overflow-x: auto;
}

.script-content::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

.script-content::-webkit-scrollbar-track {
    background: var(--bg-tertiary);
}

.script-content::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 5px;
}

.script-content::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

/* Responsive */
@media (max-width: 768px) {
    .scripts-search-wrap {
        margin-bottom: 1.5rem;
    }

    #content-container {
        padding: 0;
    }

    .header {
        padding: 15px 20px;
        flex-wrap: wrap;
    }

    .link {
        font-size: 1.1em;
    }

    .copy-button {
        padding: 8px 12px;
        font-size: 0.85em;
    }
}
