/* API Key Management Styles */

.api-key-section {
    background-color: #f7f7f7;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.api-key-section h3 {
    margin-top: 0;
    color: #333;
    font-size: 1.2rem;
}

.api-key-section p {
    color: #666;
    margin-bottom: 15px;
    font-size: 0.9rem;
}

.api-key-input {
    display: flex;
    position: relative;
    margin-bottom: 15px;
    gap: 5px;
    flex-wrap: wrap;
}

.api-key-input input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #464646;
    border-radius: 4px;
    font-family: monospace;
    font-size: 1rem;
    background-color: #2d2d2d;
    color: #ffffff;
}

.api-key-input button {
    padding: 8px 15px;
    border: none;
    border-radius: 4px;
    background-color: #2a84f1;
    color: white;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s, opacity 0.2s;
}

.api-key-input button:hover {
    background-color: #1b6fd6;
}

.api-key-input button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.verify-button {
    background-color: #28a745 !important;
}

.verify-button:hover {
    background-color: #218838 !important;
}

.delete-button {
    background-color: #dc3545 !important;
}

.delete-button:hover {
    background-color: #c82333 !important;
}

/* Toggle switch for model enabling */
.model-toggle {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
}

.toggle-checkbox {
    height: 0;
    width: 0;
    visibility: hidden;
    position: absolute;
}

.toggle-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    width: 45px;
    height: 22px;
    background: #dc3545;
    border-radius: 100px;
    position: relative;
    transition: background-color 0.2s;
}

.toggle-label:after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 16px;
    height: 16px;
    background: #fff;
    border-radius: 50%;
    transition: 0.2s;
}

.toggle-checkbox:checked + .toggle-label {
    background: #28a745;
}

.toggle-checkbox:checked + .toggle-label:after {
    left: calc(100% - 3px);
    transform: translateX(-100%);
}

.toggle-label:active:after {
    width: 22px;
}

/* Disabled model styling */
.model-disabled {
    opacity: 0.6;
}

.model-option {
    position: relative;
    padding-right: 60px; /* Make room for toggle */
}

.api-key-status {
    display: flex;
    align-items: center;
    margin-top: 10px;
    font-size: 0.9rem;
}

.status-ok {
    color: #4CAF50;
    font-weight: bold;
}

.status-error {
    color: #f44336;
    font-weight: bold;
}

/* Styles for disabled AI features */
.ai-feature.disabled {
    opacity: 0.5;
    pointer-events: none;
}

.ai-feature.disabled::after {
    content: "API Key Required";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 0.8rem;
}

/* API key hints and instructions */
.key-instructions {
    font-size: 0.85rem;
    color: #666;
    margin-top: 8px;
}

.key-link {
    color: #2196F3;
    text-decoration: none;
}

.key-link:hover {
    text-decoration: underline;
}

/* Modal styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    overflow: auto;
    backdrop-filter: blur(3px);
}

.modal-content {
    background-color: #1e1e1e;
    margin: 10% auto;
    padding: 0;
    width: 90%;
    max-width: 600px;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    animation: modalFadeIn 0.3s ease;
}

@keyframes modalFadeIn {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

.modal-header {
    background-color: #2d2d2d;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #464646;
}

.modal-title {
    color: #00c3ff;
    font-size: 1.2rem;
    font-weight: 600;
    margin: 0;
}

.close-modal {
    color: #999;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.2s;
}

.close-modal:hover {
    color: #fff;
}

.modal-body {
    padding: 0;
    color: #cccccc;
    max-height: 70vh;
    overflow-y: auto;
}

.modal-footer {
    padding: 15px 20px;
    display: flex;
    justify-content: flex-end;
    background-color: #2d2d2d;
    border-top: 1px solid #464646;
}

.modal-footer .btn {
    padding: 8px 16px;
    background-color: #3d3d3d;
    color: #ffffff;
    border: 1px solid #464646;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.modal-footer .btn:hover {
    background-color: #4d4d4d;
}

/* Settings tabs */
.settings-tabs {
    display: flex;
    background-color: #2d2d2d;
    border-bottom: 1px solid #464646;
}

.settings-tab-button {
    padding: 12px 20px;
    background: none;
    border: none;
    color: #cccccc;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    border-bottom: 2px solid transparent;
}

.settings-tab-button.active {
    color: #00c3ff;
    border-bottom: 2px solid #00c3ff;
    background-color: #252525;
}

.settings-tab-button:hover:not(.active) {
    background-color: #353535;
    color: #ffffff;
}

.settings-tab-panel {
    display: none;
    padding: 20px;
}

.settings-tab-panel.active {
    display: block;
}

/* Model selection styles */
.model-selection-header {
    margin-bottom: 20px;
}

.model-selection-header h3 {
    margin-top: 0;
    color: #ffffff;
    font-size: 1.2rem;
    margin-bottom: 8px;
}

.model-selection-header p {
    color: #cccccc;
    margin-bottom: 0;
    font-size: 0.9rem;
}

.model-section {
    margin-bottom: 24px;
    background-color: #252525;
    border-radius: 6px;
    overflow: hidden;
}

.model-section-header {
    background-color: #333333;
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.model-section-header h4 {
    margin: 0;
    color: #ffffff;
    font-size: 1rem;
}

.model-section-header p {
    margin: 4px 0 0;
    color: #cccccc;
    font-size: 0.8rem;
}

.model-list {
    padding: 12px;
}

.model-option {
    display: flex;
    align-items: center;
    padding: 10px;
    margin-bottom: 6px;
    background-color: #2d2d2d;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.model-option:hover {
    background-color: #353535;
}

.model-option input[type="radio"] {
    margin-right: 12px;
}

.model-option .model-name {
    font-weight: bold;
    margin-right: 12px;
    color: #ffffff;
}

.model-option .model-description {
    font-size: 0.85rem;
    color: #bbbbbb;
}

/* Configure key message in model sections */
.configure-key-message {
    font-size: 0.8rem;
    color: #ff3b5c;
    display: none;
}

.configure-key-btn {
    background-color: #3d3d3d;
    color: #ffffff;
    border: none;
    border-radius: 4px;
    padding: 4px 8px;
    font-size: 0.8rem;
    cursor: pointer;
    margin-left: 8px;
}

.configure-key-btn:hover {
    background-color: #00c3ff;
    color: #121212;
}

/* Disabled provider section */
.disabled-provider .model-option {
    opacity: 0.5;
    cursor: not-allowed;
}

/* API key section styling */
.api-key-section {
    background-color: #252525;
    border: 1px solid #464646;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.api-key-section h3 {
    margin-top: 0;
    color: #ffffff;
    font-size: 1.2rem;
}

.api-key-section p {
    color: #cccccc;
    margin-bottom: 15px;
    font-size: 0.9rem;
}

.api-key-input {
    display: flex;
    gap: 10px;
}

.api-key-input input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #464646;
    border-radius: 4px;
    font-family: monospace;
    font-size: 1rem;
    background-color: #2d2d2d;
    color: #ffffff;
}

.api-key-input button {
    padding: 8px 16px;
    background-color: #00c3ff;
    color: #121212;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.2s;
}

.api-key-input button:hover {
    background-color: #33cfff;
}

.api-key-status {
    display: flex;
    align-items: center;
    margin-top: 10px;
    font-size: 0.9rem;
}

.status-ok {
    color: #00cc66;
    font-weight: bold;
}

.status-error {
    color: #ff3b5c;
    font-weight: bold;
}

/* Styles for disabled AI features */
.ai-feature.disabled {
    opacity: 0.5;
    pointer-events: none;
}

.ai-feature.disabled::after {
    content: "API Key Required";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 0.8rem;
}

/* API key hints and instructions */
.key-instructions {
    font-size: 0.85rem;
    color: #999999;
    margin-top: 8px;
}

.key-link {
    color: #00c3ff;
    text-decoration: none;
}

.key-link:hover {
    text-decoration: underline;
    color: #33cfff;
}

/* Provider toggle */
.provider-toggle {
    display: inline-flex;
    margin-left: 10px;
    vertical-align: middle;
}

/* Provider disabled state */
.provider-disabled {
    opacity: 0.7;
}

.provider-disabled .api-key-input input,
.provider-disabled .api-key-input button {
    pointer-events: none;
    opacity: 0.5;
}

.api-key-section h3 {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 1.1rem;
    font-weight: 600;
    color: #e2e2e2;
}

/* Make toggle smaller for the provider toggle */
.provider-toggle .toggle-label {
    width: 36px;
    height: 18px;
}

.provider-toggle .toggle-label:after {
    width: 12px;
    height: 12px;
}

.provider-toggle .toggle-checkbox:checked + .toggle-label:after {
    left: calc(100% - 3px);
    transform: translateX(-100%);
}

.configure-key-btn {
    margin-left: 8px;
    color: #2a84f1;
    background: none;
    border: none;
    font-size: 0.9rem;
    cursor: pointer;
    text-decoration: underline;
    padding: 0;
}

.configure-key-btn:hover {
    color: #1b6fd6;
} 