/* OpenRouter UI Extensions */

/* Modal Improvements */
#or-modal .modal-box {
    max-width: 800px;
    /* Wider for grid */
    width: 90vw;
    display: flex;
    flex-direction: column;
    height: 80vh;
}

#or-modal .modal-body {
    padding: 20px;
    overflow: hidden;
    /* Internal scroll */
}

/* Search Bar */
#or-search {
    width: 100%;
    padding: 12px;
    background: var(--bg);
    border: 1px solid var(--border);
    color: var(--text);
    border-radius: 6px;
    font-family: var(--font-body);
    font-size: 14px;
    margin-bottom: 20px;
    outline: none;
    transition: border-color 0.2s;
}

#or-search:focus {
    border-color: var(--highlight);
}

/* Grid Layout */
.or-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
    overflow-y: auto;
    padding-right: 5px;
    /* Scrollbar space */
    flex: 1;
    /* Take remaining height */
    padding-bottom: 20px;
}

/* Card Style */
.or-card {
    background: var(--sidebar);
    border: 1px solid var(--border);
    border-radius: 0px;
    /* Sharp corners */
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.or-card:hover {
    border-color: var(--text-dim);
    transform: translateY(-2px);
}

.or-card.selected {
    border-color: var(--highlight);
    background: rgba(34, 197, 94, 0.05);
    /* Very subtle green tint */
}

/* Card Header: Provider + Checkbox */
.or-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.or-provider {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--text-dim);
}

.or-provider img {
    width: 16px;
    height: 16px;
    border-radius: 3px;
}

/* Checkbox */
.or-checkbox {
    appearance: none;
    width: 18px;
    height: 18px;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--bg);
    cursor: pointer;
    position: relative;
    transition: all 0.2s;
}

.or-checkbox:checked {
    background: var(--highlight);
    border-color: var(--highlight);
}

.or-checkbox:checked::after {
    content: '✓';
    position: absolute;
    color: #fff;
    /* White check */
    background: transparent;
    font-size: 12px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #000;
    /* Contrast on highlight green */
}

.or-card.selected .or-checkbox {
    background: var(--highlight);
    border-color: var(--highlight);
}

/* content */
.or-name {
    font-weight: 600;
    font-size: 14px;
    color: var(--text);
    line-height: 1.4;
}

.or-id {
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--text-dim);
    word-break: break-all;
}

/* Footer / Tags */
.or-tags {
    display: flex;
    gap: 6px;
    margin-top: auto;
}

.or-tag {
    font-size: 10px;
    background: var(--bg);
    padding: 3px 6px;
    border-radius: 4px;
    color: var(--text-dim);
    border: 1px solid var(--border);
}

/* Rate Limit Overlay */
.or-disabled-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--text);
    font-weight: bold;
    backdrop-filter: blur(2px);
    z-index: 10;
    border-radius: 8px;
}

/* Footer Controls */
.or-footer {
    padding-top: 15px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 0;
    /* Handled by modal body flex */
}

/* Premium Button Styling (Matches #send-btn) */
.btn-primary {
    background: var(--text);
    color: var(--bg);
    border: none;
    padding: 0 20px;
    height: 45px;
    /* Match input-bar height */
    font-weight: 700;
    font-family: var(--font-mono);
    cursor: pointer;
    transition: all 0.2s;
    border-radius: 0px;
    /* Sharp corners */
    text-transform: uppercase;
    font-size: 14px;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-primary:hover {
    background: #fff;
    transform: translateY(-1px);
    box-shadow: none;
    /* No glow */
}

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

body.light-mode .btn-primary {
    color: #fff;
    /* Invert for light mode contrast if needed */
}