/* ==================== SECCIÓN DE API KEY ==================== */

/* Contenedor principal de la sección API Key */
.api-key-section {
    position: relative;
    margin: 50px auto;
    width: 90%;
    max-width: 600px;
    z-index: 10;
    animation: fadeIn 1s ease-out;
}

.api-key-container {
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(0, 255, 0, 0.3);
    border-radius: 15px;
    padding: 25px;
    box-shadow: 
        0 10px 40px rgba(0, 0, 0, 0.5),
        0 0 60px rgba(0, 255, 0, 0.1),
        inset 0 0 20px rgba(0, 255, 0, 0.05);
}

/* Título de la sección */
.api-key-title {
    font-size: 20px;
    color: #00ff00;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    text-shadow: 0 0 10px rgba(0, 255, 0, 0.5);
}

.api-key-title .icon {
    font-size: 24px;
}

/* Formulario de entrada */
.api-key-form {
    margin-bottom: 20px;
}

.input-group {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.api-key-input {
    flex: 1;
    padding: 12px 16px;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(0, 255, 0, 0.3);
    border-radius: 8px;
    color: #ffffff;
    font-size: 14px;
    font-family: 'Courier New', monospace;
    transition: all 0.3s ease;
}

.api-key-input:focus {
    outline: none;
    border-color: #00ff00;
    box-shadow: 0 0 15px rgba(0, 255, 0, 0.3);
    background: rgba(0, 0, 0, 0.7);
}

.api-key-input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

/* Botones */
.api-key-submit, .api-key-clear {
    padding: 12px 24px;
    background: linear-gradient(135deg, rgba(0, 255, 0, 0.2), rgba(0, 255, 0, 0.1));
    border: 1px solid rgba(0, 255, 0, 0.5);
    border-radius: 8px;
    color: #00ff00;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.api-key-submit:hover, .api-key-clear:hover {
    background: linear-gradient(135deg, rgba(0, 255, 0, 0.3), rgba(0, 255, 0, 0.2));
    border-color: #00ff00;
    box-shadow: 0 0 20px rgba(0, 255, 0, 0.4);
    transform: translateY(-2px);
}

.api-key-submit:active, .api-key-clear:active {
    transform: translateY(0);
}

.api-key-submit:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.api-key-clear {
    width: 100%;
    background: linear-gradient(135deg, rgba(255, 100, 0, 0.2), rgba(255, 50, 0, 0.1));
    border-color: rgba(255, 100, 0, 0.5);
    color: #ff9900;
}

.api-key-clear:hover {
    background: linear-gradient(135deg, rgba(255, 100, 0, 0.3), rgba(255, 50, 0, 0.2));
    border-color: #ff9900;
    box-shadow: 0 0 20px rgba(255, 100, 0, 0.4);
}

/* Loader del botón */
.button-loader {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.mini-spinner {
    width: 14px;
    height: 14px;
    border: 2px solid rgba(0, 255, 0, 0.3);
    border-top: 2px solid #00ff00;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* Contenedor de resultados */
.api-key-result {
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(0, 255, 0, 0.2);
    border-radius: 10px;
    padding: 20px;
    margin-top: 20px;
    animation: fadeInScale 0.5s ease-out;
}

/* Información de la API Key */
.key-info-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(0, 255, 0, 0.2);
}

.key-info-title {
    font-size: 18px;
    color: #00ff00;
    font-weight: 600;
}

.key-status {
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.key-status.active {
    background: rgba(0, 255, 0, 0.2);
    color: #00ff00;
    border: 1px solid rgba(0, 255, 0, 0.5);
}

.key-status.expired {
    background: rgba(255, 0, 0, 0.2);
    color: #ff4444;
    border: 1px solid rgba(255, 0, 0, 0.5);
}

.key-status.disabled {
    background: rgba(255, 200, 0, 0.2);
    color: #ffcc00;
    border: 1px solid rgba(255, 200, 0, 0.5);
}

/* Grid de información */
.key-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.info-item {
    background: rgba(0, 0, 0, 0.3);
    padding: 12px;
    border-radius: 8px;
    border: 1px solid rgba(0, 255, 0, 0.1);
}

.info-label {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 5px;
}

.info-value {
    font-size: 14px;
    color: #ffffff;
    font-weight: 500;
}

.info-value.highlight {
    color: #00ff00;
}

/* Barras de progreso */
.progress-bar-container {
    margin: 15px 0;
}

.progress-label {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 5px;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid rgba(0, 255, 0, 0.2);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #00ff00, #00cc00);
    border-radius: 3px;
    transition: width 0.5s ease-out;
    box-shadow: 0 0 10px rgba(0, 255, 0, 0.5);
}

.progress-fill.warning {
    background: linear-gradient(90deg, #ffcc00, #ff9900);
}

.progress-fill.danger {
    background: linear-gradient(90deg, #ff6600, #ff0000);
}

/* Lista de modelos */
.models-list {
    margin-top: 15px;
}

.models-header {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
}

.models-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    max-height: 200px;
    overflow-y: auto;
    padding: 10px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    border: 1px solid rgba(0, 255, 0, 0.1);
}

.model-tag {
    padding: 4px 10px;
    background: rgba(0, 255, 0, 0.1);
    border: 1px solid rgba(0, 255, 0, 0.3);
    border-radius: 12px;
    font-size: 11px;
    color: #00ff00;
    white-space: nowrap;
}

/* Mensajes de estado */
.status-messages {
    margin-top: 15px;
    padding: 10px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
}

.status-message {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.8);
    margin: 5px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Contenedor de error */
.api-key-error {
    background: rgba(255, 0, 0, 0.1);
    border: 1px solid rgba(255, 0, 0, 0.3);
    border-radius: 10px;
    padding: 15px;
    margin-top: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: shakeError 0.5s ease-out;
}

.error-icon {
    font-size: 20px;
}

#apiKeyErrorMessage {
    color: #ff6666;
    font-size: 14px;
}

/* Animaciones adicionales */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translate(-50%, 20px);
    }
    to {
        opacity: 1;
        transform: translate(-50%, 0);
    }
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes shakeError {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

/* Scrollbar personalizado para la lista de modelos */
.models-grid::-webkit-scrollbar {
    width: 6px;
}

.models-grid::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 3px;
}

.models-grid::-webkit-scrollbar-thumb {
    background: rgba(0, 255, 0, 0.3);
    border-radius: 3px;
}

.models-grid::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 255, 0, 0.5);
}

/* Responsive */
@media (max-width: 768px) {
    .api-key-section {
        width: 95%;
        bottom: 80px;
    }
    
    .api-key-container {
        padding: 20px;
    }
    
    .key-info-grid {
        grid-template-columns: 1fr;
    }
    
    .input-group {
        flex-direction: column;
    }
    
    .api-key-submit {
        width: 100%;
    }
}
