/* Setup page specific styles */

/* Setup sections */
.setup-section {
    margin: 2rem 0;
    padding: 1.5rem;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
}

.setup-section h2 {
    margin-top: 0;
    margin-bottom: 0.5rem;
    font-size: 1.25rem;
    color: #333;
}

.setup-section > p {
    margin-top: 0;
    color: #666;
}

/* Selector grid for runtime cards */
.selector-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-top: 1rem;
}

@media (max-width: 600px) {
    .selector-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Card style for runtime selection */
.selector-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1.25rem 1rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
    transition: all 0.2s ease;
}

.selector-card:hover {
    border-color: #1976d2;
    background: #f5f9ff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Default selection for first runtime card when no selection is made */
.selector-grid:not(:has(input:checked)) .selector-card:first-child {
    border-color: #1976d2;
    background: #e3f2fd;
    box-shadow: 0 0 0 3px rgba(25, 118, 210, 0.2);
}

.selector-card:has(input:checked),
.selector-card.selected {
    border-color: #1976d2;
    background: #e3f2fd;
    box-shadow: 0 0 0 3px rgba(25, 118, 210, 0.2);
}

.selector-card:has(input:disabled) {
    opacity: 0.5;
    cursor: not-allowed;
    background: #f5f5f5;
}

.selector-card:has(input:disabled):hover {
    border-color: #e0e0e0;
    transform: none;
    box-shadow: none;
}

/* Hide radio input visually */
.selector-card input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.card-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}

.runtime-logo {
    width: 48px;
    height: 48px;
    object-fit: contain;
}

.card-label {
    font-weight: 600;
    font-size: 0.95rem;
    color: #333;
}

/* List style for strategy/location selection */
.selector-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 1rem;
}

.selector-option {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem 1.25rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
    transition: all 0.2s ease;
}

.selector-option:hover {
    border-color: #1976d2;
    background: #f5f9ff;
}

/* Default selection: first non-disabled option when no selection is made */
.selector-list:not(:has(input:checked)) .selector-option:not(.disabled):first-of-type {
    border-color: #1976d2;
    background: #e3f2fd;
}
/* Handle case where first item is disabled (like Bundler) - select second */
.selector-list:not(:has(input:checked)):has(.selector-option:first-child.disabled) .selector-option:nth-child(2):not(.disabled) {
    border-color: #1976d2;
    background: #e3f2fd;
}

.selector-option:has(input:checked),
.selector-option.selected {
    border-color: #1976d2;
    background: #e3f2fd;
}

.selector-option.disabled,
.selector-option:has(input:disabled) {
    opacity: 0.5;
    cursor: not-allowed;
    background: #f9f9f9;
}

.selector-option.disabled:hover,
.selector-option:has(input:disabled):hover {
    border-color: #e0e0e0;
    background: #f9f9f9;
}

.selector-option input[type="radio"] {
    margin-top: 0.25rem;
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.option-content {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.option-content strong {
    font-size: 1rem;
    color: #333;
}

.option-desc {
    font-size: 0.9rem;
    color: #666;
    line-height: 1.4;
}

.option-requires {
    font-size: 0.8rem;
    color: #d32f2f;
    font-style: italic;
}

/* Code blocks with copy button */
.code-block {
    position: relative;
    margin: 1rem 0;
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
}

.code-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 1rem;
    background: #f5f5f5;
    border-bottom: 1px solid #ddd;
}

.code-lang {
    font-size: 0.8rem;
    font-weight: 500;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.copy-btn {
    padding: 0.35rem 0.75rem;
    font-size: 0.8rem;
    font-weight: 500;
    color: #fff;
    background: #1976d2;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s;
}

.copy-btn:hover {
    background: #1565c0;
}

.code-block pre {
    margin: 0;
    padding: 1rem;
    overflow-x: auto;
    background: #fafafa;
}

.code-block code {
    font-family: ui-monospace, 'SF Mono', Monaco, 'Andale Mono', monospace;
    font-size: 0.875rem;
    line-height: 1.5;
    border: none;
    background: transparent;
}

/* Override highlight.js background */
.code-block pre code.hljs {
    background: transparent;
    padding: 0;
}
